Highlighted

can we create a dialog at the template level ?

nagalaxmit28016

13-03-2018

Hi,

Here is my requirement like I have a fixed header and footer for the entire website except the home page. So I am designing it like,  I have created a page component where I am adding header, footer and a parsys for body. But How can I make sure that I will author only in a single page that header or footer authored content should come to all the pages which were created using that template ?. Please suggest me a way to acheive it. and can we create a dialog on the page component if so how do we have to author?

Replies

Highlighted

nagalaxmit28016

14-03-2018

smacdonald2008​, I have gone thorugh the article but what I found is, they are using the static content in the header and footer these are not authorable components. But for my case, I have an authorable header and footer and I want to author them at a single place and it should come to all the pages whichever I create for that site without any authoring effort. How do I have to achieve this. I want to add these headers and footer at the template level, when ever I create a page with that template these header and footer should come.

Highlighted

smacdonald2008

14-03-2018

To make them authorable, create a dialog for them. That would be the best way to achieve your use case of an authorable header/footer. Since they are 2 separate componests, create  2 dialogs.

Highlighted

smacdonald2008

14-03-2018

I tested this and placed a dialog under the Footer componet in the Toy Store site:

FooterCRX.png

It works perfectly:

AFooterDialog.png

These are just AEM Components like any AEM Component and you can place dialogs for them so an author can author a footer. This would make the Footer authorable-- but would have to be set in all pages - which is not ideal. I am checking into a better solution.

Highlighted

BrijeshYadav

14-03-2018

As smacdonald2008​ said you should create a dialog for header and footer component in order to make it author-able

and for this requirement " I want to author them at a single place and it should come to all the pages whichever I create for that site without any authoring effort"

You can can use iparsys to include header and footer component which enable it to get inherited to all children pages.
Read here for How to Create a Fully Featured Internet Website https://helpx.adobe.com/experience-manager/6-3/sites/developing/using/website.html

/Brijesh

Highlighted

nagalaxmit28016

14-03-2018

smacdonald2008​, Yadav Brijesh​, my requirement is something like whenever & wherever I create a page using that template the header and footer should come by default without any authoring effort. Only I want to author at a single palce using the header/footer dialog but it should work for the entire site irrespective of a parent page or a child page. Suggestions please.

Highlighted

smacdonald2008

14-03-2018

This is a good use case - i have never done this personally. In all examples we have - the footer and header are static and there is no issue.

However for this - you want 1 dialog and then the rest of the pages will reflect the specified values.

I was talking to co-workers about this. They responded:

These options are available:-

  1. iParsys
  2. Reference Components
  3. Editable Templates
  4. Have a configuration page with these components (footer/header). Write custom logic to read data from there and render in each page.

I want to get an example working, Maybe iParsys is the solution here.

Highlighted

smacdonald2008

14-03-2018

More information from a co-worker-

Here’s what you need to do to make this happen:

Similar to Design Mode in Static Templates, a design_dialog is a key. That indicates author input that will be exposed/collected globally.

If you add a design_dialog to a structure component in an Editable template configuration you will see an option to edit the component in the Template Editor UI.

The code in the HTL script will use the same currentStyle.get() method but will store it as a content policy instead of a template node on a design.

These approaches are mutually exclusive:

Static Template – Design Mode

Editable Template – Content Policy

Highlighted

nagalaxmit28016

15-03-2018

smacdonald2008​, we are not using template editors, following conventional method of createing templates under /aps/project/templates. Is there any way to add a page from /content/project/samplefile.html in the page components. I have tryied using the <sly data-sly-resource ="${'content/projectpage/samplefile/jcr:content' @ wcmmode=disabled}"></sly> in page component rendering script but this is giving me a child parsys aswell on the parent page. As the samplefile has been created using a blank template which allows a parsys. when I add the same on page component the out put also showing the parsys along with content. I only want the content not the parsys using this template. Any suggestions please.