Developer forum

Forum » Templates » Getting CustomFields in a Product loop

Getting CustomFields in a Product loop


Reply

Hi Im trying to access CustomField properties in a Product loop here is my template, but I dont seem to get any data out.

 

<!--@LoopStart(Products)-->
        <h3><!--@Ecom:Product.Name--></h3>
        <!--LoopStart(CustomFields)-->
            tag(<!--@[PageID].Value-->)
        <!--@LoopEnd(CustomFields)-->
<!--@LoopEnd(Products)-->

 

I have a CustomField called PageID with TemplateTag also PageID

 

What am I doing wrong?

 

- Sune


Replies

 
Reply

What if you did lige this ?

 

<!--@LoopStart(Products)-->
        <h3><!--@Ecom:Product.Name--></h3>
        <!--LoopStart(CustomFields)-->
            tag(<!--@PageID-->)
        <!--@LoopEnd(CustomFields)-->
<!--@LoopEnd(Products)-->

 

 

 

 
Reply
Dammark wrote:

What if you did lige this ?

 

<!--@LoopStart(Products)-->
        <h3><!--@Ecom:Product.Name--></h3>
        <!--LoopStart(CustomFields)-->
            tag(<!--@PageID-->)
        <!--@LoopEnd(CustomFields)-->
<!--@LoopEnd(Products)-->

 

 

 

 

Sorry still nothing. I created it as "Varefelter" via the eCom module. Isn't it these fields I access with the CustomFields loop?

 

- Sune 

 
Reply

Is it customfields or customfieldgroups that you are trying to use ?

 

// Dammark

 
Reply
Dammark wrote:

Is it customfields or customfieldgroups that you are trying to use ?

 

// Dammark

I'm trying to reach the custom fields that applies to products

 

- Sune

 
Reply

Yeah I get that, but there are 2 types fields.

 

1. Those called customfields on the general tab.

2. Those called customgroupfields on the groups tab.

 

Those in number 2 are not rendered on the productlist.

 

// Dammark

 
Reply
Dammark wrote:

Yeah I get that, but there are 2 types fields.

 

1. Those called customfields on the general tab.

2. Those called customgroupfields on the groups tab.

 

Those in number 2 are not rendered on the productlist.

 

// Dammark

I created them under the danish term "Varefelter" so I would assume that

this is the same as customfields and customgroupfields is the same as "Varegruppefelter", or am I getting it wrong?

 

- Sune

 
Reply

Throw me a link,  then I'll look at it ...

 

// Dammark

 
Reply
Dammark wrote:

Throw me a link,  then I'll look at it ...

 

// Dammark

http://gosh.net.dynamicweb.dk/Default.aspx?ID=289&responseType=html

 

this is the current testpage Im trying to write to.

 

- Sune

 
Reply

Hi again Sune

 

Apparently we both need glasses ... ;)

Take a look at this: <!--LoopStart(CustomFields)-->

 

Doesn't it need an @ in the beginning of the tag ?

 

// Dammark

 
Reply
Dammark wrote:

Hi again Sune

 

Apparently we both need glasses ... ;)

Take a look at this: <!--LoopStart(CustomFields)-->

 

Doesn't it need an @ in the beginning of the tag ?

 

// Dammark

Ill be damned, :) that did the trick. It works like a charm.

 

btw i grabbed the snippet from your example page here: http://templates.dynamicweb.dk/eCommerce/Dynamicweb-eCommerce-template-tags/Product-Catalog/Element/Product/Loops/CustomFields.aspx

 

maybe you should update it just to avoid future misunderstandings.

 

thanks for the help

 

- Sune

 
Reply

Thanks, we'll fix it:)

 

You must be logged in to post in the forum