[solved] change order of content blocks in editor

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Locked
stevegos

[solved] change order of content blocks in editor

Post by stevegos »

Hi

I have a site which contain several content blocks per page. When editing in the admin, the content editing blocks are displayed in the same order they appear in the template.

But is there a way to change the order they are displayed in the editor?

I was looking on the forum, but cannot find any info, but was wondering if you could use the {capture} to add the content blocks to the bottom of the template and then regurgitate the content output higher up the template. I tried but could not make it work.

Hope that makes sense!

Steven

ANy ideas
Last edited by stevegos on Wed Apr 18, 2012 3:54 pm, edited 1 time in total.
RonnyK
Support Guru
Support Guru
Posts: 4962
Joined: Wed Oct 25, 2006 8:29 pm

Re: change order of content blocks in editor

Post by RonnyK »

Steven,

put them in the template as a {content assign="first"}, when that is done in the sequence that you want them, that is how they will show while editing.

Where the original {content} was placed, call {$first} instead, or however you assigned the variable mentioned above. That will be the frontend-display.

Btw, the same routine can be used to check whether a content-block has data inside, and act on that...

Ronny
stevegos

Re: change order of content blocks in editor

Post by stevegos »

Thanks Ronny

I just tried that but cannot get it work.

Where {content} is placed I entered:

Code: Select all

{$first}
{$second}
then at the bottom of the template I entered:

Code: Select all

{content assign="first" block="first"}
{content assign="second" block="second"}
The edit boxes appear in the editor but the content does not appear in the output.

Have I miss understood or go something wrong?

Steven
User avatar
Rolf
Power Poster
Power Poster
Posts: 7825
Joined: Wed Apr 23, 2008 7:53 am
Contact:

Re: change order of content blocks in editor

Post by Rolf »

Code: Select all

</__body>
<!-- Sequence in editor -->
{content assign="first"}
{content block="second" assign="second"}

<div id="main">
<!-- Sequence in frontend -->
{$first}
{$second}
- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
- + - + - + - + - + - + -
Image
stevegos

Re: change order of content blocks in editor

Post by stevegos »

Thank you. That works fine.

I always assumed the {content} tag was mandatory, but if I add in my own I can remove it.

Steven
RonnyK
Support Guru
Support Guru
Posts: 4962
Joined: Wed Oct 25, 2006 8:29 pm

Re: [solved] change order of content blocks in editor

Post by RonnyK »

Steven,

{content} is still mandatory, but you are using it... ;)

{content assign="number1"} is basically the call for {content} where the data is not showing but put in the variable $number1. With this, you can check it, and also show it with {$number1} as described in the posts before.

So you are using the required one, next to some others that have block= for the naming, but you store the data.....

Ronny
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: [solved] change order of content blocks in editor

Post by Dr.CSS »

You have to call the {content assign='number1'} first then lower down you can call {$number1}...
Locked

Return to “CMSMS Core”