I am using Adobe Experience Manager (AEM) 6.3. In the basic structure, components folder contains content and structure folders.
In both the folders we put components. What is the difference in both the folders?
In simple terms, Components which are responsible for rendering the skeleton or the outermost part of the page are placed in the structure folder where as components which render only parts of the page are placed in content folder.
Note that this is just a best practice recommendation from Adobe, you can maintain folders with custom names as well.
In older versions of AEM, components in structure folder were placed in page folder and were called page components.
High-level flow of how structure and content components integrate in a page -
To create a page in AEM, you'll have to select a template.
A template is first created in /conf folder. Templates are usually backed up(sling:resourceType of the template points to structure component) by a structure component to render the initial view. Common structure components includes header, footer, body which usually contains container components like parsys or responsivegrid.
A page is then created using the template created above and the content author uses functional components (components in content) to design the page - drag and drop from components side rail or sidekick in previous versions.
Related
We have an existing AEM application where there are 100s of pages. On most of the pages, different css files are getting loaded via a separate network call. We need to optimize this. What I am thinking is if we can:
1. Author the list of css files on the page as a page property.
2. In our code, this page property is read and all the css files mentioned as a property value get combined and rendered on the page. Similar to what is done in css.txt file or embed property.
Please suggest.
Their are few ways to reduce the network calls for css files in AEM
1) Add the css files at the template level so that all the css files are loaded once.
2) Instead of adding the category of the clientlibs use the embed property of the clientlibs. AEM will combine all the clientlibs provided in the embed property into a single clientlib and their will be only network call. But the size of the css file may increase after combining and it will effect the page load time for the first time.
But if your requirement is to author the css files then I will suggest you have a dropdown kind of property in your dialog where all your css files are displayed and the author can select the css according to the need. Once selected then you can apply those css to the html by reading through sightly.
So, it seems you don't want to or cannot use the clientlib functioanlity which is an ootb AEM feature.
No matter what solution you choose - maybe a frontend JavaScript snippet that can decide which CSS files would be needed, or some logic that builds CSS includes at render time based on the components used in the page, or something completely different - I would strongly suggest not to put the CSS files to be used in the editor's responsibility.
If they need some additional styles to be set, use the Adobe Style System. But do not abuse page properties for CSS file configurations.
I mean "hundreds of pages" sounds like a rather small site, but it might still increase your maintenance efforts a lot, when the first people start to complain about wrong colors or font sizes...
how to run a java script function which belongs to an external plugin after the DOM gets loaded in
adobe Experience Manager ?
currently it run in console but not on local file.
Please have a look at this Adobe Helpx Articles:- https://helpx.adobe.com/experience-manager/using/custom-carousel-components.html
//Creating Custom Carousel components for Adobe Experience Manager
It covers, how to use third party Javascript/JQuery plugins in AEM components.
[From Article] Add the JQuery Carousel API to a CQ:ClientLibraryFolder node
You add CSS files and JQuery framework files to a cq:ClientLibraryFolder node to define the style of the client JSP. The JQuery framework file that is added is named jquery-1.6.3.min.js.
In addition to the JQuery framework file, add the JQuery Carousel API library. This library enables you to create a CQ widget that retrieves images from the CQ DAM and displays the images within a carousel.
You can download the Carousel API library from the following URL:
http://www.catchmyfame.com/2009/08/27/jquery-infinite-carousel-plugin-1-2-released/
You need to retrieve the following JS file from the downloaded file: jquery.infinitecarousel.js. To add CSS files and JQuery framework files to your component, add a cq:ClientLibraryFolder node to your component. After you create the node, set properties that allow the JSP script to find the CSS files and the JQuery library files.
To add the JQuery framework, add a new node named clientlibs to your component (as discussed later). Add these two properties to this node.
Name Type Value
dependencies String[] cq.jquery
categories String[] jquerysamples
The dependencies property informs CQ to include the CSS files and JQuery libraries in the page. The categories property informs CQ which clientlibs must be included.
After you create the Clientlibs folder, add the stlye.css file, the JQuery library files, and two map text files.
Text files
You have to add a text file to the clientlibs folder that maps to the JS files. The name of the text file is: js.txt. The js.txt file contains the JS file names: jquery-1.6.3.min.js and jquery.infinitecarousel.js.
Add the files to the ClientLibs folder
Right-click /apps/carousel/components then select New, Node.
Make sure that the node type is cq:ClientLibraryFolder and name the node clientlibs.
Right click on clientlibs and select Properties. Add the two properties specified in the previous table to the node.
On your file system, navigate to the folder where the JQuery JS files are located. Drag and drop the JS files to the clientlibs node by using CRXDE.
On your file system, navigate where you placed the CSS files. Drag and drop the CSS files to the clientlibs folder by using CRXDE.
Add a TXT file to the clientlibs folder named js.txt. Add the content specified in this section.
Some More Reference links are:-
Link:- http://help-forums.adobe.com/content/adobeforums/en/experience-manager-forum/adobe-experience-manager.topic.html/forum__3vab-is_there_anytoolre.html
Link:- http://help-forums.adobe.com/content/adobeforums/en/experience-manager-forum/adobe-experience-manager.topic.html/forum__rwhk-i_have_a_requirement.html
Link:- http://help-forums.adobe.com/content/adobeforums/en/experience-manager-forum/adobe-experience-manager.topic.html/forum__6l3s-i_would_liketocrea.html
I hope this will help you.
Thanks and Regards
Kautuk Sahni
I am very new to angualrjs and ionic, so for my application i have a set of html code which is reused in multiple view templates. Is there a way I can move those repeated code to a file and include in the templates as I wanted.
Eg - I have a three different types of product details pages each have a block which shows the product price details. So If I can move the price part to another template file I can maintain/modify those part easily.
I'm building a mobile app that is a port from a web-app and I'm trying to create the skeleton.
I have an admin center with a lot of different views that share one thing in common, they show all registers, create, update and delete. For example, I have one section for users where the first page shows all users, then there is a button to create and one for update that sends to different views.
The project skeleton would be something like this:
/users
users.html // show all users
users_create.html // creates user
users_update.html // update specific user
users_detail.html // show specific user
/posts
posts.html
posts_create.html
posts_update.html
posts_detail.html
/communities
communities.html
communities_create.html
communities_update.html
communities_detail.html
.... much more the same for other sections
My question is, what would be the best approach to build this with ionic? to have all this folders or just one common folder and resolve everything (number of fields, name of fields, etc) by passing a param to the route?
I ask you sorry if I didn't explain it very well but I hope you catch the idea of what I'm trying to say.
Thanks!
From the awesome book MEAN Web Development by Amos Haviv you can learn that there are basically two folder structures you can opt for:
Horizontal folder structure
A horizontal project structure is based on the division of folders and files by their functional role rather than by the feature they implement, which means that all the application files are placed inside a main application folder that contains an MVC folder structure. As you can see, the horizontal folder structure is very useful for small projects where the number of features is limited, and so files can be conveniently placed inside folders that represent their general roles.
Vertical folder structure
A vertical project structure is based on the division of folders and files by the feature they implement, which means each feature has its own autonomous folder that contains an MVC folder structure.
So, in your case, what I would actually do is go with the Vertical folder structure (since you said the app is (is going to be) big, where you would (in your case) have a users folder where you would then have folders controllers, views, model (in case you're using it) and all the appropriate files inside it. You can view the folder structure in action if you take a look at the project mean.js from the same author as the book.
I've created a website in AEM and created a design for that website. Initially the design included a folder with images and a css file called static.css. When I specify the cq:designPath on a node in my website's content, the static.css file gets included automatically (/etc/designs/mywebsite/static.css); AEM also tries to include another file (/etc/designs/mywebsite.css). If the static.css file doesn't exist, it will NOT get included, but the mywebsite.css file gets included ('ed to) regardless of whether or not it exists. The documentation I have found (see here) suggests that you can include any number of css files in your design, but when I try to add addition css files to the /etc/designs/mywebsite/ folder, none of them get included. Am I missing something here? Should all the css files under /etc/designs/mywebsite/ be included in the site, or is it intended that only /etc/designs/mywebsite.css and /etc/designs/mywebsite/static.css are included automatically and any additional files need to be included manually?
The .css extension on the design node invokes a servlet (/libs/wcm/core/components/designer/designer.css.java) which dynamically generates CSS based on various nodes from the design's jcr:content node into CSS.
When a content author switches to design mode (WCMMode=Design), the edit dialogs save to the either the currently-applied design or the default (/etc/designs/default) design's jcr:content node. The template used to create the page, along with the path of the component being edited will determine the path under the jcr:content node where the design settings are saved.
For instance, if you edit an out-of-the-box parsys component you will see an option to editing the "Cell Padding"
If you enter a CSS padding value into the text box and click OK, the value will be saved to a div.padding property at the following location:
/etc/designs/mydesign/jcr:content/mytemplate/par/section[div.padding="30px"]
The servlet will then render the following in the design CSS:
.mytemplate .par div.section {
padding: 8px;
}
The class that actually converts the nodes to CSS is the CSSWriter in the cq-wcm-core jar.
For more information, see a similar question I asked a while back:
In Adobe AEM, how does the parsys component inject styles into the design css file?
Just a short correction. Actually it is not: /etc/designs/mydesign/jcr:content/mytemplate but instead /etc/designs/mydesign/jcr:content/my_page_component
That means if two pages have different templates but share the same page rendering component, then they will share the same design configuration and their components will write at the same location in Design Mode.