So say you have a component that is being used in the body section of a page. I want to take specific values from the text fields of that component and write them to the of the html file.
I have a tile list component, with a title text field and a description rich text field.
<div class="col box-title">${tileitems.properties.title @ context='html'}</div>
<div data-sly-test='${description}' class="col">
<p>${tileitems.properties.rte || tileitems.properties.description @ context='html'}</p>
</div>
How can I get the values that are authored into the component and write on the same page but to the head of the html.
do i need a java model for this ? any examples thanks
2
Answers
You have (at least) two options:
head
from your content component using JavaScript.head
.Another option is to extend the page properties, instead of a component in the body. Then, you can read them directly in the head.html