CQ5.6.1 Text component in the footer to pass same content across all pages - aem

I have a footer.jsp which is expected to appear same across all pages. I added a Text component in the footer.jsp. When the author adds content to this Text component in Home page, I want the content to reflect in the footer of all child pages. Here is how I use the text component in the footer.jsp, but this is not working as I want.
<div class="gelUpdateContent">
<cq:include path="text" resourceType="foundation/components/text" />
Get Live Great <span class="txtRed">updates </span>
</div>
I already tried iparsys component instead of text, which is useful, but then my requirement is to restrict it to text only.
Any help is highly appreciated. Thanks.

I agree with #rakhi's answer of providing absolute path. But there is another way to do this.
Try using iParsys. iParsys configuration is inherited by all child pages. if you include an iParsys and drag-n-drop your footer component in the root page of your site, then that footer component will start appearing in all your child pages.

Instead of providing relative path to the path property in cq:include i.e. (text), provide an absolute path, something like (/content/<project>/<homepage>/jcr:content/text).
Providing relative path creates the text node under each page, whereas absolute path ensures that all the pages read and write to the node present in the path provided always.
This is one way of achieving what you need.
More info on using cq:include can be found here

Well, We can design with following options:
It is depend on your requirement. If you want to have common footer across the site then Put some global path(i.e /content/rootSitePath/) as a cq:include path.
If you want to have footer information get updated on child pages only then use IParsys component.
I would prefer to use option 1, but make sure we are hard coding path. Bette to have utility to determine path.
Thanks,
Jitendra

Related

How to put content elements side-by-side int typo3

I have just started my Typo3 journey. I want to put 2 content elements side-by-side (in one row). Can anyone tell how is it possible. Because whenever I place any content element, it is displayed as a block and fill the entire row.
Thank you for your time and consideration :)
You have to use container elements which come with the extension 'container'. Please have a look at https://extensions.typo3.org/extension/container
There is no build in solution for your problem.
But in TYPO3 you are free to build any kind of html structure for your output. This is necessary as you also can do any rendering of content. either with your own CSS and HTML-markup or if you use frameworks like Bootstrap.
You can build a new page layout, or any special content element which contains other content elements.
Changing layouts can (and should) be reflected in backend-layouts. (https://docs.typo3.org/m/typo3/reference-coreapi/11.5/en-us/ApiOverview/Backend/BackendLayout.html) (there are a lot of other tutorials)
But you also can build/ use individual defined containing content elements. Her you can get support by different extensions (eg. mask, DCE, gridelements) or define it completely on your own (https://docs.typo3.org/m/typo3/reference-coreapi/11.5/en-us/ApiOverview/ContentElements/Index.html)

ZK framework - no content in include

We have a tabbox whose tabpanels use include to include content:
<tabpanels height="100%">
<tabpanel>
<include src="#load(vm.myTabUrl)" />
</tabpanel>
...
</tabpanels>
Once in a while in production, the content of the include is not displayed. This behavior seems to be random and we don't know how to replicate it.
When it happens, the generated html contains a <div> for the include which only contains another empty <div> with class z-tmp:
ZK doesn't show any errors while rendering and neither does the javascript console. Also there are no failed http (zkau) requests. Any ideas?
ZK Client Engine is responsible for conversion of ZUL to HTML at client side.
ZK has a huge in-built component support compared to HTML. But the things that are displayed on Client side will be HTML itself.
We design a page in ZUL and it is converted into HTML in action. ZUL Components are larger than HTML components in number but in the end we get HTML components only with some changes in their structure.
How the ZUL page reconstructed to HTML page ?
ZUL page are converted to Div, input, anchor mostly.
ex: Groupbox
(ZUL) --> Multiple Div (HTML)
The ID of the DOM components are dynamically generated after conversion like z_p5,z_g3 and the ID
i.e given in ZUL page can be added at AID of the Component.
The DOM component can be allowed to have multiple styles separated
by spaces.
The Widget name is added to the component style as z-widget along
with our regular styles mentioned in ZUL page. The ZK Component name is added as z-widget in the style attribute of generated HTML DOM Component. As you have already seen that z-include is added in the style attribute of Div element in the above screenshot after generation
of page.
Coming to the Actual problem,
Open the AfterCompose method of the ViewModel of this page.
Assign myTabUrl directly with another ZUL page path and Notify it with
postNotifyChange method from below.
BindUtils.postNotifyChange(null, null, ClassName.this, "myTabUrl");
May be Variable is not properly assigned or Notifying the variable may be missed which caused this problem. If possible post the ZUL and VM code here if problem still not resolved after this trial.

AEM CQ5 How to modified a parent page and at meantime the child page get modiedly automatically

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.

How do we define global properties in CQ5

My Requirement is to have a global header and footer with author able properties.
So if we update the properties on one page it should be reflected across all pages.
What is the best approach to achieve this in CQ5.
ACS AEM Commons now supports this functionality without use of an iparsys - Shared Component Properties (http://adobe-consulting-services.github.io/acs-aem-commons/features/shared-component-properties.html)
Configure your menu with Shared and/or Global properties and you can simply template it directly onto all of your pages (no iparsys required). You can then edit the header/footer from any page on the site and it will by updated on all pages.
Unlike using design dialogs, Shared Component Properties supports standard content activation and internationalization (values stored below the homepage) and anything else you would expect from content.
If all of your pages site under a hierarchy, you could use an Inherited Paragraph System (iparsys). This is from an old version of the documentation, but is still a good intro:
The inherited paragraph system is a paragraph system that also allows
you to inherit the created paragraphs from the parent. You add
paragraphs to iparsys at for example, /content/geometrixx/en/products
and as result, all the subpages of products that also have iparsys
with the same name inherit the created paragraphs from the parent. On
each level, you can add more paragraphs, which are then inherited by
the children pages. You can also cancel paragraph inheritance at a
level at any time.
While not quite what you're describing in the original post (edit anywhere) it will allow you to edit the content once (at the parent page) and inherit the changes everywhere.
Traditionally you could create the components and swap the dialogs out for design dialogs. Basically you would rename your component dialog to design_dialog.
What this will do is save the changes you make to this object to a design path under etc. You can set a design path for site by going to the top level parent and setting a designPath property.
So node structure might look something like
parentNode
- #prop designPath = "designs/myapplication"
childNode1
childNode2
etc...
Any component using a design_dialog on the parentNode or its children nodes will get their information from the designPath. If you do not set a design path, the infomration is saved under etc/designs/default (or defaults, not sure, going off the top of my head).
There are some alternatives to this:
What our team did was in our siteHeader component we use http://dev.day.com/docs/en/cq/current/javadoc/com/day/cq/commons/inherit/InheritanceValueMap.html (inheritancevalue map) instead of the regular value map. The inherited value map will traverse the tree up looking for items from it's parents. This is a great source for learning how to use valuemap instead of just the default properties object:
http://experiencedelivers.adobe.com/cemblog/en/experiencedelivers/2013/02/valuemap-and-his-friend.html
This does get complicated with larger sites, and you'll have to do a lot of customization to get the system working the way you want, but it's an option if you don't want to have to manually set designPaths for every new site your authors create.
Alternatively, if you do like the idea of using designPaths and design_dialogs, you can always hook into the page creation workflow and have the page component add a designPath property on creation (this is a lot easier said than done though).
hope that helps

Generic component in CQ5 page

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