6

I was wondering if anyone has came up with a good solution for footnotes. I'm looking to implement footnotes within Tridion on a page that has multiple components and I want all footnotes to display at the bottom of the page with the correct footnote numbers that was generarted in the content section as well.

https://i.stack.imgur.com/dAxeh.png

In the content

"orem ipsum dolor sit amet, consectetur*1* adipiscing elit. Vivamus blandit, ligula pharetra laoreet porta, nibh augue*2* fringilla tellus, et aliquet quam lacus mattis risus. Praesent rutrum, leo eu ornare sagittis, tellus ante blandit arcu."

End of the page

1 footnote info


For example user will create component with content and that component will have component links to footnote component and at publish time it should collects all footnotes and render. It should match the numbers that are placed in the content itself.

Thanks

3 Answers 3

4

One option could be using the linking which supports anchor tridion:anchor linking, also anchor linking is OOTB available from Tridion RTF.

Documentation around anchor links:

http://sdllivecontent.sdl.com/LiveContent/content/en-US/SDL_Tridion_2011_SPONE/task_INSHYP2DDAFF2CF95E4430AA0F27AD7A91B5F8

http://sdllivecontent.sdl.com/LiveContent/content/en-US/SDL_Tridion_2011_SPONE/idheading-359728360

Other option, could be writing a custom TBB which process at the end of you page and generate the anchor tags. This approach may not work well if you have dynamic CTs as you could publish them independently.

3

If you are able to rely on JavaScript being available, that might be the most straightforward way to tackle this. You could simply publish the footnotes "in-line" in hidden elements, and compose the desired output in the browser.

If you want to do it in Tridion, I would suggest that your page template might first render the component presentations normally, and then render the relevant components again using a "Footnotes" component template. The hardest part would be to get the numbers correct, but you could do this by ensuring that each run through the components treats them in the order they are in the page, and then managing counters using context variables.

The standard context variable technique won't work in this scenario, as you're relying on one component render being able to 'inform' the next one where it's up to. (And then of course, repeating the whole thing for the footnotes). I've written a simple illustration of a technique to get round this over at Tridion Practice. This should point the way, but I imagine your implementation will need to be rather more complex.

EDIT: My answer assumes that your footnote data is in the same component as the text it refers to, but on re-reading your question, I see that you have separate components. Still - some of the technique may still apply.

2

Depending on your implementation model (static/dynamic/hybrid) you could also choose to generate these at render time using custom controls:

Lorem ipsum dolor sit amet, consectetur<dominic:FootNote>Footnote text goes here</dominic:FootNote> adipiscing elit. 
Vivamus blandit, ligula pharetra laoreet porta, nibh augue<dominic:FootNote>Footnote text goes here</dominic:FootNote> fringilla tellus, 
et aliquet quam lacus mattis risus. Praesent rutrum, leo eu ornare sagittis, tellus ante blandit arcu.

End of page you would use a FootnoteContainer:

<dominic:FootNoteContainer />

FootNote controls would assign themselves an autoincrement number and render as

<sup><a href="#footnotes">number</a></sup>

or whatever you would prefer as the presentation form of a footnote link.

The container would then find all of the FootNote controls on the page and write out the inner text of each FootNote in a list:

<ul>
  <li>number 1 footnote info</li>
  <li>...</li>
</ul>

or a similar presentation form.

Advantage of this approach is that it would not rely on the component presentations being static and it would greatly simplify your templated solution. Disadvantage would obviously be that you're sacrificing some request performance...

4
  • Yes, this is a great solution however I was looking for something that might be used for both Static and Dynamic. I don't think this solution would work for dynamic solution.. correct me if I'm wrong. Thanks
    – Levikay
    Oct 31, 2012 at 16:18
  • You mean you need to use this in combination with dynamic component presentations? Or do you mean you are using a content delivery framework like CWA or DD4T? Nov 2, 2012 at 8:33
  • @BjørnvanDommelen I've never had my name used as a namespace prefix before! Should I take a bow!? Nov 12, 2012 at 19:54
  • You could apply this technique with dynamic CPs just as well as for static ones, or a combination. It's just a bit harder, that's all, but your control could instantiate a link object and grab the relevant fields before rendering whatever magic it had to. Or possibly you'd render a different control for dynamic CPs. Nov 12, 2012 at 19:57

Your Answer

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

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