5

We are using the following line of code in our DreamWeaver Template to resolve a link in Tridion. But,not getting the desired output, the link is not being resolved on the page. Is there anything wrong with the code? Please help..

<a href="@@internal@@" tridion:href="@@internal@@" title="@@title@@" target="_blank">
    @@title@@
</a>      
<a tridion:href="@@Component.ID@@" href="dummy.html" class="intro-link">
    <h2>@@RenderComponentField("title_intro", 0)@@</h2>
</a>  
  • 2
    Please describe what you have done so far to solve this. Otherwise, maybe someone on telepathy.stackexchange.com can help. – Dominic Cronin Apr 3 '13 at 12:49
5

Assuming @@internal@@ is the Tcm Id of component you are trying to link to, is that component on a published page on your target site?

What does the published page look like on the server? (not the rendered page in the browser)

Depending on your set up, in place of the links, you should see some dynamic controls. For example if you are publishing to an ASP.NET website I'd expect to see something like <tridion:ComponentLink runat="server"..

If you are seeing these tags, and the link is not resolved, it's because the component you are linking to is not on a published page.

If you are not seeing those tags the question here maybe able to help you.

| improve this answer | |
5

The code looks all right, I personally wouldn't put spaces between RenderComponentField and its parenthesis, but it will work.

If you run this Template in the Template Builder, you can inspect the Output of the separate TBBs, for instance right after your Dreamweaver TBB, your Output should look something like:

<a href="tcm:1-2" tridion:href="tcm:1-2" title="My Title" target="_blank">My Title</a>  

<a tridion:href="tcm:1-3" href="dummy.html" class="intro-link"><h2><tcdl:ComponentField name="title" index="0">My Intro</tcdl:ComponentField></h2></a> 

Now important to notice is that the outcome of @@internal@@ should be a valid Component TCMURI.

Then after the Default Finish Actions, the Output should look something like:

<a href="/WebUI/Editors/CME/Views/Popups/Preview/Preview.aspx#id=tcm:1-2"  title="My Title" target="_blank">My Title</a>  

<a href="/WebUI/Editors/CME/Views/Popups/Preview/Preview.aspx#id=tcm:1-3"  class="intro-link"><h2>My Intro</h2></a> 

If that all works as expected, check the Publication Target for its Target Language (should not be set to (None)) and make sure your Page Template has an appropriate extension set (common mistake is to leave that as html, and then any code in there will be ignored by the webserver most of the time).

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.