Developer forum
E-mail notifications
Groupfields in productlist
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
Try adding this variable to your XSLT:
<xsl:variable name="availableloops" select="'CustomGroupFields'" />
Or read the attaced release notes on page 6 ;)
// Dammark
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.
// Dammark
Arggghhh ..... I hate frekking fucked up filenames.
Well, you can find it under Downloads > Releases ...
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
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 :-(
But in that case you're totally correct.
These fields are not available in the productlist template.
// Sebastian
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 ... ;-)
// Sebastian
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:
--- Do stuff --
<xsl:template match="item" mode="variants">
--- Do stuff --
</template>
How would you do it now ?
/Thor
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" />
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:
Now i would expect the xml output to contain those four loops, however it does not.
What am i doing wrong ?
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