Developer forum

Forum » Templates » Layout on Datalist loopa

Layout on Datalist loopa

Tom-Erik Paulsen
Reply

Hi!

I'm trying to add an layout on my datalist template.

I want to check what kind of column every field is, så that i can apply an html tag to each.

Without using the <!--@LoopStart(Row)--> rather than the Rows loop


<!--@LoopStart(Rows)-->
<!--@Row.Value(AccessUserEmail)-->
<!--@Row.Value(AccessUserName)-->
<!--@LoopEnd(Rows)-->
 

Is that possible?

 

 


Replies

 
Tom-Erik Paulsen
Reply
Made a workaround with CSS. Tags should be shown as avaliable in the "template tags" function in the editor, since the documentation is lacking information about what tags to use.

<!--@LoopStart(Rows)-->
<!--@LoopStart(Row)-->
<span class="<!--@Row.ColumnName-->"><!--@Row.Value--></span>
<!--@LoopEnd(Row)-->
<!--@LoopEnd(Rows)-->

 

 
Tom-Erik Paulsen
Reply
Is it legal to check the value of a tag like this?


<!--@If (Row.ColumnName=AccessUserImage)-->
<img src="<!--@Row.Value-->" />
<!--@EndIf-->

 

 
Mikkel Ricky
Reply

Yes, you can use @If to check the column name

<!--@If(Row.ColumnName=="AccessUserImage")-->
	<img src="<!--@Row.Value-->"/>
<!--@EndIf-->

Read more in the documentation: http://templates.dynamicweb-cms.com/TemplateTags/Dynamicweb-template-tags/General-tags/If-statements.aspx

 

 

You must be logged in to post in the forum