Developer forum

Forum » Templates » Item based table

Item based table

Esben Kvorning
Reply

Hi guys,

 

I'm trying to create a dynamic using Items.

I have an item called "Table Row" that contains an unspecified amount of items - this could be items like Name, Image, Size, Colour, PDF etc.

I want to use this "Table Row" as an item list within several different tables. I might have an item table called something like "Table - Products" that uses all the "Table Row" items (Name, Image, Size, Colour, PDF) and then I might have another table called "Table - Documentation" that only uses the Name and PDF items from the "Table Row" item list.

This leaves me with two loops: a Table Row loop and within that, a Table Data loop.

Now to the questions:

1. Is it possible to get the Item type returned somehow(e.g. Image, Text, Color etc.)?
E.g. if it's an Image, I want to wrap the Item content in an tag and if it's a File I want to wrap it in an "a" tag.

 

2. Is there a way to carry over Item fields sort order from DW backend? 

Within the DW backend I can easily rearrange the order of the "Table Row" items so that they conform to the table they're being used in (in some tables, the "Image" item might need to come before the "Name" item for instance) but when it comes to my template output DW ignores whatever sort order I have made both on the items within the "Table Row" item list or the sort order I have defined when adding "Table Row" as an item list (see attached item-field-sort-order.png).

3. Is it possible to get the Item system name returned?
Looking at the DwTemplateTags output, I only have access to one name tag (Item.TableRow.Field.Name) which is the human readable version. I would very much like the machine readable version of this.

I think that's it for now, but I'll most likely think of more questions later :)

Thanks in advance,
Esben

item-field-sort-order.png

Replies

 
Mikkel Ricky
Reply

We're currently working on some improvements to the rendering of items, and these improvements will give you 1 and 3.

Number 2 makes sense as well, but currently you cannot do this. We'll look into how much work it requires to implement this.

Best regards,
Mikkel

 

 

 

  

 
Esben Kvorning
Reply

Do you know if there's any expected release date for these changes? 

// Esben

 

 

 

 

 
Mikkel Ricky
Reply

1 and 3 will be released in Dynamicweb 8.4 at the end of January 2014.

We're still looking at number 2 and don't yet have a specific time frame for it. For now, you have to handle the ordering of the fields in your template by using the individual item field template tags (@Item.«SystemName») rather then the Item.Fields loop.

Best regards,
Mikkel

 

   

 

You must be logged in to post in the forum