Need help combining menu and global content blocks [solved]

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.
Post Reply
dwinters
Forum Members
Forum Members
Posts: 53
Joined: Mon Mar 17, 2008 12:46 pm

Need help combining menu and global content blocks [solved]

Post by dwinters »

I need to find a way of ordering content bocks in a page - so that users can move them up and down easily

I thought the best way would be to use the menu system to get an order - and let users move them up and down
and global content blocks - of the same name as the pages - for holding the content.

I Tried this

{if $count > 0}
{foreach from=$nodelist item=node}

{global_content name='{$node->menutext}'}

{if $count > ($node->index+1)} |
{/if}
{/foreach}
{/if}


Got this error

Catchable fatal error: Object of class stdClass could not be converted to string in /var/www/vhosts/monkrat.com/httpdocs/services/tmp/templates_c/1cbb26175b950de6f53144e149baf403^%%F4^F42^F4233A79%%module_db_tpl%3AMenuManager%3Bsimple.php on line 10


So I am guessing  that nesting {} tags is out? How else can I do this?

Thanks

Dan
Last edited by dwinters on Sun May 18, 2008 5:46 pm, edited 1 time in total.
Pierre M.

Re: Need help combining menu and global content blocks

Post by Pierre M. »

You can't nest smarty {}.
There is another thread in the forum suggesting a client side DOM reordering using javascript.

Pierre M.
dwinters
Forum Members
Forum Members
Posts: 53
Joined: Mon Mar 17, 2008 12:46 pm

Re: Need help combining menu and global content blocks

Post by dwinters »

Good to know I can't nest stops me banging my head with that one!

Can i declare and use like assign $boo ={$node->menutext}

then

{global_content name='$boo'}

Yes I read the javascript - that but thought they were suggesting a reorder by the viewer?

I need a cmsms user to be able to log in and change the order of a pages content blocks without having to copy and paste every bit of text 20 times to move position 19 -> position 2 and the rest down one in one page with 20 content blocks.

Could this javascript work in the admin area to reorder the content - I didnt see how.

Thanks

Dan
Pierre M.

Re: Need help combining menu and global content blocks

Post by Pierre M. »

dwinters wrote: Can i declare and use like assign $boo ={$node->menutext}
Search for capture and assign in Calguy's posts.
dwinters wrote: then  {global_content name='$boo'}
I don't think content blocks are *that* dynamic. Remember they are stored in the db.
dwinters wrote: Yes I read the javascript - that but thought they were suggesting a reorder by the viewer?
So you have read too that you are trying to make something CMSms is not designed for.

Pierre M.
dwinters
Forum Members
Forum Members
Posts: 53
Joined: Mon Mar 17, 2008 12:46 pm

Re: Need help combining menu and global content blocks [solved]

Post by dwinters »

Thanks for the pointers guys!

Did it a sweet bit of simple code in the menu to use the menu to order content blocks based on page order - and have one page as a child to the calling page for each piece of content.

Great for league tables - or any list where things change up and down, hope this helps... My first contribution back to the team!

Make a menu containing ->

{if $count > 0}
{foreach from=$nodelist item=node}

{capture assign='m_alias'}{$node->alias}{/capture}

{$cgsimple->get_page_content($m_alias)}

{/foreach}
{/if}

Then a Parent page containing

{menu template="whatever_you_called_the_menu" start_level="2"}

And create a pages as a children of the calling page for each piece of content you require - then order then on the page using the up down of the menu.

Let me know if anyone finds this useful -- cheers

Dan
Post Reply

Return to “CMSMS Core”