Need extra help with your Joomla site? Consider paid Joomla support by the developer of Chameleon and MetaMod.
- Index
- » Chameleon / ChameleonLite
- » Chameleon
- » Rules and things
Rules and things
Rules and things
Hi,
Might sound a bit crazy but I need to set up some rules for publishing pages on "the days of the week" Monday and Wednesday for one page and Tuesday and Thursday for a second page.
So on a Monday or Wednesday - page one is published and on a Tuesday or Thursday page two is published.
I know I can do it by date 1/1/17 etc! but days of the week would be so much tidier and so much of a reduction of the rules, or making them so complex.
I admit I haven't looked yet..sometimes (you remember me) it's easier to ask than to spend time failing to achieve your goal.
Thanks,
Ian C
Re: Rules and things
Hi Ian,
good to hear from you again.
I'm assuming that you are using Chameleon (not MetaMod Pro) and that you already know how you want to display different pages. So I'll concentrate on just how to do the detection of days of the week.
There are 2 ways:
1 - use the freeform date/time controls. Using these you can detect 1 day per rule. If you want to detect Monday and Wednesday you would need to put each of these into a separate rule, presumably with the same action.
So in the start date/time put Monday, and in the end date/time put Monday. That way it should trigger the rule every Monday.
2 - use the PHP panel. You can combine more complex time periods using PHP. For days of the week you could do it like this:
// For MM_DAY_OF_WEEK, 0 is Sunday and 6 is Saturday
if (MM_DAY_OF_WEEK == 1 or MM_DAY_OF_WEEK == 3) return true;
else return false;
You also need to set up a rule for the Tuesday and Thursday page:
if (MM_DAY_OF_WEEK == 2 or MM_DAY_OF_WEEK == 4) return true;
else return false;
I'm interested to know what Actions you are going to use to display different pages. Is that using menu items, or setting a different default menu item, or something different?
Cheers
Stephen
Re: Rules and things
Hi Stephen,
I do normally stay a bit quiet but I went through the forum, took some time to do but I think you can see see concept here. I think I did it much as you described.
Simple rule 1 monday 00:00:00 to monday 23:59:00 do this etc! copy rule and change day for tuesday.
I created a page for each day of the week and set it up in a menu then, using Chameleon I setup a rule for each day, un-publishing (on success) the menu items that did not apply to that day. It seems to work so well at present, but this is the first day - Sunday - and that is all that is showing for that segment of that specific menu.
In fact, providing Mondays menu appears tomorrow, I was so impressed with the simplicity that I've put a referral link to Chameleon (metamod) on every page of the site. Hope it works for you. Never know do you?
https://www.caribtv.ga/
On my server time it only shows an option for "Sunday Live". We'll see what happens tomorrow.
The beauty of the simplicity is that if we need to have other pages running on days of the week we can replicate the process, create a new menu and run everything from inside the same set of seven rules via menu options.
Might even get free updates (LOL)
Best wishes,
Ian
Thanks,
Ian C
- Index
- » Chameleon / ChameleonLite
- » Chameleon
- » Rules and things
Board Info
- Board Stats:
- Total Topics:
- 1699
- Total Polls:
- 6
- Total Posts:
- 5967
- Total Posts Today:
- 2
- User Info:
- Total Users:
- 8023
- Newest User:
- steves6794
- Members Online:
- 1
- Guests Online:
- 130
- Online:
- steves6794
Forum Legend:
Topic
New
Locked
Sticky
Active
New/Active
New/Locked
New Sticky
Locked/Active
Active/Sticky
Sticky/Locked
Sticky/Active/Locked