Sort order of blocks in page is different when logged in to the manager

I have this code to gather the resources for a page:

[[!pdoResources?
            &showUnpublished=`[[!isAuthenticated]]`
            &depth=`0`
            &includeContent=`1` 
            &includeTVs=`blockType,blockMargin,imageSrcSet,imagePadding,imageRound,imageTransparent,textColor,textAccentColor,backgroundColor,shadowInBlock,textSide,buttonText,hideButton,linkToPage,altButtonColor,formId,hideFirstHeading,headerSize`
            &prepareTVs=`1`
            &processTVs=`1`
            &tplCondition=`tv.blockType`
            &conditionalTpls=`{
                "blok_carousel_fotos":"blok_carousel_fotos",
                "blok_pagina_header":"blok_pagina_header",
                "blok_afbeelding":"blok_afbeelding",
                "blok_afbeelding_en_tekst":"blok_afbeelding_en_tekst",
                "blok_tekst":"blok_tekst",
                "blok_klanten_logos":"blok_klanten_logos",
                "blok_collage":"blok_collage",
                "blok_contact":"blok_contact",
                "blok_formulier":"blok_formulier"
            }`
            &sortby=`menuindex` 
            &sortdir=`ASC` 
            &limit=`20`
            &setTotal=`1`
            &showLog=`0`
            &debug=`0`
        ]]

The sorting order for the gathered blocks is correct when I’m not logged in to the manager, but as soon as I’m logged in and refresh the page, the first block (header) appears as second.
Any ideas?

I’m using:
Modx 2.8.3
|Ace|1.9.1-pl|
|Babel|3.0.0-pl|
|CKEditor|1.4.0-pl|
|CrossContextsSettings|1.0.5-pl|
|Image+|2.8.2-pl|
|LangRouter|1.3.4-pl|
|lessCSS|1.3-pl|
|microcache|1.0.1-pl|
|modDevTools|1.0.0-pl|
|pdoTools|2.12.10-pl|
|pThumb|2.3.3-pl|
|SEO Pro|1.3.1-pl|
|SEO Suite|2.0.2-pl|
|sitemapFriend|1.0.2-pl|

Just found out that when I remove the first line in [[pdoResources…]] the problem is gone.
(but the users need that) (&showUnpublished=[[!isAuthenticated]])

Not sure if you’re still looking for suggestions since you have marked this as solved. But if you have a header that should remain as the first item, could you use the tplWrapper template and place the header block there so that it is always first?

1 Like

Have you tried moving the &showUnpublished property to the end of the list?

1 Like

Hi, thanks for thinking with me… In this template any kind of block can go for a header, hence the conditionalTpls.

That’s a suggestion I’d never have thought of. Thanks, will try asap.

Unfortunately that makes no difference.

This topic was automatically closed 2 days after discussion ended and a solution was marked. New replies are no longer allowed. You can open a new topic by clicking the link icon below the original post or solution and selecting “+ New Topic”.