adobe / aem-core-wcm-components

Standardized components to build websites with AEM.
https://docs.adobe.com/content/help/en/experience-manager-core-components/using/introduction.html
Apache License 2.0
740 stars 747 forks source link

[Page] Make head more customizable #685

Closed henrykuijpers closed 4 years ago

henrykuijpers commented 5 years ago

Feature Request

Is your feature request related to a problem? Please describe. When trying to override the title, description and keywords, we have to override the whole https://github.com/adobe/aem-core-wcm-components/blob/master/content/src/content/jcr_root/apps/core/wcm/components/page/v2/page/head.html file. We would however like to override only the specific parts that we want to customize, so we can still leverage all other code OOTB.

Describe the solution you'd like More fine-grained control in overriding parts of the header/footer/...

For example:

Are there alternatives?

Documentation Technical

henrykuijpers commented 5 years ago

I agree, @vladbailescu , this ticket could also create a better overriding mechanism for the viewport logic.

Any input on this ticket, though? I was thinking of the following solution:

The same could be done for the viewport tag.

Any comments?

vladbailescu commented 5 years ago

Or we could break it down into head.charset.html, head.title.html and head.metadata.html. We could even add a custommetadata.html to make it easier to append.

bpauli commented 5 years ago

We should avoid to break down the page component in even more HTL files. Otherwise we will end up like the old foundation page component which is splitted in 17 JSP files which makes it really hard to understand and to maintain. I don't understand why this is not a valid use case to override the head.html file. With the versioning we can make sure that the custom head.html file will work with future versions of the core-components as well.

bstopp commented 5 years ago

I'm with @bpauli on this - between head.socialmedia.html, head.resources.html, and customheaderlibs.html, there should be sufficient locations at which projects can override page metadata content.

richardhand commented 5 years ago

I'm also with @bpauli that we shouldn't introduce too many templates to the point where the component isn't readable at a glance / is hard to understand.

If we do want an extension point for metadata however, I'm +1 for a single head.metadata.html rather than a full fine-grained approach for title, description, keywords, etc.

henrykuijpers commented 5 years ago

Ok, so how do you have the extension point in mind then?

It's pretty common to have a project where aem functions as a proxy for rendering content inside its templates etc. To do everything right, you want to influence i.e. the title tag, the breadcrumb, etc.

Overriding the page component could be an option, but in our case we want to replace the tag with a SSI include tag. Something that can't be done by just overwriting the page model. </p> </div> </div> <div class="comment"> <div class="user"> <a rel="noreferrer nofollow" target="_blank" href="https://github.com/gabrielwalt"><img src="https://avatars.githubusercontent.com/u/130083?v=4" />gabrielwalt</a> commented <strong> 4 years ago</strong> </div> <div class="markdown-body"> <p>Closing this as there doesn't seem to be a consensus on how the extension points should work.</p> </div> </div> <div class="page-bar-simple"> </div> <div class="footer"> <ul class="body"> <li>© <script> document.write(new Date().getFullYear()) </script> Githubissues.</li> <li>Githubissues is a development platform for aggregating issues.</li> </ul> </div> <script src="https://cdn.jsdelivr.net/npm/jquery@3.5.1/dist/jquery.min.js"></script> <script src="/githubissues/assets/js.js"></script> <script src="/githubissues/assets/markdown.js"></script> <script src="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.4.0/build/highlight.min.js"></script> <script src="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.4.0/build/languages/go.min.js"></script> <script> hljs.highlightAll(); </script> </body> </html>