is there a way to add content on top of older posts?

Permalink
Hi,
I'm trying to find out how to add content always to the top of the page, above existing content.
Basically newer stuff appears first, as you would find it in forums.
If I follow the standard procedure, Edit page > Add content > write something, update the page then the post will appear below the existing, previously posted elements.
Thanks for the help.

 
frz replied on at Permalink Reply
frz
i think you might be able to do this with some tom-foolery in your template if you're willing to bust out some PHP, but no, annoyingly in the front end there is no way to control sort ordering within a block area like there is at the collection level..

would be nice to have.. that or at least a "move to top" option in the sort interface.
Remo replied on at Permalink Reply
Remo
Yeah, I actually had that problem a few times but never thought about it that much since I'me used to move blocks around but having such a feature would be really cool!

+1
Gucky replied on at Permalink Reply
Gucky
So we have been at this problem for a while as well, this is the solution we have come up with.

Step 1.
Copy out
\concrete\models\collection.php
\concrete\js\ccm.ui.js

to your respective custom models and js folders

Step 2:
Edit custom collection.php
Change line 632 in getBlocks()
from :
$q .= "order by CollectionVersionBlocks.cbDisplayOrder asc";
to:
$q .= "order by CollectionVersionBlocks.cbDisplayOrder desc";

*this will always put the new block on the top*

Edit custom ccm.ui.js
Change line 282 in ccm_parseBlockResponse
From:
$("#a" + resp.aID + " div.ccm-area-styles-a"+ resp.aID).append(r);
to:
$("#a" + resp.aID + "controls div.ccm-area-styles-a"+ resp.aID).after(r);


Change Line 284
From:
$("#a" + resp.aID).append(r);
To:
$("#a" + resp.aID +"controls").after(r);

*this will make sure new blocks are inserted at the top of the area when editing*


Hope that works for you guys
Remo replied on at Permalink Reply
Remo
I'm aware that this is an incredibly old topic but it still seems to be an issue for a few customers of mine.

The code posted above might solve some problems but if we'd like this in the core we might need the ability to specify this per area or extend the interface.

Is there anyone else who still has this problem? What are your preferred approaches?
Ricalsin replied on at Permalink Reply
Ricalsin
Problem, yes. Approach, no.

I'm following this thread hoping for a solution.
Ricalsin replied on at Permalink Reply
Ricalsin
Problem, yes. Approach, no.

I'm following this thread hoping for a solution.
Ricalsin replied on at Permalink Reply
Ricalsin
Problem, yes. Approach, no.

I'm following this thread hoping for a solution.
Ricalsin replied on at Permalink Reply
Ricalsin
Geez, sorry for the multiple posts. The "delete" button does not work....
sschildbach replied on at Permalink Reply
sschildbach
This advise must be from an outdated version of the core of Concrete5. I can't even find this code in the two files Gucky mentions. Like the others in this post, I'm also looking for a way for new blocks to appear at the top rather than the bottom. I have a client who is going to be entering a lot of links in a vertical column that need to have the newest entry at the top and don't want to have to tell them that every new entry they are going to have to move from the bottom to the top. I already, mentioned that to them and they couldn't understand why.
graphxks replied on at Permalink Reply
I've found the files and modified them according to Gucky's instructions and it works, but it works too well. His solution "ALWAYS" reorders latest first even when manually moving blocks and saving their positions!