Can I make a simple page in CQ ? - aem

What is the minimum that I have to do to make a content page and render it in CQ ?
Do I have to have a template ?
Does it have to be a CQ:Page type node with a supertype ?

As mentioned my "Brian",
Short Answer
See:- http://localhost:4502//apps/geometrixx-gov/templates/homepage
create a node of type cq:Page and save, add cq:PageContent node under page node, add required properties to show the component & if you want to add some default node under this cq:PageContent node add all of them manually.
Long Answer
Can we create a page without template?
in this post I will explain it's answer in detail. before knowing the answer of this question just rethink the definition of a Template.
"A template is used to create a Page and defines which components can be used within the selected scope. A template is a hierarchy of nodes that has the same structure as the page to be created, but without any actual content"
when you create a template using crxde lite then it creates two nodes by default having primaryTypes
cq:Template as parent
cq:PageContent as child
When we create a page using template via siteadmin then siteadmin uses content page component & it copies all the child nodes under the template to a newly created page node.
and once the page has been created it doesn't require cq:Template as all the child node of the template copied under cq:Page node & these nodes contains all the required properties to display a component group for that page.
It means if you want to create a page without template you can do that but it's not possible using siteadmin console as it's content page component uses templates to create pages.
you have to do all this stuff manually from crxde i.e.
create a node of type cq:Page and save, add cq:PageContent node under page node, add required properties to show the component & if you want to add some default node under this cq:PageContent node add all of them manually.
It's not a good practice to create a page manually, always use templates as it provides different set of properties which are very helpful while creating pages or websites.
Some of important properties are -
allowedTemplates
allowedPaths (deprecated Now)
allowedParents
allowedChildren
these properties can be used for filtering the page structure using siteadmin console. but if you are creating a page manually then you have to take care about all of these restriction by your own.
Source Link:- http://versatileankur.blogspot.in/2014/07/page-without-template-in-cq5.html
Another Ways:-
Use of Site Importer tool
Link:- https://docs.adobe.com/docs/en/aem/6-2/develop/dev-tools/site-importer.html
It helps in importing static website into AEM.
Creating a Website
Link:- http://www.aemcq5tutorials.com/tutorials/aem-create-a-website-in-cq5/
I hope this would help you.
Thanks and Regards
Kautuk Sahni

The absolute minimum is a node with primaryType of cq:Page (or a subtype) and a child node called jcr:content with a primaryType of cq:PageContent (or a subtype).
Of course, this will render a blank page. To render something on this page, you need to add nodes to the jcr:content node.

Related

Is it possible to have a container prepopulated with a specific component through a prototype page in Hippo CMS / brXM?

In an attempt to set up a new page with a single vbox container I'm able to get the container to show in the Channel Manager but this requires the CMS editor to add all of the individual components by hand. Alternatively we can place components directly on the page and through the configuration in the prototype but that does not allow the CMS editor to edit the component configuration (Info) or associate a document. The question is then, in an attempted compromise, is it possible to repopulate the container with a specific component so that the the CMS editor is provided a default set of components in the containers when creating a new page from a prototype/template page?
I believe the key term you are looking for is hst:prototypepages
Their documentation can be found at https://documentation.bloomreach.com/14/library/concepts/hst-configuration-model/prototypepages-configuration.html but basically you can define the prototype having certain components already on the page - and possibly even default settings for those components.
A similar concept at the component level is the hst:catalog
You can define "component prototypes" with default settings for when they are placed onto a page.

AEM 6.2 How to change template of a page

I have created live copy of a page branch from sample website, inside my website. I was just trying to update the template so that I can create a local copy of the template used with original page and then change the UI. I can see the property with the cq:template and sling:resourceType as component name in development environment(CRXDE Lite). Can anyone suggest if we can update the property to change the template and component or if there any other way to change the template.
You can update cq:template and sling:resourceType on page/jcr:content node with corresponding new values and it would effectively change the template of page.
you might run into errors if code on new page component is expecting a different content than what is currently under your jcr:content.
ps- I dont know what your use case is but this would be very crude approach and should be avoided.

AEM 6.1: can't fetch component properties from page nodes

I'm new on AEM and I have an issue:
I'm working on a page named 'ancillary'
I did not create this page, I modified it where it was necessary.
In jcr:content I have page properties.
As you can see from the 1st screenshot:
pas
as
pos
new
are component properties, these should populate my page (ancillary), I'm only working on 'new'. The others are not used anymore since their components are now obsolete.
This is my component which we'll call 'newComponent':
It should be able to fetch 'new' properties (1st screenshot), since in new's sling:resourceType I set path/to/newcomponent.
When I use ${properties.mynewproperty} in newcomponent.html, it won't print the property. I can only reach pageProperties like jcr:title.
My component 'newcomponent' was created as a copy of another component, which it used to lay on the page ancillary and I swapped them. I also created a copy of the node with the oldcomponent's properties. I can see the component on the page on localhost, but I can't render the text properties.
I'm very sorry I explained this very badly, I hope someone understands and manages to help me.
You can't access your 'ancillary/jcr:content/pas' sub-nodes properties for instance. Only properties stored under your 'jcr:content' can be accesed with "${properties.myProperty}. IF you need to retrieve those sub-node properties, you'll have to use a JAVA or JS model to access it.

how properties are stored in /etc/designs for design dialog

I'm new to CQ5 and working on a project that deals with refactoring code that uses design dialogs.
Currently, I have a property declared as part of design dialog of my component. It creates a folder in /etc/designs/ for each template my component is used on. Is there a way we can make sure that those property values are stored at one particular configuration in /etc/design(as opposed to multiple)? I need to make sure only one set of configurations is used for all pages that use my component.
Thanks in advance!
Pallavi
The designs are linked to the template and not the whole site.
Hence whenever you configure the component in design mode, the values are stored within the corresponding template under the jcr:content of the configured design page or under /etc/designs/default/jcr:content in case no design is configured.
As far as I know, there is no way to tell AEM to store all the design configurations under one single path, unless you are using absolute paths in your dialog / page configurations.
If you are using multiple templates in your site, there must be one master template (which render global components eg. header/logo/navigation & footer), and all other templates should extend master template to get these global components and change pagelayout for content section.
Saying so, if templates are structured & inherited properly, you should be able to set design dialog property on home page (created using master template) and all internal pages will be able to access those design property OOB. Though child pages (created using other template) can override those design property (if needed for that template) to break inheritance.

Why exactly templates are needed in CQ?

Why exactly do we need templates when all a template does is to have a resourceType property attached to a content-page component.
At the time of creating new page, shouldn't authors directly select that component instead?
The template nodes define the metadata for the page that will be created, one aspect of which is the underlying resource type (i.e. the Page component that will be used to render out the content).
Some example of other things configured at a template level include:
The default content that is included when the page is created. This
is stored under the template node itself, i.e. in /apps/[your-site]/templates/homepage.
For example, you could add a carouselnode underneath the homepage node, to ensure that any page created with the homepage template will have a carousel node added by default.
The allowed parents & children of the template — e.g. configuring the homepage template so that it can't be placed beneath other templates.
The allowed components in each parsys — In /etc/designs/[your-design]/jcr:content, you can defined what components can be added to a particular parsys, which applies to any page using that template.
By having a separation between templates & page components it allows us to re-use the same renderers (e.g. JSP scripts), but have aspects like these configured differently for different templates.