Welcome Guest, Not a member yet? Register   Sign In
Best solution for up/down links
#1

[eluser]NiconPhantom[/eluser]
Hi all

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

Thank you!

Alex
#2

[eluser]obiron2[/eluser]
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
Code:
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:
Code:
$data['menu_elements'] = $Menu_elements
$this->load->view('my_view',$data)
In your view, loop through the elements and produce the menu labels
Code:
foreach ($menu_elements as $ME)
{
  print anchor($ME->targetURL,$ME->title). "BR"

}
#3

[eluser]JoostV[/eluser]
Not sure if this is what you mean, but I use a jQuery plugin for my CMS:
http://bitsinashortbit.wordpress.com/200...ry-plugin/

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.
#4

[eluser]NiconPhantom[/eluser]
Thank you, thats very useful idea for me!


Alex




Theme © iAndrew 2016 - Forum software by © MyBB