Developer forum

Forum » Feature requests » "Where do I live" tag

"Where do I live" tag

Sten Hougaard
Reply
Hi,
I would like to get a "context" related tag in the templates meaning. The paragraph and module tags should include:
<!--@DwContentAreaName--> which would allow frontend developers to make choices based on that.
As an example of use you might have a setup where you need to insert a width controled paragraph image.
The width will be one of two depending on the placement.

<img src="...getimage.aspx?...width=
<!--@If(DwContentAreaName='main')-->500<!--@Endif-->
<!--@If(DwContentAreaName<>'main')-->200<!--@Endif-->...
Also I would like to get the PID information available for in the group of Module tags.

I have created an example/demo where the width of the image is scaled using jQuery, but would prefer to do it through backend.
Find the demo here: "Adapt image width clientside" (best viewed in chrome, ff4, safari 3, opera 10,5)

/Sten Hougaard

Replies

 
Per Søgaard
Reply
 Ja tak. Det vil være en rigtig god ting.
/Per Søgaard
 
Nicolai Høeg Pedersen
Reply
<!--@ParagraphContainer--> coming up as a new template tag on paragraphs.
 
Sten Hougaard
Reply
 Hi Nicolai,

Great! I am looking forward to it. Now that we are adding structure related information to the tags, may I ask for:
  1. <!--@ParagraphPosition--> Returns the index inside the paragraphContainer
  2. <!--@ParagraphFirstLast--> Returns "first last <nothing>" when outputing content it is typically nice to know if this is the first or last item. Related to styling/structure of elements.
  3. <!--@ParagraphContainerParagraphsCount--> Returns the number of paragraphs in the current paragraphContainer.
That is it for now - but perhaps other wishes will appear. One thing I am now sure of is if this information should be available to modules... Hmmm... What do you think?

/Sten

 
Nicolai Høeg Pedersen
Reply
Hi Sten

Great idea. Coming up as well.

 
Sten Hougaard
Reply
 Hi Nicolai,

Thank you for implementing ParagraphContainer tag which for instance will allow a frontend developer to test where a paragraph is being rendered. That could for instance make it possibel to control in which areas a paragraph will be rendered. That way a person being an editor cannot place paragraphs in areas where they were not designed to be used.

That situation however leads me to another wish - feature request:
Backend soloution:
A wish for some kind of setting feature where you can set which paragraphs can be used on which layout container. In use it may be a backend setting page where you select a design, and a layout. Then you get to choose which paragraphs can be inserted in each content area in a graphical way.
Template soloution:
You add settings to the layout files, something like allowedParagraph="headerOnly.html;moduleOnly.html;".

Do you follow my request/idea?

/Sten Hougaard
PS: ParagraphPosition, ParagraphFirstLast and ParagraphContainerParagraphsCount? Did you change your mind as to adding those too? :-)
 
Nicolai Høeg Pedersen
Reply
Hi Sten

I have an item for limiting the list of paragraph templates selectable for a paragraph based on its paragraph container. I guess that is what you want? I have to possible solutions:
  • The one you describe with a setting on the container definition in the Layout file (allowedTemplates:some.html,other.html,third.html)
  • By creating a folder called /Designs/DesignName/LayoutName/ContainerName/Paragraph.

ParagraphPosition was implemented as ParagraphContainerSort. You can check if a paragraph is the first one in the collection by checking if ParagraphContainerSort = 1.

The count of paragraphs in each container (and therefore if it is the last one), is not possible right now due to the implementation of rendering the paragraphs. It requires some refactoring that needs some thorough testing - will see if I can get it into DW 8.
 
Søren Kottal-Nielsen
Reply
Hi Nicolai

I would prefer to have the definition in the layout file. That way, you can use the same paragraph template in different containers.

If you go with the folder, you might end up having to create 4 equal paragraph templates in order to use them in different containers.
 
Sten Hougaard
Reply
 Hi Nicolai,
I agree with Søren.

/Sten
 
Søren Kottal-Nielsen
Reply
Fyi, I just noticed that ParagraphContainerSort has been implemented as ParapgraphContainerSort
 
Søren Kottal-Nielsen
Reply
 Am I the only one having trouble with the ParagraphContainer tag?

If I have a container with global paragraphs only, ParagraphContainer, isn't set. If I add a normal paragraph in the top of the container, ParagraphContainer is set correctly for all paragraphs, including the global ones.
 
George Nelzo Pereira
Reply

Hi Nicolai,

 

Do you have some news about count of paragraphs in DW 8?