cancel
Showing results for 
Search instead for 
Did you mean: 

What's the difference between "cms:slot" tag and "cms:pageSlot" tag?

Former Member
0 Kudos

hi, I found there are two tags for creating the page tempate, and . In the document https://wiki.hybris.com/display/accdoc/How+To+Add+a+New+CMS+Page+Template+-+Tutorial the sample source used tag of /cms2lib/cmstags/cmstags.tld.

While, in the project yacceleratorstorefront, the source used tag of "http://hybris.com/tld/cmstags".

What's the difference between those two tag, and we should use which one when we create page template?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member

If I try to answer your question.

  1. cms:pageSlot - It is governed by the tag file /web/webroot/WEB-INF/common/tld/cmstags.tld which is in the acceleratorcms extension. If you go to the description of the same, it says-"terates over the components in a CMS content slot for a position in the current page". It uses the cmsPageContextService to get the content slot. You can access the contenSlot on the template jsp by mentioning the position of the slot there (which you, ofcourse give when you create a content slot). Furthermore, there are other attributes as well, which talk about the limit of components to render for the slot, the HTML element to be generated for this slot etc. This tag tries to find the contentSlot first by the mentioned position, or you can alternatively specify the "uid" of the slot.

  2. cms:slot - This is governed by /cms2lib/resources/cms2lib/cmstags/cmstags.tld. Unlike the earlier one, it does not uses the "position" but the "uid" to get the corresponding slot. There is no such flexibility and control over this tag in terms of the HTML element that needs to be rendered for this slot etc.

Therefore, in my view the former offers more flexibility and control over the rendered contentSlot rather than the latter one. Infact, the former possesses all of the functionality offered by the latter one.

You can analyse further by looking at the source codes of the java files, and use either of them as per your requirement.

Former Member
0 Kudos

Thank for you response.

Answers (0)