I'm creating a custom section based on this really nice tutorial. Since it will be company info (name, address, phone, things like that) I'm still not sure if I will create a custom table (for just one record?) or a XML file.
However my question is: How can I read values from a custom table or xml file on a template or inside a macro (using xslt)?
If it's just a single record you might want to go with an xml for simplicity. Depends on the update process for that custom section.
If you want to go with a table you will probably need to write a custom xslt function to handle retrieving the data from the table and returning it in a usable format. Here's a posting by Paul about how to get started: www.motusconnect.com/blog/2008/12/11/umbraco-xslt-extension-for-seo.
If you are storing as xml there are already existing xslt functions to help you out.
Reading data from custom table or xml file
Hi there;
I'm creating a custom section based on this really nice tutorial. Since it will be company info (name, address, phone, things like that) I'm still not sure if I will create a custom table (for just one record?) or a XML file.
However my question is: How can I read values from a custom table or xml file on a template or inside a macro (using xslt)?
Thanks
If it's just a single record you might want to go with an xml for simplicity. Depends on the update process for that custom section.
If you want to go with a table you will probably need to write a custom xslt function to handle retrieving the data from the table and returning it in a usable format. Here's a posting by Paul about how to get started: www.motusconnect.com/blog/2008/12/11/umbraco-xslt-extension-for-seo.
If you are storing as xml there are already existing xslt functions to help you out.
Check out in the wikis:
umbraco.library:GetXmlDocumentByUrl (http://our.umbraco.org/wiki/reference/umbracolibrary/getxmldocumentbyurl)
umbraco.library:GetXmlDocument (Don't think this is filled out)
-Chris
Thanks a lot Chris
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.