Page 1 of 1

Sort order of content blocks and content_image blocks in bac

Posted: Fri Mar 04, 2016 9:18 am
by Masweb
I have made a template such as this. But in the backend in the content manager the order of the fields are not the same as in the template.
see printscreen for the result.

How to get the same order in {content_block} and {content_image block} in the back-end.

Code: Select all

<section>
   		<div class="container">
			<div class="row">
            	<div class="blokken">
	    			<div class="col-md-4">
    	            	{content_image block="knop1" dir="images/knoppen" class="img-responsive"}
                        <a href="{content block="pagina-alias knop 1" oneline="true"}" class="btn btn-success btn-sm">{content block="tekst knop 1" oneline="true"}</a>
        	        </div>
                </div>
            	<div class="blokken">                    
    				<div class="col-md-4">
                		{content_image block="knop2" dir="images/knoppen" class="img-responsive"}
                        <a href="{content block="pagina-alias knop 2" oneline="true"}" class="btn btn-success btn-sm">{content block="tekst knop 2" oneline="true"}</a>
               		</div>
                </div>
            	<div class="blokken">                         
    				<div class="col-md-4">
                		{content_image block="knop3" dir="images/knoppen" class="img-responsive"}
                        <a href="{content block="pagina-alias knop 3" oneline="true"}" class="btn btn-success btn-sm">{content block="tekst knop 3" oneline="true"}</a>
               	 	</div> 
                </div> 
            </div>
			<div class="row">
    			<div class="col-md-12">
					<div class="horizontal-ruler">&nbsp;</div>    
 	                {content}
					<div class="horizontal-ruler">&nbsp;</div> 
	                {content block="content-onder"}
                </div>            
            </div>   
			<div class="row">
    			<div class="col-md-3">
                	<div class="werkknoppen knop1">
               			{content_image block="image-werk1" dir="images/indexpagina-werk" class="img-responsive"}
                		{content block="titel werk1" oneline="true"}
                		{content block="content werk1"}
                    </div>
                </div>
    			<div class="col-md-3">
                	<div class="werkknoppen knop2">                
                        {content_image block="image werk2" dir="images/indexpagina-werk" class="img-responsive"}
                        {content block="titel werk2" oneline="true"}
                        {content block="content werk2"}    
                    </div>            
                </div>
    			<div class="col-md-3">
                	<div class="werkknoppen knop3">                
                        {content_image block="image werk3" dir="images/indexpagina-werk" class="img-responsive"}
                        {content block="titel werk3" oneline="true"}
                        {content block="content werk3"} 
                    </div>               
                </div>     
                <div class="col-md-3">
                	<div class="werkknoppen knop4">                
                        {content_image block="image werk4" dir="images/indexpagina-werk" class="img-responsive"}
                        {content block="titel werk4" oneline="true"}
                        {content block="content werk4"}   
                    </div>            
                </div>                                
            </div>                     
        </div>
    </section>            
Using CMSMS 2.1.2 with latest extentions

Re: Sort order of content blocks and content_image blocks in

Posted: Fri Mar 04, 2016 4:02 pm
by chrisbt
I found a very similar issue: http://forum.cmsmadesimple.org/viewtopi ... =8&t=74261. Also see Jo Morg's reply.

As a short term solution you could try putting all the content & content_image tags at the very top of the template after the {process_pagedata} tag, and assign them to variables that you use in the body of your template. That way you can play with the order of the tags on the admin page without changing the order they appear in your template.

top of template:

Code: Select all

{process_pagedata}{strip}

{content_image block="knop1" dir="images/knoppen" class="img-responsive" assign=knop1}

{content block="pagina-alias knop 1" oneline="true" assign=alias1}

{content block="tekst knop 1" oneline="true" assign=text1}


{content_image block="knop2" dir="images/knoppen" class="img-responsive" assign=knop2}

{content block="pagina-alias knop 2" oneline="true" assign=alias2}

{content block="tekst knop 2" oneline="true" assign=text2}


{* more content / content_image tags here ... *}

{share_data data='knop1,alias1,text1,knop2,alias2,text2' scope=global}

{/strip}<!DOCTYPE html>
in body of template:

Code: Select all

<section>
         <div class="container">
         <div class="row">
               <div class="blokken">
                <div class="col-md-4">
                      {$knop1}
                        <a href="{$alias1}" class="btn btn-success btn-sm">{$text1}</a>
                   </div>
                </div>
               <div class="blokken">                    
                <div class="col-md-4">
                      {$knop2}
                        <a href="{$alias2}" class="btn btn-success btn-sm">{$text2}</a>
                     </div>
                </div>
...
You will still need to move around the content & content_image tags to get an order you are happy with on the admin page.

Hope that is a partial solution for you (temporarily).

Chris :)