block appearing in different order than added
Permalink
This is a repost as the one I posted 8 hours ago does not appear... no idea why
The order of the blocks in a page type->output is not the order it appears on the page. The database has the correct DisplayOrder, and the query is returning them in that order, but they always appear in last-entered-last-shown.
Even if I delete everything and re-add them, same.
I do not know what part of the code to look in to debug this. Nut more importantly, why/how is this even happening? I remember there was a similar bug years ago - can't remember that far back, but how is this still a thing? And why am I not seeing a pile of questions about this? I can't imagine I am the only one with this issue.
I hope this post does not disappear, and I hope someone has a clue about this
The order of the blocks in a page type->output is not the order it appears on the page. The database has the correct DisplayOrder, and the query is returning them in that order, but they always appear in last-entered-last-shown.
Even if I delete everything and re-add them, same.
I do not know what part of the code to look in to debug this. Nut more importantly, why/how is this even happening? I remember there was a similar bug years ago - can't remember that far back, but how is this still a thing? And why am I not seeing a pile of questions about this? I can't imagine I am the only one with this issue.
I hope this post does not disappear, and I hope someone has a clue about this
Thanks for replying.
My default page template (Pages & Themes -> Page Types -> Blog Post ->Output) has some blocks on in in the following order
[page attribute] (3rd added)
[content] (2nd added)
[share links] (1st added)
But when the page is rendered they appear in a different order
[share links] (1st added)
[content] (2nd added)
[page attribute] (3rd added)
See attached image
Note: If I delete and re-add all the blocks from the template, then create a new page, the objects appear in the correct order, but on all the existing pages, even though they are updated with the new blocks, the order is still off.
So the questions, how do I update the OLD pages with the correct order?
My default page template (Pages & Themes -> Page Types -> Blog Post ->Output) has some blocks on in in the following order
[page attribute] (3rd added)
[content] (2nd added)
[share links] (1st added)
But when the page is rendered they appear in a different order
[share links] (1st added)
[content] (2nd added)
[page attribute] (3rd added)
See attached image
Note: If I delete and re-add all the blocks from the template, then create a new page, the objects appear in the correct order, but on all the existing pages, even though they are updated with the new blocks, the order is still off.
So the questions, how do I update the OLD pages with the correct order?
p.s. I can also confirm that the display order attribute in the database is correct and that the SQL in concrete/src/Page/Collection/Collection.php is returning the array of blocks in the correct order. So, I do not know where to look to see why this order is getting overridden.
Ok Got you. If it working on new pages you have created it sounds like a cache issue. So what you need to do is re-apply that template you want on the existing pages. Even if that template is already selected. Then once that is done manually clear the site site cache and turn off full page caching if its on. Then you should see your pages updated in the correct order.
If its still acting weird find me on the C5 slack channel and we can work it out. I had a similar issue just yesterday when I updated existing pages with new templates. stewblack23 on slack.
If its still acting weird find me on the C5 slack channel and we can work it out. I had a similar issue just yesterday when I updated existing pages with new templates. stewblack23 on slack.
I am not sure what you mean by "re-apply"... I select "setup on all child pages", but how do I reapply the entire template to a page? The template is assigned to a page type in "Page Types -> Blog Post -> outputs". How do I reapply that template to that page type? Thanks
FYI, I have ...
incognito browser with cache turned off
all cache turned off in system setting
run ./concrete/bin/concrete5 c5:clear-cache
delete all files under applications/files/cache
FYI, I have ...
incognito browser with cache turned off
all cache turned off in system setting
run ./concrete/bin/concrete5 c5:clear-cache
delete all files under applications/files/cache
What is also odd is that I change the page type of the page to Page Template = Blank and Page Type = None, but the blocks defined only in the Page Template: BlogPost still appear (and also in the wrong order!).... How is that possible? Obviously, I am really not clear how all these pieces fit together.
I can only assume that blocks collection for a page is independent of the page type, so no matter what page template I choose the same blocks will appear, yet, the blocks are specifically associated with a page type, which (I guess) mean that the query for the blocks collections specifically ignore the page type associated with that collection.
It would be great if there was some documentation (other than the source code) that... but I have yet to find it. Do you know if such docs exist?
I can only assume that blocks collection for a page is independent of the page type, so no matter what page template I choose the same blocks will appear, yet, the blocks are specifically associated with a page type, which (I guess) mean that the query for the blocks collections specifically ignore the page type associated with that collection.
It would be great if there was some documentation (other than the source code) that... but I have yet to find it. Do you know if such docs exist?
I think I can get this working but really have to see your php templates and your page type setup. If you are on Slack find me in the C5 group and I would be more then glad to get this up and working. stewblack23 is my slack name.
I appreciate your help. Sadly, I can't join the C5 group. I get the following message when I try
If you have an @concretecms.com or @portlandlabs.com email address, you can create an account.
There's always teamviewer ;)
If you have an @concretecms.com or @portlandlabs.com email address, you can create an account.
There's always teamviewer ;)
I have reposted this as a new issue, given the new info I have learned
https://www.concrete5.org/developers/beta/beta_discussion/this-looks...
https://www.concrete5.org/developers/beta/beta_discussion/this-looks...
BUMP!
What are you trying to achieve with in your page type? I would check the default page template you have assigned to the page type for that output. Something might be weird with that php template itself.