Skip to Content
author's profile photo Former Member
Former Member

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

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?

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Dec 08, 2014 at 08:20 AM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.