Developer forum

Forum » Templates » Is there a way to tell what placeholder a paragraph is in, in a paragraph-template?

Is there a way to tell what placeholder a paragraph is in, in a paragraph-template?

Hans Ravnsfjall
Hans Ravnsfjall
Reply

Hi

On a page, you can have multiple placeholders

(<div id="place1" class="dwconent" title="place1"></div>

<div id="place2" class="dwconent" title="place2"></div>

etc)

Now, is it possible to tell from a pragraphtemplate what placeholder the paragraph is currently in, so that you do different things for the content - depending on what placeholder the content is under?

 

/Hans


Replies

 
Nuno Aguiar Dynamicweb Employee
Nuno Aguiar
Reply

Hi Hans,

 

If you are using the ViewModel, you should be able to get them through  @Model.Container. If you are using the Templates there are also tags that give you the Container's name. Just put @TemplateTags("Container") and you will find them.

 

Once you know that, you can make your changes.

 

Best Regards,

Nuno Aguiar

 

You must be logged in to post in the forum