Search code examples
intershop

How can I (re)build the priority of a scheduled CMS component


I am currently facing a weird bug.

I have an include with a slot, I am fetching it in my ISML and I loop manually in order to get the position of each item :

//ParentSlot.isml
<isslotiterator Slot="#Pagelet:SubSlot("rajasmart_app_sf_responsive:slot.rajasmart.menu.catalog.pagelet2-CatalogItems")#" AssignmentsAlias="SlotAssignmentItems">

<isloop iterator="SlotAssignmentItems" alias="SlotAssignmentItem">
    <li>
       <ispageletassignment PageletAssignment="#SlotAssignmentItem#">
    </li>
 </isloop>

//ChildItem.isml
<isGetSlotPosition Pagelet="#Pagelet#" SlotPosition="position">

As you can see in the back-office it is the first :

enter image description here

However in my store-front it start with the third :

enter image description here

Do you have some ideas please ?


Solution

  • If your expectation is that the priority shown in the management application is semantically the same as the position characteristic of PageletAssignment, then the answer is: I'm afraid it is not.

    The priority value is defined by the index within a sorted set of position numbers.

    Suppose you have position numbers like (38,54,11,77). The algorithm sorts these numbers to (11,38,54,77). And the priority value shown would be (1,2,3,4). Basically the position attribute is just the value that is stored in the database. The priority is just there to help you grasp what is shown in which order.

    You could use a simple loop counter if the position attribute is not suitable for you.