Reputation: 923
Lets say I have a component using a set schema, and this component is used with two opposing component templates, for example:
Component: Product A
Template One: Product Marketing
Template Two: Product Support
Through dynamic component linking, I want to be able to use the component's tcm uri to specify a hyperlink to where the content resides (using a dreamweaver template i.e. <a href="tcm:11-xxxx">Link text</a>
)
The problem is though that if links are being generated to the wrong parts of the website I'm working on, i.e. links to product support in the product marketing section and vice versa.
I've tried setting the linking priority of the templates...both set to high....but Tridion seems to use the last template that was published for deciding where links should go.
Plus if I set one of the templates to medium and the other to high, it just takes the links to the content using the template with highest priority (i.e. all links going to product support, even in the product marketing section)
Does anyone know how to solve this? Thanks!
Upvotes: 8
Views: 581
Reputation: 4829
In addition to Chris comments, You can use the tridion:excludetemplateuri attribute to exactly control which Component Template you can link to depending on the your need either marketing or support.
in DWT.. you could use something like this.
<a tridion:href="tcm:8-299" tridion:excludetemplateuri="tcm:8-420-32">linkText</a>
Here is the link for reference
Upvotes: 8
Reputation: 10163
Your issue is related to the context of the published Component Presentation. SDL Tridion resolves priorities for target CP as follows (where it only moves to the next step if there is more than one match):
This is normally due to you having either a Dynamic Component Presentation (DCP) which is not actually on a page, or for some reason the Page ID is not set in your linking code, so then it can't calculate the location of the current CP, and as such must skip step (2) from above.
That probably does not help you solve your problem, but it does explain what you are seeing. So I can be of more help, please explain what you are publishing (is it a DCP?), and possibly look at the published code and check if a Page URI has been added to the linking code (and make sure it is not tcm:0-0-0).
Upvotes: 8