Can we have publication targets defined on the basis of structure groups in Tridion 2009

StackOverflow https://stackoverflow.com/questions/11554681

  •  21-06-2021
  •  | 
  •  

Question

Can we have different publication targets on the basis of structure groups, so if we have two structure groups in my publication [07 Global English] as below:

1) My Website
2) My Mobile

So whenever user tries to publish the pages/structure group from "My Website" he can see the publication target "Webiste LIVE" and " Website Staging", however same user if he tries to publish from "My Mobile" structure group he will not see the above publication targets instead he will get "Mobile - LIVE" and "Mobile - Staging".

Please suggest if above scenario is possible

Thanks.

Best Regards,

MS

Was it helpful?

Solution

I would strongly advice to create a sibling Publication for the Mobile website, next to the default website. Then you don't need to imitate functionality from the content manager, and in particular blueprinting that's standard out of the box.

OTHER TIPS

I concur with Arjen on this one, the scenario you describe should be solved with a separate Publication and BluePrinting rather than trying to hack the Publishing Security model and make it apply to Structure groups instead of Publications (as it is designed).

But next to Rob's answer on trying a UI extension which would hide the non relevant targets based on the Structure Group, I think the only other option is to write a custom resolver which would remove the items from the Publish Transaction.

Now if memory serves me right a custom resolver was already possible in SDL Tridion 2009, but for safety reasons I will indicate this solution for SDL Tridion 2011 only (that I know is working).

A custom Resolver is a class which implements the IResolver interface through a Resolve() method, some example code of a resolver which removes items will be like:

public void Resolve(IdentifiableObject item, ResolveInstruction instruction, PublishContext context, Tridion.Collections.ISet<ResolvedItem> resolvedItems)
{
   List<ResolvedItem> itemsToRemove = new List<ResolvedItem>();
   foreach (ResolvedItem resolvedItem in resolvedItems)
   {
      // check if resolved item belongs here
      if (MyResolvedItemCheck(resolvedItem.Item.Id))
      {
         itemsToRemove.Add(resolvedItem);
      }
   }
   // remove all items that we need to discard
   foreach (ResolvedItem itemToRemove in itemsToRemove)
   {
      resolvedItems.Remove(itemToRemove);
   }
}

Please note that even though the resolver code is probably easier to write and less expensive than a UI extension is, I still think it is going to be more costly than using Publications and BluePrinting (even if your current SDL Tridion license contains a Blueprint limit which you have reached). You will have to do quite some coding in the MyResolvedItemCheck() method and depending on which targets are chosen by the publisher, you might end up with empty Publish Transactions and unclarity for the Editors this way.

I believe you can only set Publication Targets on a Publication (someone with more experience than me may say otherwise).

However, you may be able to add all 4 targets to the publication and write an extension which hides targets based on whether the TCM ID of the parent Structure Group matches a configured ID for mobile / website. This would be a hack though and I wouldn't recommend it.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top