Umbraco inline xslt in template




















I am looking to populate the menu if a specific template is used rather than a content node. For example. I have a template called portal. Portal can be applied to any content textpage. In the template is a set of buttons. These buttons need to display all the pages that use the portal template rather than displaying pages that belong to a specific parent node. I thought that if the templates are saved to an XML file when they are generated then this would be simple because they would have a node id.

As I recall, the template is the id of the template not its alias. If you want to use the alias you'd need to write a quick little xslt extension or use some inline c in your xslt to get the id from the template alias:. I came to this post via a search for "xslt template alias", so if anyone is interested in the code necessary to get the alias name of a template via XSLT, here is the code:. I used this in a package I just uploaded, if you want to see the whole xslt: Dynamic Body Tag.

I have tried to create a new media which type is folder. And I move the image media to that folder. I found the id in my created folder. In order to fetch the image you need to create either inline xslt directly in the template or create a macro based on either razor or XSLT to get the image. If you create a XSLT based macro you need to use the GetMedia extension, which is also being used in the inline example above.

Be aware to use the correct sample with the new XML schema since I'm guessing you are using version 4. I typed this from memory, so don't expect it to work without some fiddling. Basically all it does is return the location of the media ID you pass it. This is also, most likely, complete overkill for this Above code is working for me and logoImage is the property with media picker type.

Sign in Register. Our Forum Templating Templates and document types. Flag this post as spam? Improve this answer. Sign up or log in Sign up using Google. Sign up using Facebook. Sign up using Email and Password. Post as a guest Name. Email Required, but never shown. The Overflow Blog. Podcast Making Agile work for data science. Stack Gives Back Featured on Meta. New post summary designs on greatest hits now, everywhere else eventually. Related Hot Network Questions.



0コメント

  • 1000 / 1000