can we create a dialog at the template level ? | Community
Skip to main content
nagalaxmit28016
Level 2
March 13, 2018

can we create a dialog at the template level ?

  • March 13, 2018
  • 2 replies
  • 6830 views

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?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

2 replies

smacdonald2008
Level 10
March 13, 2018

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.

nagalaxmit28016
Level 2
March 14, 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.

nagalaxmit28016
Level 2
March 15, 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


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.

Level 2
June 26, 2019

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.