10

Can i use the <xsl:include url="some.xslt"/> tag in the rtf xslt format area in a schema, to always include the same xslt and only have to change it once instead of in all my templates?

And if possible, what would be the root folder to include from? I tried putting it in the E:\Tridion\web folder, but no luck with either url="/some.xslt" or url="e:\Tridion\web\some.xslt".

The client is still on 2009 SP1 but the client is upgrading to 2013 later this year.

8

This certainly used to work back in early R5, but I have not tried it in a long time. I believe it even worked by including the URI or an XSLT CT/TBB.

Have you tried using the href attribute rather than the invalid url attribute?

Take a look at: http://www.w3schools.com/xsl//el_include.asp

  • Good call on the href attribute. I actually did it correct in my xslt filter <xsl:include href="/a.xslt"/>. So no luck... Do you know what the root folder should be? – Allard Buijen Jun 28 '13 at 12:40
  • You might try putting it in ../Tridion/web and referencing it with an absolute path like localhost/include.xslt - Like I say, I have not tried this since early R5, so I have no idea if it works. – Chris Summers Jun 28 '13 at 12:49
  • 1
    I tried it on my machine, and it does not seem to work. Do keep in mind that the way the GUI caches schemas, may prevent changes showing even if you do get it to work. You might consider just making an embeddable RTF single field schema which you can reuse in all your schemas – Chris Summers Jun 28 '13 at 12:57
  • I'm not a fan of that approach, Chris. I think schemas should be designed to provide the easiest content management experience possible, not as a work-around for a technical limitation. – Quirijn Jul 2 '13 at 21:43
  • 2
    @ChrisSummers It gives them an extra field heading, for one. Plus it complicates the data structure, which may cause other problems. In 2011 for example it is impossible to add new values to an embedded field in Experience Manager. So your suggested solution would effectively prohibit the use of XPM on Tridion 2011. – Quirijn Jul 3 '13 at 8:23
3

A while ago, I tried this without success, and even went as far as creating an idea on the ideas site. My idea was that modular development on RTF XSLTs could be supported by using xsl:include - I also suggested that being able to include XSLT TBBs would be a good thing, although any useful mechanism would do.

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.