Developer forum

Forum » Development » Global:Paragraph.Content in code OR DW tag inside other Tags properties

Global:Paragraph.Content in code OR DW tag inside other Tags properties

Vilius Janulis
Reply

Hey,
Just wanted to know how to use Tags inside other Tags properties like :

 

<!--@Global:Paragraph.Content(<!--@Ecom:Product:Field.Billedegalleri.Value-->)-->

 

Does not seem to work like this , is there other way that i cant not figure out ? :)

 

Then if it is not possible currently , how to get Global:Paragraph.Content html via code in Product Template Extender.

 

Trying something like this :  

 

Dynamicweb.Content.Paragraph.GetParagraphById(

                        Int32.Parse(Product.ProductFieldValues.GetProductFieldValue("Billedegalleri").Value.ToString()))
 
But it does not seem to have render, html or something like that properties.


I mean that global paragraph is ImageGallery module paragraph, and it is specific based on product custom field value.
I need somehow to render that paragraph with its module via normal tags or via extended ones :)

Thank you

 


Replies

 
Mikkel Ricky
Reply

You can indeed use something like 

<!--@If(Item.Area.Message_Paragraph_ID>0)-->
	<!--@Global:Paragraph.Content(<!--@Item.Area.Message_Paragraph_ID-->)-->
<!--@EndIf-->

We're using this extensively in our new Solution Set.

 
Martin Nielsen
Reply

Hi Mikkel,

 

Is this an intended feature or a bug that you exploit?

 

Does the template engine double parse all templates so we can nest all tags?

Or does this only work because @Item.Area.Message_Paragraph_ID is parsed before @Global:Paragraph.Content

 

I like the idea, but i'm curious if this is permanent feature that is safe to use.

 

// Martin

 

 

 

 
Mikkel Ricky
Reply

It's a feature that you can rely on. It works because @Global:Paragraph.Content (and @Global:Page.Content as well) is parsed after all template tags have been replaced. 

 

 
Martin Nielsen
Reply

Sweet stuff.

 

Thank you for clarifying :-)

 

 

You must be logged in to post in the forum