Copied to clipboard

Flag this post as spam?

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


  • Johan Möller 83 posts 137 karma points
    May 19, 2010 @ 15:18
    Johan Möller
    0

    creating a getxmlnodebyid alike function for custom section.

    Hello again.

    I've created a custom section with some products and categories in it. Now i want to list these products like i can list normal content nodes.

    Ive got a xslt extension set up where i can get the data but i have no way to get like the product name and product size then placing them apart where i want.

    So how do i do this?

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    May 19, 2010 @ 16:04
    Dirk De Grave
    0

    Hmm, not sure if I understand that correctly... what is the issue exactly, do you have problems listing the nodes in de custom section, or displaying the info on the frontend?

     

    Cheers,

    /Dirk

  • Johan Möller 83 posts 137 karma points
    May 19, 2010 @ 16:27
    Johan Möller
    0

    I want to list my products from custom section in the frontend with a xslt macro.

    I have a xslt function and i want to know how i woud create a function for listing em out. I'm guessing some xml output but i feel a bit lost.

    All ive done so far is a function where i can just return a products name by its id so i know the extension is working.

  • Chris Houston 535 posts 980 karma points MVP admin c-trib
    May 19, 2010 @ 17:25
    Chris Houston
    0

    Hi Johan,

    Are you:

    a) Your products are stored in a database structure out side of the normal Umbraco structure and you are trying to access this data within XSLT by using a custom XSLT extension?

    b) Your products are within the normal content section of Umbraco and you want to know how to access them?

    If it's (a) you will need to write an XSLT extension that returns a XPathNodeIterator that then enables you to access that data within XSLT

    If the answer is (b) you will need to go from the $currentPage up to the root level in XSL and then find the product section to be able to iterate through your products.

    If you can give us some more information I am sure we can help you.

    Best regards,

    Chris

  • Johan Möller 83 posts 137 karma points
    May 20, 2010 @ 08:27
    Johan Möller
    0

    Its (a)

    Is there anywhere i can read more about the xPathNodeIterator or any good examples i can have a look at?

     

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    May 24, 2010 @ 10:07
    Dirk De Grave
    0

    A wiki article on using xslt extension, returning an XPathNodeIterator and use in your xslt can be found here.

     

    Hope this helps.

    Regards,

    /Dirk

Please Sign in or register to post replies

Write your reply to:

Draft