Copied to clipboard

Flag this post as spam?

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


  • Dan Higbie 11 posts 31 karma points
    Jul 13, 2010 @ 21:15
    Dan Higbie
    0

    I am still working to figure this out, how can I define how this info will be displayed on my page, I want to created a div with an unordered list inside.

    What do I need to do to convert the XML data to CSS style-able data for display? This doesn't seem well documented, or perhaps I am just not getting it.

  • Tom Fulton 2030 posts 4996 karma points c-trib
    Jul 13, 2010 @ 21:19
    Tom Fulton
    0

    Hi Dan,

    You'd want to use an XSLT Macro to parse and display the data how you like.  There is an XSLT Sample on Masood's Blog that should get you started.

  • Dan Higbie 11 posts 31 karma points
    Jul 13, 2010 @ 21:22
    Dan Higbie
    0

    OK, I think this is where my trouble is starting. I need to set up the XSLT file to parse the xml created by the datatype? Then in my doctype I add the repeatable datatype, and add the umbraco field to the template? Sorry if this is all wrong, just trying to wrap my head around it.

    Thanks for your super quick reply.

  • Tom Fulton 2030 posts 4996 karma points c-trib
    Jul 13, 2010 @ 21:30
    Tom Fulton
    0

    Yep - the XSLT file parses the XML to format the data how you like.  You're on the right track, except you'd insert the XSLT Macro into your template (not the field).  Here's the whole process:

    - Define the RCC datatype in the Developer -> Datatypes section (setup your fields, etc)

    - Add the datatype you created to a doctype

    - Create a new XSLT macro

    - Insert the XSLT macro onto the template you are using for the doctype

     

    That XSLT sample should get you started on the Macro part, but just post back if any questions on that.  It'd be something like:

    <div>
    <ul>
    <xsl:if test="$currentPage/data [@alias='myfieldname']/items/item">
    <xsl:for-each select="$currentPage/data [@alias='myfieldname']/items/item">
    <li><xsl:value-of select="./data [@alias='nameofrccproperty']"/></li>
    </xsl:for-each>
    </xsl:if>
    </ul>
    </div>
  • wolulcmit 357 posts 693 karma points
    Jul 13, 2010 @ 22:58
    wolulcmit
    0

    best advice might be to install Runway and have a look at how it's done from this basic project. failing that another great example is the CWS website starter

  • Dan Higbie 11 posts 31 karma points
    Jul 13, 2010 @ 23:03
    Dan Higbie
    0

    Great! I have it working!

    Thanks for the help, I just needed to clarify that area.
    The site is coming along well. This site has been very helpful for the questions I have had.

  • Allan Hawkey 232 posts 303 karma points
    Feb 18, 2011 @ 20:02
    Allan Hawkey
    0

    I'm probably missing something obvious, but I can't seem to get any content to display on my site which uses v4.5.2.

    I have:

    • installed the package successfully
    • set up fields in the datatype ("test" and "email" for now, as both name and alias of the fields)
    • added the datatype to a document type and given it the alias "repeatableCustomContent"
    • created a macro called "Repeatable" (alias is also "Repeatable") and a related XSLT file "Repeatable.xslt"
    • used Masood's XSLT example, changing only the property value aliases to "test" and "email"
    • inserted the macro into a page template which is allowed under the document type where I've added the datatype property
    • added some example data onto a page which uses the page template with the macro

    Everything seems to save OK, but nothing is displayed on the site.

    What am I missing?

Please Sign in or register to post replies

Write your reply to:

Draft