Need extra help with your Joomla site? Consider paid Joomla support by the developer of Chameleon and MetaMod.
- Index
- » Chameleon / ChameleonLite
- » Chameleon
- » Cannt get chameleon to remove menu item
Cannt get chameleon to remove menu item
Cannt get chameleon to remove menu item
I am using Chameleon to set times that a store order and delivery menu is available on a client's web site.
I finally got one time range working for Monday - Saturday, but, I need to have a different set of times for Sundays.
Is there any way to do this besides setting separate time rules for every day of the year?
Any help is appreciated.
Thanks
Re: Cannt get chameleon to remove menu item
Hi Wahoshi,
Yes, you can definitely do this easier all in 1 rule! I would do this with some PHP code that returns a "true" value whenever it's inside one of the time periods, and false otherwise.
I've just used some made up time periods below to show you one way of doing it. As usual in PHP there are many ways to achieve the same thing, but the method below is a good one.
Example: show from 09:00-11:30 and 13:00-1700 Mon-Fri, and 10:00-12:00 on Saturday and Sunday:
if (
$core_genius->inTimeSpan("mon-fri")
and
(
$core_genius->inTimeSpan("09:00-11:30")
or
$core_genius->inTimeSpan("13:00-17:00")
)
) return true;
if (
$core_genius->inTimeSpan("sat-sun")
and
$core_genius->inTimeSpan( "10:00-12:00" )
) return true;
// for all other times:
return false;
That should do it :-)
Just don't forget to use that extra set of parentheses ( ) around "or" conditions, as in the mon-fri condition, otherwise you get unexpected results.
Best regards,
Stephen
- Index
- » Chameleon / ChameleonLite
- » Chameleon
- » Cannt get chameleon to remove menu item
Board Info
- Board Stats:
- Total Topics:
- 1689
- Total Polls:
- 6
- Total Posts:
- 5944
- Total Posts Today:
- 1
- User Info:
- Total Users:
- 7645
- Newest User:
- foocd90
- Members Online:
- 2
- Guests Online:
- 171
- Online:
- melton7386, foocd90
Forum Legend:
Topic
New
Locked
Sticky
Active
New/Active
New/Locked
New Sticky
Locked/Active
Active/Sticky
Sticky/Locked
Sticky/Active/Locked