Adobe CQ: authoring content once to display in multiple components - content-management-system

Is there any way to create components in CQ with content pre-added, so that authors can easily pull in a component that has the exact same content on each page where it appears?

Yes , it can be done by adding a cq:template[nt:unstructured] node under your component. If all the data is stored on the component node itself , add the default values as properties to cq:template node with name same as the ones in your dialog. In case the data is stored in a child node add a similar node under cq:template node.
Source : http://blogs.adobe.com/experiencedelivers/experience-management/defaults-in-your-component/

Related

Is there any way to add a single component to multiple component groups in AEM [Adobe Experience Manager]

I need to add a single component to multiple component groups in AEM.
I am pretty sure that a component can only belong to one component group.
If you would like to have your component visible in different places (but not the complete group), you basically have two options:
Add the component (not the group) to the allowed components list in your design ( configuration.
Create a new group, change your component's group to the newly created one and add the new group in the design / configs you need.
HTH

How to bring dropdown at top

I'm not getting this dropdown in front as i have created a custom control combo of tree behaviour.
By reference to this doc: Add a custom field to a work item type (Inheritance process), we can add a custom field to support tracking data requirements you have that aren’t met with the existing set of fields.
Currently, the field Area Path and Iteration Path are existed datatype as Tree path, but their value are defined in Project configuration page and Team configuration page by reference to this doc: Define area paths and assign to a team and Define iteration paths and configure team iterations.
However, tree type is not available in new field, as below.
In addition, this is indeed a good suggestion. You can create a suggestion ticket here. The product group will review these tickets regularly, and consider take it as roadmap.

jcr:lastModified vs cq:lastModified

What is the significance of having 2 separate last modified dates(jcr:lastModified and cq:lastModified)? Is there a scenario where one of the dates gets updated and second one not. Cant we live with one of the last modified (maybe jcr) and use it everywhere?
My issue is, we have few queries and conditions in our application defined based of either of these dates and am confused if the usage is right.
Here is a sample:
cq:lastModified is present at jcr:content node level, means it is available on all those nodes whose jcr:primaryType is cq:pageContent. Where as at all other nodes types jcr:lastModified is used. In general we can say that if any content is getting modified through aem functionality it will refer and update cq:lastModified and everything else that is using JCR core functionality will refer and update jcr:lastModified. Both properties can’t be present on the same node.
Read more at WHAT IS THE DIFFERENCE BETWEEN JCR:LASTMODIFIED AND CQ:LASTMODIFIED
I think one should always check both properties. I'm currently facing the situation that updating an image with the ootb image dialog is not changing the cq:lastModified property. however, the jcr:lastModified property is either added or modified. This a very curious behavior I'd say. I'm not sure if I'm missing something in my dialog config:
Can be caused by the fact that the image tab is embedded in another dialog ... but I'm not sure
Any modification on page by an authoring activity i.e. on component dialogs or page properties dialog, it always associated with jcr:lastModified and jcr:lastModifiedBy properties on the respective nodes (i.e. if content modification is done on component then node type is nt:unstructured and if it is page properties like jcr:title then it is cq:pageContent).
For each content modification on the page as part of authoring activity, cq:lastModified and cq:lastModifiedBy properties on the jcr:content node gets updated; no matter on which component the modification have been done. Hence, if there is a modification on page properties like jcr:title then on jcr:content node, cq:lastModified, cq:lastModifiedBy, jcr:lastModified and jcr:lastModifiedBy property values get changed.

AEM - adding a container and varying number of children

I have created a component, the new request is to add 3 or 4 of those components within a container. I understand I can just add a column control component and add the children as needed but the request is to go beyond that and add the children as the column control is updated. For example if you change the number of children to 3 the container will automatically add 3 of the original components that were created and so forth.
I have started working extending the Column Control - Sightly component and how I would like to add the children without having to manually add those.
The standard approach for inserting a varying number of components, is to include the Paragraph System Component (parsys), and then let the author insert the components he or she needs (can be limited to allow only specific components).
http://wem.help.adobe.com/enterprise/en_US/10-0/wem/wcm/default_components.html#Paragraph%20System%20%28parsys%29
Or is there a specific requirement that you need to be able to specify the number of components beforehand?

gwt - dynamic tree structure using uibinder

I have a tree structure which has sub nodes and these sub nodes in turn have their own sub nodes.
I now want to add click handlers for the root node and every child node. Can any one please help me that?
Thanks
There is no need to add a ClickHandler to each node. It is very inefficient. You need to add a single SelectionHandler to your tree.
When you create each TreeItem, you can set a user object on this item. In your SelectionHandler, you check what user object is set on the selected item, and then you act accordingly.