Expand my Community achievements bar.

can we create a dialog at the template level ?

Avatar

Level 2

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?

12 Replies

Avatar

Level 10

If you see most AEM artilces like this one:

Adobe Experience Manager Help | Creating your First Adobe Experience Manager 6.3 website

Headers and Foorter are just a component that is pulled into the site.

Avatar

Level 2

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.

Avatar

Level 10

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.

Avatar

Level 10

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.

Avatar

Level 7

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

Avatar

Level 2

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.

Avatar

Level 10

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.

Avatar

Level 10

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

Avatar

Level 2

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.

Avatar

Level 10

When you say " Is there any way to add a page from /content/project/samplefile.html in the page components"

To add a page in AEM - see this doc topic: Creating and Organizing Pages

This still comes back to the same issue. You want to use a component on your pages where you set 1 and then the component is used in all pages. To solve this  - like our co-works mentioned - IParsys is the best way.

Avatar

Level 2

smacdonald2008​, Let me explain what I am trying to is,

1. In my requirement we have a site where the header and footer are common acroos the site.

2. But these Header and footer are not static we want to author them and use it (i.e. if we get few more pages in future we will author the new page in header/footer).

3. To avoid authoring header/footer for each page in the site I want to create a blank page where I will author header/footer(.html) under /content/myproject/ only one time and would like to add this page (/content/myproject/(header/footer.html)) in the page component/template level.

4. So that when ever I create a new page using this template where I have added the header/footer.html. My new page should come with default header/footers included and authored by default.

5. Where as all my pages will be created by blueprint copy of a site.

I hope my requirement is clear now, please suggest me how to do that.

Avatar

Level 2

I hope this helps.

You Can store your header and footer under EN page.( Under your root page, if don't have it )  I am using We retail site for this example.

<sly data-sly-resource="${'/content/we-retail/us/en/jcr:content/header' @resourceType='your header'}"></sly>

So where ever you author it in the site, all the pages will contain the same data.

When ever u create a new page the header will come with the pre-authored content.