4

I just noticed the title of the question has been updated. I'm not sure you understand what i'm looking for. Maybe i was not clear enough.

In a DWT i have the following block of code:

 <div class="contactBloc">

                      <legend class="hidden">@@Component.Fields.theme_title@@</legend>

                       <h2>@@Component.Fields.theme_title@@</h2>
                       <div class="fieldset">
                                       <ul id="selectTheme">
                                                       <!-- TemplateBeginRepeat name="Component.Fields.theme" -->
                                                       <li><a tridion:href="@@Field.theme_form@@" rel="">@@Field.theme_name@@</a></li>
                                                       <!-- TemplateEndRepeat -->                                                    
                                       </ul>
                                       <span class="clear">&nbsp;</span>
                       </div>
        </div>

in the "a" tag above, the href attribute contains for instance "/contact/contact.aspx"

This is how it works right now!

Now, i don't use any "a" tags anymore, i have to use a "input" tag instead. Therefore, i want to display "/contact/contact.aspx" in the "rel" attribute of the "input" tag.

Instead of

<a tridion:href="@@Field.theme_form@@" rel="">@@Field.theme_name@@</a>

i tried, as you wrote:

<input type=""checkbox" tridion:href="@@Field.theme_form@@" tridion:targetattribute="rel">@@Field.theme_name@@</a>

But in the code generated, i have no rel and what href contains instead of "/contact/contact.aspx" is just "tcm:XX-XXXX"

Thanks for your help

4
  • Hi Arnaud. You're probably for tridion:linkAttributes. See this question from some info: stackoverflow.com/questions/12046332/… and tridion.stackexchange.com/questions/2346/… Commented Jul 29, 2014 at 15:16
  • Thanks a lot for your fast reply. Unfortunately this is the code generated: <input id="Investor Relations" type="checkbox" tridion:linkattributes="tcm:127-28220">
    – user1178
    Commented Jul 29, 2014 at 15:22
  • it's tridion:targetattribute, see answer below.
    – Nuno Linhares
    Commented Jul 29, 2014 at 15:23
  • Your input element looks malformed - is that what's in your template verbatim? type=""checkbox" - also, not sure if this is necessary but in Nuno's example he includes a dummy rel attribute.
    – Ant P
    Commented Jul 30, 2014 at 10:45

1 Answer 1

4

Welcome to Stack Exchange Arnaud.

This page on SDL Live Content (login required) shows the various options you have for linking.

You can achieve the functionality you want with something like this:

<input id="blahblah" rel="something" tridion:href="@@Field.theme.form@@" tridion:targetattribute="rel" />
4
  • Thanks for your help: I tried this : <input tridion:targetattribute="@@Field.theme_form@@"></input> But the code generate is : tridion:targetattribute="tcm:XX-XXXX" :(
    – user1178
    Commented Jul 29, 2014 at 15:29
  • Nuno says to set <input tridion:targetattribute="rel" tridion:href="@@Field.theme.form@@". Copy/paste carefully please. Commented Jul 29, 2014 at 15:51
  • You need to use both tridion:href and tridion:targetattribute="name_of_attribute_to_get_result"
    – Nuno Linhares
    Commented Jul 29, 2014 at 16:18
  • I just tried what you wrote but it still does not work. no "rel" attribute appears in my input and the href contains "tcm:XX-XXXX". On the other hand when i write this tridion:href in a "a" tag it works ...
    – user1178
    Commented Jul 30, 2014 at 7:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.