Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • CodeMaster2008 151 posts 184 karma points
    May 27, 2010 @ 19:29
    CodeMaster2008
    0

    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

  • Chris Dunn 210 posts 401 karma points
    May 27, 2010 @ 20:15
    Chris Dunn
    0

    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

  • CodeMaster2008 151 posts 184 karma points
    May 27, 2010 @ 20:25
    CodeMaster2008
    0

    Thanks a lot Chris

  • 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.

Please Sign in or register to post replies