Developer forum

Forum » Templates » Placeholder specific paragraph templates

Placeholder specific paragraph templates

Hans Ravnsfjall
Reply

Hi

Nicolai showed how to restrict what paragraph templates are available for dwcontent placeholders, so that editors only see relevant templates. Anybody remember how this is done?

 


Replies

 
Sten Hougaard
Reply

On the Item (Management Center > Item Typer > MyItem) in the top use "Restrictions" where you can control:

  • Allow in websites 
  • Allowed parents
  • Allowed Children

Also you can click on "Settings" to restrict where the item can be inserted:

"Enable Item Type for"

  • Websites
  • Pages
  • Paragraps
  • Itemlist

After having used items for a while it will be something you remember :-)


Med venlig hilsen/Best regards,

Sten Hougaard
Webudvikler

A: København/Aarhus . W: www.1stweb.dk
@: netsi1964

 
Mikkel Ricky
Reply

You just have to add the limit settings to your content placeholder

    <div class="dwcontent" id="content" data-settings="limit:Featured.cshtml,Default.cshtml"></div>

But you should really consider using items instead. An item can have a default template defined in the website settings, and doing it like this the editor will never have to pick "the right template".

Best regards,
Mikkel

 

 
Hans Ravnsfjall
Reply

Thank you Steen, but this is not quite what I am looking for, or at least I can´t make it work.

I want to be able to make items as paragrphs, that eg. will only be available on for the Frontpage.

I don´t think that this is possible as of now. One way wold be to add a field of lists under pages like this

"Enable Item Type for"

  • Websites
  • Pages
    • Choose specifik page/pages
  • Paragraps
  • Itemlist

 

 

 

 

 

 
Hans Ravnsfjall
Reply

Ricky, I am not sure that is what I need - because I want to limit what item paragraph is available, on what page.

Kinda the same that Nicolai showed at DWTC14 for limiting what paragraph templates are available on certain paragraph placeholders, only that was an "item/paragraph template to specific item placeholder" availability relation.

This would be an "paragraph itemtype to specific page" availability relation.

 

 
Sten Hougaard
Reply

If you have a layou file named "Sublayout.html" you can create a folder called "Sublayout" and inside that you can have same folder structure as you see under Templates, including Paragraph. Then that folder "Paragraph" will contain the paragraph templates the editor can select:

  • Designs
    • Sublayout.html
    • Sublayout
      • Paragraph
        • Template1.html
        • Template2.html


Med venlig hilsen/Best regards,

Sten Hougaard
Webudvikler

A: København/Aarhus . W: www.1stweb.dk
@: netsi1964

 
Jacob Storgaard Jensen
Reply

Hi guys,

Just to clarify, you can't do what Hans is asking right now. As I read it Hans, you would like on a specific placeholder to tell that placeholder that it can only contain items of a specific type. It has nothing to do with templates, right?

It was suggested in the sounding board, to implement this feature, but there was a few obstacles.

It will maybe lead to moving the "Create new paragraph" button to each content placeholder bar in the paragraph list - because the present "Create new paragraph" button wouldn't know which placeholder you intend to create a new item in, and thereby not know which possible item types to present to you.

Hope this makes sence - it can't be done right now.

 

 
Hans Ravnsfjall
Reply

Hi

 

Thanks for all your feedback.

Steen, this is possible I know but that limits it to pagetemplates. I would like to limit it to specific placeholders. I am almost 100% certain Nicolai showed an example of this at the DWTC14.

 

Jacob, know what you mean and this would also be very useful feature, but i understand the challange. The suggested create new paragraph under each placeholder could work.

As a whole, I wold like the create new paragraph and create new item (item as paragraph) to be separated from each other. I don´t think the interface when creating new paragraph or page, while having an item based solution is very userfriendly, because of the many items available at sometimes irrelevant points. I would like to be more able to make the choices for the enduser. That´s another mather altogether tough.

 

Please let me know if someone comes across the functionality of limiting available templates for each placeholder.

 

Anyways, thanks for your help and taking the time.

 

regards, Hans

 

 

 
Jacob Storgaard Jensen
Reply

Hej Hans, I think you are mixing things around... Do you skype? jacobsjensen - call me, then we'll figure it out, and I'll update the post with what we figure :-)

 
Sten Hougaard
Reply

Someone:

Was there a way to limit itemtype for at given contentarea? Like it is possible to limit templates on dwcontent areas.


Med venlig hilsen/Best regards,

Sten Hougaard
Webudvikler

E: sho@1stweb.dk
M: 29850818
A: København/Aarhus . W: www.1stweb.dk
@: netsi1964

 
Mikkel Ricky
Reply
This post has been marked as an answer

In Dynamicweb 8.4.1 you can limit the allowed paragraph item types in a placeholder like this:

<div class="dwcontent" id="sidebar" data-settings="items-allowed: SidebarParagraph, Image"></div>

When using the items-allowed setting, the placeholder can only contain items of the specified type, i.e. regular paragraphs (non-item based) are not allowed.

Best regards,
Mikkel

 

Votes for this answer: 1
 
Merethe Nielsen
Reply

Hi,

Sten, you can limit item types to a placeholder like this (from 8.4.1.0):

<div class="container dwcontent" id="footer" settings="items-allowed:ParagraphAllow " title="Footer"></div>

Only the template called ParagraphAllow is allowed for this container.

 

Kind regards,
Merethe

 

You must be logged in to post in the forum