Hi,
This component has endless oportunities!!
I am using the dinner menu as a "Specials" list and was wanting to have the new specials first by default. At the moment the menu has descending order. Is it possible to change this in the code somewhere to ascending just for the dinner menu? I can't find an option in the views/dinnermenu folder without having to change the number order each time in the backend?
Thanks
Ascending order on dinner menu
- Jan
- Phoca Hero
- Posts: 48386
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: Ascending order on dinner menu
Hi, then you need to modify the sql query in model in frontend.
Jan
Jan
If you find Phoca extensions useful, please support the project
-
- Phoca Member
- Posts: 10
- Joined: 16 Sep 2011, 18:49
Re: Ascending order on dinner menu
Thanks,
I try!!
I try!!
-
- Phoca Member
- Posts: 10
- Joined: 16 Sep 2011, 18:49
Re: Ascending order on dinner menu
Hi,
My post seems to have disappeared!
I can’t seem to get it to work (I must be doing something very wrong doh!)
In components/models/menu.php
I added
if ($type == {
$wheres = array();
$wheres[] = 'a.published = 1';
$wheres[] = 'a.type = '.(int)$type;
$query = ' SELECT a.*'
. ' FROM #__phocamenu_items AS a'
. ' WHERE ' . implode(' AND ', $wheres)
. ' ORDER BY ordering DESC';
$this->_db->setQuery($query);
$this->_data['items'] = $this->_db->loadObjectList();
}
Just above
//ITEM
$wheres = array();
$wheres[] = 'a.published = 1';
$wheres[] = 'a.type = '.(int)$type;
But is not working..
I would be very grateful if you could have a look and let me know what I am doing wrong.
My post seems to have disappeared!
I can’t seem to get it to work (I must be doing something very wrong doh!)
In components/models/menu.php
I added
if ($type == {
$wheres = array();
$wheres[] = 'a.published = 1';
$wheres[] = 'a.type = '.(int)$type;
$query = ' SELECT a.*'
. ' FROM #__phocamenu_items AS a'
. ' WHERE ' . implode(' AND ', $wheres)
. ' ORDER BY ordering DESC';
$this->_db->setQuery($query);
$this->_data['items'] = $this->_db->loadObjectList();
}
Just above
//ITEM
$wheres = array();
$wheres[] = 'a.published = 1';
$wheres[] = 'a.type = '.(int)$type;
But is not working..
I would be very grateful if you could have a look and let me know what I am doing wrong.
- Jan
- Phoca Hero
- Posts: 48386
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: Ascending order on dinner menu
Do you get some error message?
If you find Phoca extensions useful, please support the project
-
- Phoca Member
- Posts: 10
- Joined: 16 Sep 2011, 18:49
Re: Ascending order on dinner menu
Hi,
No I d0n't get an error message but the sort order doesn't change
No I d0n't get an error message but the sort order doesn't change
- Jan
- Phoca Hero
- Posts: 48386
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: Ascending order on dinner menu
Hi, then seems the changes were not successfull, but no specific advices there as not made such customization yet
If you find Phoca extensions useful, please support the project
-
- Phoca Member
- Posts: 10
- Joined: 16 Sep 2011, 18:49
Re: Ascending order on dinner menu
Thanks Jan,
I'm not very good with php but I gave it a go!
I'll keep trying to see if I can get it to work
I'm not very good with php but I gave it a go!
I'll keep trying to see if I can get it to work