5102 Posts in 1520 Topics by 1116 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 2685 Views |
-
How to Sort Control Menu in Descending order??

10 August 2009 at 2:19pm
Hi,
My navigation is float right! So My homepage link is appearing last if you read it normally from left to right.
Of course i can re-order my pages in the CMS so the home page is on the bottom. But this is a dirty fix. Im sure there is a way i can sort the Control Menu in reverse or desc order??
I just cant find it, please can some one point me in the right direction.
Byron
-
Re: How to Sort Control Menu in Descending order??

10 August 2009 at 5:59pm Last edited: 10 August 2009 6:00pm
My navigation is float right!
ZOMG!
Im sure there is a way i can sort the Control Menu in reverse or desc order??
This is a CSS issue rather than a problem with SilverStripe. Rather than floating the list elements ('li') to the right, you should float containing element right, with the child elements floating left within it. The actual order of the list elements should not need to change.
-
Re: How to Sort Control Menu in Descending order??

10 August 2009 at 7:12pm
Okay, that does work and is one solution i over looked, thank you!
However, i still wish to know if it is possible to sort in a desc order??
-
Re: How to Sort Control Menu in Descending order??

24 August 2010 at 9:41pm Last edited: 24 August 2010 9:45pm
This is a CSS issue rather than a problem with SilverStripe. Rather than floating the list elements ('li') to the right, you should float containing element right, with the child elements floating left within it. The actual order of the list elements should not need to change.
This is sadly not going to work for me. The problem with the CSS fix above is:
1. If the menu item is removed there is gap to the right unless the width of the menu container is changed via CSS!
2. No more menu items can be added unless the width of the menu container is changed!The code for this is:
public function sortedChildren() {
$children = $this->Menu(1);
$children->Sort('Sort', 'DESC');
return $children;
}// usage in template: <% control sortedChildren %>
| 2685 Views | ||
|
Page:
1
|
Go to Top |



