• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Best solution for up/down links

Hi all

I need move my menu elements up and down... What is the best solution for CI?

Thank you!


you need to get the menu elements into a sorted array. The easiest way is to

store your menu elements in a database with a sort_order value
select * from menu_elements order by sort_order DESCENDING
This will get the elements into a object (or array depending on your RETURN)

pass this to the view:
$data['menu_elements'] = $Menu_elements
In your view, loop through the elements and produce the menu labels
foreach ($menu_elements as $ME)
  print anchor($ME->targetURL,$ME->title). "BR"


Not sure if this is what you mean, but I use a jQuery plugin for my CMS:

It creates a table of menu-items that can be dragged up and down. At the end of every drop I save the new order to the database.

So, no arrows or numbers, just drag the items to the right positions.

Thank you, thats very useful idea for me!


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.