How to restrict components in parsys - aem

Is there a way in CQ 5.6 to restrict use of specific components within a parsys? e.g. I want to restrict author to use only text component within a parsys, following is how I render the parsys inside one of my component JSP file:
<cq:include path="textpar" resourceType="foundation/components/parsys" />
Previously in CQ 5.4 following code in /etc/designs/myapp/.content.xml used to work for this:
<textpar
jcr:lastModified="{Date}2012-10-21T15:00:00.000-07:00"
jcr:lastModifiedBy="admin"
jcr:primaryType="nt:unstructured"
sling:resourceType="foundation/components/parsys"
components="[/libs/foundation/components/text]">
<section jcr:primaryType="nt:unstructured"/>
But in CQ 5.6 it's not working. Am I missing something or the way to restrict components changed?
Thanks

This actually works. There's seems to be some cache issue on my machine though, whenever I change something in /etc/designs/myapp/.content.xml I've to clear my cache to get the updated components, this is on FF 25 (Ubuntu 12.04).

Here is a very easy tutorial on setting default types for parsys and iparsys:
http://experiencedelivers.adobe.com/cemblog/en/experiencedelivers/2012/06/default-components-in-your-parsys.html

Related

Deleting, Moving pre defined components from template in Adobe AEM

I have requirement where, in template we will have some list of components by default. But the requirement is, author can delete,move these components in the page.
We are using sightly and I have used
<div sly data-sly-resource="${'sample' # resourceType='sampleapp/components/content/sample'}" />
This is working fine. But I am not sure how do to delete and move this component.
Any help is appreciated.
If you have a template/component in which you include a specific component then it cannot be moved or deleted. It will show the delete option but after refresh it will be there again (not configured). The things that can be moved are components placed within parsyses.
To create template which has predefined components that can be then moved around you need to base your structure on parsyses. Place your predefined components within the templates parsyses - within the templates jcr:content. Remember that template is nothing else then a predefined content node.
See the example in which the survey-template has predefined content:

How to stop AEM from including author instance javascripts on the publisher instance

The publisher instance has the following javascript files included:
/etc/clientlibs/granite/jquery.min.js
/etc/clientlibs/granite/utils.min.js
/etc/clientlibs/granite/jquery/granite.min.js
/etc/clientlibs/foundation/main.min.js
/etc/clientlibs/granite/jquery/granite/csrf.min.js
It would be best to exclude them for performance and also the fact that I am using jQuery 2.0 as my part of AEM site.
These scripts(not including the csrf.min.js) are part of the category cq.foundation-main. You can use this utility for checking this.
http://localhost:4502/libs/granite/ui/content/dumplibs.test.html?categories=cq.foundation-main
If you create your page template components by extending the OOTB wcm/foundation/components/page (assuming you use sightly), AEM will add these scripts in the head section. More specifically these are included in headlibs.html file present under the OOTB page component.
To overcome this, you can override this file in your component, and either comment this below line or include it conditionally only when wcmmode is edit.
<sly data-sly-test="${wcmmode.edit}" data-sly-call="${clientLib.all # categories='cq.foundation-main'}" />
For JSP based components (foundation/components/page), the same thing is done in headlibs.jsp.
By the way, you wouldn't want to remove the CSRF JS. It's AEM's solution to counter CSRF issues.
What you see is the clientcontext related js'es
The script that loads the given js'es is as below (or sth similiar)
<cq:include path="clientcontext" resourceType="cq/personalization/components/clientcontext"/>
either you exclude it completely for publish (wcmMode=disabled) which would probably break sth related to analytics on your publish, or change the include to some overwrite of the clientcontext component that you'd develop.
If you however don't use any native Adobe integration you should be safe just with excluding the thing.

Sightly and cq:dropTargets

I'm developing a new site using the latest AEM6 (formerly CQ). Originally you were able to drag images/videos into the components drop zone which was setup in the components dropTarget using JSP's.
But since Sightly templating is now the preferred way of building components rather than JSP's is it still possible to have dropTarget in Sighlty templates?
Drop target is configured using node cq:dropTargets node under the cq:editConfig and it doesn't depend on the used markup language.
The only thing that markup has to produce is a <div> tag with class cq-dd-CONFIGNAME which will be used as a drop zone. Sightly can easily generate such markup (below example will show it only in the edit mode):
<div data-sly-test="${wcmmode.edit}" class="cq-dd-images">Drop image here</div>

Limiting allowed components in a template in cq5

I have a template that I want to limit to only using a certain subset of components. I've created the template, set the components I want to use in design mode and everything looks great, but when I export that template and install it on another cq5 instance the component list that I've set for that template vanish. Any idea how to get them to stick?
The above answer is correct, but if you need more info, as part of the template implementation, you can define the list of components that will be rendered in the sidekick for your template by defining the following property.
components="[/libs/foundation/components/text,/libs/foundation/components/textimage]">
This will sit under the following node (xml format here)
<TEMPLATENAME jcr:primaryType="nt:unstructured">
<content
jcr:lastModified="{Date}2014-04-11T13:04:48.855+10:00"
jcr:lastModifiedBy="admin"
jcr:primaryType="nt:unstructured"
sling:resourceType="/libs/foundation/components/parsys"
components="[/libs/foundation/components/text,/libs/foundation/components/textimage]">
</content>
</TEMPLATENAME>
As long as you take this with your project to another instance, you'll keep the settings.
always take /etc/designs/projectDesignName directory with you
The component list is saved in your design page. A design page is a page of a "Design Page" template. You should create one for each site / project, and associate it with your page (or page's parent, or page parent's parent) using the page properties: Advanced -> Design, and then export alongside your template.

Joomla chronoform insert into existing content

I dont know much about joomla but I have a problem.
I started reading for the chromoform and it is a very nice pugin.
I created a form which I can see in the form manager and also I can view in the url.
but I want ot integrate it to an existing content.
I have a content which contains text, photos etc..
The content is editable with tinymce plugin.
And I want to integrate this form also.
One way to integrate would be to copy the html code and paste in the conent but then if I change the form component the changes would not be also in the conent.
is there a way to include the created form in the content?
Or which is the best one?
Anybody any idea?
Thanx,
Granit
If you also have the chrono plugin installed & published, you can add a form into content (such as an article) using the following syntax:
{chronocontact}form_name{/chronocontact}
This allows you to place the form anywhere within the article - you can preface the form with content (such as a heading) ....
You probably want to use the Chronocontact module (mod_chronocontact), which is provided with ChronoForms. This allows you to insert any ChronoForms form into any module location. The Joomla 1.5 download for this module is here.
Then you just need to define a module location in your template, and create a mod_chronocontact module in that location, with your forms name set up. You'll find having a couple of module locations defined immediately before and after your main content in the template is normally handy, like so:
<jdoc:include type="modules" name="beforecontent"/>
<jdoc:include type="component" />
<jdoc:include type="modules" name="aftercontent"/>