Developer forum

Forum » Templates » Groupfields in productlist

Groupfields in productlist


Reply
I can't find the Groupfields in the xml for the productlist in Ecom. Can I enable it somewhere or is it just not included in the productlist xml?

Has anyone run into this?

I need the groupfields for a jQuery-based filter system based on the values (of the groupfields). I could use the product fields, but groupfields are nicer to work with (they're in a loop) - productfields aren't.

Thanks

Martin

Replies

 
Reply
Hi Martin

Try adding this variable to your XSLT:
<xsl:variable name="availableloops" select="'CustomGroupFields'" />

Or read the attaced release notes on page 6 ;)

// Dammark
 
Reply

I've added it, but it doesn't seem to work. It works in the product template, but not in the product list template.

In the product template they're called GroupFields. I've tried both GroupFields and CustomGroupFields.
 
Reply
Throw me a link and I'll look at it ...

// Dammark
 
Reply
The link is broken.. :(
 
Reply
Hi Rasmus

Arggghhh ..... I hate frekking fucked up filenames.
Well, you can find it under Downloads > Releases ...
 
Reply
Hi Martin

Now I've added the following:
<xsl:variable name="availableloops" select="'Products,CustomGroupFields'" />

But at first I didn't get the 'CustomGroupFields' loop, and that was because there wasn't any fields to loop.

So I've created a test field and now it's in your output ;)

// Sebastian
 
Reply

DOH! Sorry, but I meant the fields called 'Field groups', which are set on each product and accessed via the Fields tab on each product. Not the fields for an entire group.

In the PRODUCT template, they're called GroupFields(/item/Groups/item/Fields. (loop[@name='GroupFields']/item/loop[@name='Groups']/item/loop[@name='Fields']/item)

I've made two groups called Default and Colours. I'd like to access the data on the PRODUCT LIST in the same way as in the PRODUCT template.

Sorry for not being clear on that :-(
 
Reply
Ahhhh .... I see.
But in that case you're totally correct.
These fields are not available in the productlist template.

 // Sebastian
 
Reply
Oh. Too bad.

Can I add it to some kind of wishlist or isn't it possible at all to add them?

Or, I could file it as a bug ... ;-)


 
Reply
I've added it to our Product Backlog ...

// Sebastian
 
Reply
Thanks.
 
Reply
I've tried to get this to work on several of our solutions without any luck. 
I simply can't get it to work, though i only tried to get the "Variants" loop.

I tried inserting <xsl:variable name="availableloops" select="Products,'Variants'" /> and <xsl:variable name="availableloops" select="'Variants'" /> but nothing happens. No XML. What am i doing wrong could you give an example on how to use it.

What i would usually do is something like this: 

    <xsl:template match="/">
        <xsl:apply-templates select="Template/loop [@name = 'Products']/item" />
    </xsl:template>
 
    <xsl:template match="item">
        --- Do stuff --
       <xsl:apply-templates select="loop [@name = 'Variants']/item" mode="variants"/>
    </xsl:template>

    <xsl:template match="item" mode="variants">
        --- Do stuff --
    </template>

How would you do it now ? 

/Thor 


 
Nicolai Høeg Pedersen
Reply

Available loops is not required - depends on your xslt syntax.

Feature is described in http://engage.dynamicweb-cms.com/Admin/Public/DWSDownload.aspx?File=Files%2fFiler%2fDocumentation%2fRelease%2fDynamicweb+7.1%2f(en-US)+Technical+Release+Notes%2c+Dynamicweb+7.1.pdf page 7.

Be carefull with the syntax of the select statement in availableloops.

Is it a product list template or product template?

You can find all product loops here:
http://templates.dynamicweb.dk/eCommerce/Dynamicweb-eCommerce-template-tags/Product-Catalog/Product-detail/Loops.aspx

And all product list loops here:
http://templates.dynamicweb.dk/eCommerce/Dynamicweb-eCommerce-template-tags/Product-Catalog/Product-list/Loops.aspx

An example is this:
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0"  xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:variable name="availableloops" select="'Groups,Products'" /> 
<xsl:output method="xml" omit-xml-declaration="yes" indent="yes"  encoding="utf-8" />

 
Reply
Thank you for your reply, but unfortunately this did not get me any futher. 

I have looked at det technical documentation which you link to before i posted this. However the documentation does not help me. All it says is that i should insert <xsl:variable name="availableloops" select="'Groups,Products'" /> which would then render Groups and products. No example or any clue to where you should insert it or how to use the loops afterwards...

I also tried to use your example with a few extra loops added, here is what my simple template looks like:

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0"  xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:variable name="availableloops" select="'Groups,Products,GroupFields,CustomFieldList'" />
    <xsl:output method="xml" omit-xml-declaration="yes" indent="yes"  encoding="utf-8" />
 
    <xsl:template match="/">
            <textarea>
                <xsl:copy-of select="." />
            </textarea>
    </xsl:template>
 
 
</xsl:stylesheet>

Now i would expect the xml output to contain those four loops, however it does not.
What am i doing wrong ? 
 
 
Nicolai Høeg Pedersen
Reply
Is it a product list template or product template?

Think I need a link to the solution. Mail or post here... np at dynamicweb.dk

 

You must be logged in to post in the forum