Copied to clipboard

Flag this post as spam?

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


  • Trine 29 posts 89 karma points
    Jun 27, 2013 @ 03:54
    Trine
    0

    "The data will be saved as Xml"

    The text implies that the xml will the automatically generated, but for me it doesn't. I am using v4.9.1, so am I doing something wrong? 

  • Jeavon Leopold 3074 posts 13632 karma points MVP 11x admin c-trib
    Jun 27, 2013 @ 16:32
    Jeavon Leopold
    0

    Hi Trine,

    I don't totally understand your question. Could you please provide some more information about what you need and also what code you are using then I'm sure we will be able to help you.

    Thanks,

    Jeavon

  • Trine 29 posts 89 karma points
    Jun 27, 2013 @ 20:49
    Trine
    0

    What I need to do is create several supporting content continers, each with a short heading, a bit of copy and a background image. Think in terms of the containers you see which say "24 HOUR SERVICE" and "We offer a 24 hour service for all members, etc.". At the moment there are about 8 different ones which have to appear on a few different pages each. The text and images for these need to be amended by people with no coding experience at all so Embedded Content seemed perfect for this. In Wordpress I would have used a widget.

    So I have set up an embedded content data-type:

    Then I've set up a Document Type:

     

    And that in turn is referenced in the content:

    However, when I come to set up the XSLT and Macro I have to set it up with a clean template:

     

    Which of course only generates this:

     

    Now, the Embedded Content download page says "Yet it is all embedded in the product node and it gets all saved as Xml in the backend." and "After you have create a new Embedded Content data type you can place it on a document type and add content to it on a content node. The data will be saved as Xml, here is an example:" so I got the impression that the XML would be automatically generated by Umbraco. That would be perfect as I don't know much about XML.

     

    Have I got the wrong impression? If not, what am I doing wrong? I'm a noobie to Umbraco and containers with images and text which can be amended without code is paramount to the site I'm building. I tried using a Content Picker to do this but that didn't seem to work, so I was hoping Embedded Content would be the way to go. Is this right?

     

    Thanks!! :-)

  • Jeavon Leopold 3074 posts 13632 karma points MVP 11x admin c-trib
    Jun 27, 2013 @ 20:57
    Jeavon Leopold
    0

    No problem at all, try this:

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp "&#x00A0;"> ]>
    <xsl:stylesheet 
        version="1.0" 
        xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
        xmlns:msxml="urn:schemas-microsoft-com:xslt"
        xmlns:umbraco.library="urn:umbraco.library" xmlns:Exslt.ExsltCommon="urn:Exslt.ExsltCommon" xmlns:Exslt.ExsltDatesAndTimes="urn:Exslt.ExsltDatesAndTimes" xmlns:Exslt.ExsltMath="urn:Exslt.ExsltMath" xmlns:Exslt.ExsltRegularExpressions="urn:Exslt.ExsltRegularExpressions" xmlns:Exslt.ExsltStrings="urn:Exslt.ExsltStrings" xmlns:Exslt.ExsltSets="urn:Exslt.ExsltSets" xmlns:Examine="urn:Examine" 
        exclude-result-prefixes="msxml umbraco.library Exslt.ExsltCommon Exslt.ExsltDatesAndTimes Exslt.ExsltMath Exslt.ExsltRegularExpressions Exslt.ExsltStrings Exslt.ExsltSets Examine ">
    <xsl:output method="xml" omit-xml-declaration="yes"/>
    
    <xsl:param name="currentPage"/>
    
    <xsl:template match="/">
    
    <xsl:for-each select="$currentPage/testProperties/data/item">
    
      <h1><xsl:value-of select="header"/></h1>
      <p><xsl:value-of select="sortText"/></p>
    
    </xsl:for-each>
    
    </xsl:template>
    
    </xsl:stylesheet>

     And then you will need to place the macro into your template using the macro button.

    Let me know if this gets you up and running?

  • Trine 29 posts 89 karma points
    Jun 27, 2013 @ 20:57
    Trine
    0

    Is there a video tutorial for the Embedded Content? That would be perfect!!

  • Jeavon Leopold 3074 posts 13632 karma points MVP 11x admin c-trib
    Jun 27, 2013 @ 21:00
    Jeavon Leopold
    0

    Sorry I had loads of extensions in the xsl:stylesheet section, just copy from below that

  • Trine 29 posts 89 karma points
    Jun 27, 2013 @ 23:18
    Trine
    0

    I copied and pasted the code and positioned the macro, but nothing is showing on the page when I view it. There isn't anything when I vew the code in Firebug either.

  • Jeavon Leopold 3074 posts 13632 karma points MVP 11x admin c-trib
    Jun 28, 2013 @ 23:41
    Jeavon Leopold
    0

    Are you viewing the page that has the embedded content data type on it and have you checked that the property aliases in the code match what you have set up, e.g. testProperties, header etc...

    I will create a quick intro video at some point next week as it is a good idea! Thanks.

Please Sign in or register to post replies

Write your reply to:

Draft