Important Notice from AspDotNetStorefront
It is with dismay that we report that we have been forced, through the action of hackers, to shut off write-access to this forum. We are keen to leave the wealth of material available to you for research. We have opened a new forum from which our community of users can seek help, support and advice from us and from each other. To post a new question to our community, please visit: http://forums.vortx.com
Results 1 to 12 of 12

Thread: Extension Data

  1. #1
    juliusbacosa is offline Member
    Join Date
    Apr 2009
    Posts
    75

    Default Extension Data

    can anyone here please explain a step by step way of displaying an extension data of a product.. for example...

    I have a product with a description and a specification...

    i want to display the description in a tab and the specification on the other tab..

    can you please help me out on how I can do this???

  2. #2
    Rob is offline Senior Member
    Join Date
    Aug 2004
    Posts
    3,037

    Default

    well, the tab part will depend on how you want to do it, usually CSS driven now. There are many tab scripts, and people on the forum here will surely suggest their own favorites. To bring out the data fields, from the XmlPackage, you just refer to them like we do the description, usually with disable-output-escaping set, so HTML is rendered. Try it out first on our simple product display formats, and make sure you get the hang of bring out different fields. you MAY have to add those new fields to the query/proc in the top of the package, if we are not bring the field out from the db by default (e.g. I don't think we bring summary out automatically).
    AspDotNetStorefront
    Shopping Cart

  3. #3
    juliusbacosa is offline Member
    Join Date
    Apr 2009
    Posts
    75

    Default

    can you please provide be example on how to bring out summary and data extension?

  4. #4
    juliusbacosa is offline Member
    Join Date
    Apr 2009
    Posts
    75

    Default

    ok I got i working now

  5. #5
    juliusbacosa is offline Member
    Join Date
    Apr 2009
    Posts
    75

    Default

    How can I format the extension data to display html..

    I want it to display a list . <ul><li></li></ul>

    but it will render it as text not html...

  6. #6
    juliusbacosa is offline Member
    Join Date
    Apr 2009
    Posts
    75

    Default

    got the thing working....

  7. #7
    Rob is offline Senior Member
    Join Date
    Aug 2004
    Posts
    3,037

    Default

    cool

    want to post a summary here? This is a very common thing to do. We can post this all in our manual (which no-one reads of course LOL) so hearing this all from a live customer is very helpful
    AspDotNetStorefront
    Shopping Cart

  8. #8
    Richnyc30 is offline Senior Member
    Join Date
    Mar 2009
    Posts
    340

    Default Extension data

    [QUOTE=AspDotNetStorefront;70751]well, the tab part will depend on how you want to do it, usually CSS driven now. There are many tab scripts, and people on the forum here will surely suggest their own favorites. To bring out the data fields, from the XmlPackage, you just refer to them like we do the description, usually with disable-output-escaping set, so HTML is rendered. Try it out first on our simple product display formats, and make sure you get the hang of bring out different fields. you MAY have to add those new fields to the query/proc in the top of the package, if we are not bring the field out from the db by default ...

    Where are the code examples of using Extension Data? And examples of how to stack data in the Extesnsion Data fields. I read the XML storage article in Knowledge base, but still need hard coding in the appropriate fields or code to understand what is intended. The manual has little to offer.

  9. #9
    StokesWebDevelopment is offline Junior Member
    Join Date
    Jul 2009
    Location
    Walnut Cove, NC
    Posts
    20

    Default

    I would love to see an example as well.

  10. #10
    George the Great is offline Senior Member
    Join Date
    Nov 2006
    Location
    Cleveland, OH
    Posts
    1,792

    Default

    Again, going to wholly depend on the xmlpackage you are using. Let's say for example you are using the product.simpleproduct.xml.config xmlpackage. This package uses the aspdnsf_ProductInfo stored procedure to retrieve data to be used in the xmlpackage. This is contained in a query node in the xmlpackage with a name of Products and a rowElementName of Product
    Code:
    <query name="Products" rowElementName="Product" runif="showproduct">
        <sql>
            <![CDATA[
                exec dbo.aspdnsf_ProductInfo @ProductID, @CustomerLevelID, 1, 0, @affiliateID
            ]]>
        </sql>
    Essentially, this means that any data returned by the stored procedure will be found in the root/products/product node of the xml that the xmlpackage transforms (you can see this xml for yourself by setting debug="true" in the top of the xmlpackage, and then browsing to the page where the xmlpackage is being used)
    Code:
    <package version="2.1" displayname="Simple Product" debug="true" includeentityhelper="true">
    Further down in the xmlpackage, you'll see
    Code:
    <xsl:template match="Product">
    which is used as a starting point (for lack of a better word) for where the cursor in xml currently exists. Since the query places the data in root/Products/Product, anything that occurs within the Product template essentially places you at the /root/Products/Product node and you can access the nodes there directly. For extension data, you could do
    Code:
    <xsl:value-of select="ExtensionData" disable-output-escaping="yes"/>
    You could also get any other value returned in the Product node (again, to see this xml you can set debug="true" for the xmlpackage) just by referencing the name of the node
    Code:
    <xsl:value-of select="NodeName" disable-output-escaping="yes"/>
    If the value you need is not returned in the XML (let's say you've added a custom field or need to reference a field from the database that isn't returned by the sql query at the top of the package), you can modify the sql that is being called to return the value you need and then reference it the same way...or you can create an entirely separate query...give it your own name (instead of Products/Product) and then reference it in it's own template or using full path syntax (if you're only returning a single value and don't need to traverse through multiple child nodes)
    Code:
    <xsl:value-of select="/root/CustomQueryName/CustomQueryRowElementName/ValueYouRetrieved" disable-output-escaping="yes"/>
    Last edited by George the Great; 01-08-2010 at 10:24 AM.
    <a href="http://www.aspdotnetstorefront.com">Shopping Cart Software</a>

  11. #11
    StokesWebDevelopment is offline Junior Member
    Join Date
    Jul 2009
    Location
    Walnut Cove, NC
    Posts
    20

    Default

    Great Info. Thanks.
    Randall Moore | Web Developer
    Stokes Web Development
    www.stokesweb.com

  12. #12
    lleemon is offline Member
    Join Date
    Jan 2007
    Posts
    57

    Default Extension Data output

    This article does provide some good value. I see how you can output additional fields by modifing the .config file. Now I can't seem to get how we can use the Extension Data area.

    1) I went into the admin, found the category and entered '.......' into the Extension area textarea box.
    2) I then went to my corresponding .xml.config file and added the line
    C#/VB.NET Code:
    <xsl:value-of select="ExtensionData" disable-output-escaping="yes"/> 
    Should my data in the Extension Data now show up in the spot I put the new node? Do I have to turn on something so Extension Data works?