I want to display parent page title of the page just above my current page.How do i do that in sighlty?
You can see the list of global objects available to Sightly in an AEM Application.
As mentioned by rakhi4110, one of the objects is currentPage, which is an instance of the Page class. Page has the getParent() method available. However since this might return null you should probably wrap your usage in a test:
<h1 data-sly-test="${currentPage.parent}">
${currentPage.parent.title}
</h1>
You can use ${currentPage.parent.title} or ${currentPage.getParent.getTitle} to get the title of the parent page.
Related
I'm looking for a way to get the page title set via the new PageTitleProvider API to display it inside a FluidTemplate.
In one of our TYPO3 installations, the page title is used as title, displayed on the page itself. The main PAGE object is set up to render a FLUIDTEMPLATE object. I've implemented the examples on the new PageTitleAPI in the documentation, https://docs.typo3.org/m/typo3/reference-coreapi/master/en-us/ApiOverview/PageTitleApi/Index.html into my extensions and that works just fine for the tag.
However, within the page itself, the title set in the page is still displayed, not the title I've set in my extension.
I've figured out, that I can instantiate the PageTitleProviderManager, but getTitle still resolves to the page name, not the title I've set, most likely because this object is resolved before the PageTitleProviders are set up by the extensions.
$pageTitleProviderManager = GeneralUtility::makeInstance(\TYPO3\CMS\Core\PageTitle\PageTitleProviderManager::class);
\TYPO3\CMS\Extbase\Utility\DebuggerUtility::var_dump( $pageTitleProviderManager->getTitle() );
// -> outputs the page name, not the title custom page title
Is there a way to resolve the page title after all Providers are processed and display it in a fluid template?
I also assume it depends on order of execution. so you need to build an order where your plugin is executed before the page title is rendered in the page template.
nowadays most integrators use the f:cObject viewhelper to render the content with lib.content. that means the content (and your plugin is rendered very late), as the page title is probably rendered before any content in the page template (independend whether you use template variables from the page template or a viewhelper which executes PHP or typoscript in the moment of the rendering.
Here you get a hint how to change the order:
try to render the content (including plugins) into a fluid-variable with the page templating ( e.g.:
page.10 = FLUIDTEMPLATE
page.10.variables.content < styles.content.get
) and try to get the page title when the page fluid is rendered: use a viewhelper to get the page title when the initial FLUID variables are already computed.
of course you also can define a FLUID-variable for the content in the page FLUID template before accessing the page title by viewhelper:
<f:variable name="content"><f:cObject typoscriptObejctPath="lib.content" /></f:variable>
How to modified a parent page and at meantime the child page get modified automatically? without use the MSN livecopy , because we don't have the license.
anyone can help ? thank you very much.
For example, I want to change a text value in parent page, and meanwhile I want the same text in child page could be changed automatically.
Not sure if I understand you right, but I see two possibilities:
iparsys: This is an inheriting parsys. So any component placed within this will be inherited to child pages. You can break the inheritance on any level
Reference: There is a Reference component in the foundation where you can reference any component from another page by its path.
In both cases, if the original component gets changed, the inheriting or referencing page will get the update as well.
CQ5 list component built using childpages doesn't show pages as list items, whose hideInNav=true. Is this as expected?If yes, how to overcome this issue?Is there any workaround?
Thanks in advance!
I would say this is the expected behaviour. This flag marks the pages as hidden, so they aren't shown in the navigation and also in a list. You would have to implement the list by yourself by using Page.listChildren() without the new PageFilter() from the root Page.
http://dev.day.com/docs/en/cq/current/javadoc/com/day/cq/wcm/api/Page.html
I try to extend the Carousel component with an extra functionality. The dialog works, the display of the carousel works too for other tabs.
But how does the Carousel know which pages have to be shown? The mode to use is shown by "listFrom" property. Depending on its value, the pages have to be fetched from other properties or have to be looked up.
I see in the /libs/foundation/components/list/init.jsp that the following call is made:
List list = new List(slingRequest, new PageFilter());
request.setAttribute("list", list);
And when it arrives in the carousel jsp, that list is filled in with the correct pages.
How does the mapping happen between that carousel node (with parameters from the dialog) and this List?
Edit: this actually explains the solution: Extending CQ5 List component
List class in the foundation/components/list/init.jsp is not java.util.List but com.day.cq.wcm.foundation.List.
It takes the request object, extracts requested resource (in this case it's a carousel resource), reads the configuration and prepares a list of pages - all this happens during the object construction.
You can find the source for the List class at /libs/foundation/src/impl/src/main/java/com/day/cq/wcm/foundation/List.java
My question is very basic . I am creating a new template and in that template, I will have a concrete structure using DIV elements. But in almost 7-8 if the DIV's, I need the data to be entered by the user.
What component/line of code I can use to have all those 7-8 DIV's editable and customizable by the page creator ?
I tried multiple paragraphs with :
<cq:include path="par" resourceType="foundation/components/parsys"/>
But only the top one appears on the page. !!
For having multiple paragraph just rename the path value in the cq:include tag. also check here