Need extra help with your Joomla site? Consider paid Joomla support by the developer of Chameleon and MetaMod.
- Index
- » Chameleon / ChameleonLite
- » Chameleon
- » Overriding a set a rules with a...
Overriding a set a rules with a single rule
Overriding a set a rules with a single rule
Hi Stephen, I have been experimenting with metatemplate pro a lot. I have quite a lot of rules and sometimes a template will be set reluctantly, because of my lack of understand of the chain of rules perhaps.
For example using a rule which detect the referrer "contains" the expression "/en/", it can conflict with another geoip rule in the same session.
Is there anyway to make a rule override all the other rules permanently once it's been called?
Cheers
Re: Overriding a set a rules with a single rule
If by "permanent override" you mean forever, then I'd set a permanent cookie in the SUCCEED action of that rule. Then, I'd make another rule at the start of the chain that detects that permanent cookie, sets the template (or whatever), then stops processing the rule chain.
Is that what you're after?
Cheers,
Stephen
Re: Overriding a set a rules with a single rule
Yes it make sense.
So it would be something like this in the SUCCEED php box?
Code:
/* 2: delete all cookies A-H: */
$time = time() - 60*60*24*365*10;
setcookie( 'MT1', '', $time, '/' );
setcookie( 'MT2', '', $time, '/' );
setcookie( 'MT3', '', $time, '/' );
setcookie( 'MT4', '', $time, '/' );
setcookie( 'MT5', '', $time, '/' );
setcookie( 'MT6', '', $time, '/' );
setcookie( 'MT7', '', $time, '/' );
setcookie( 'MT8', '', $time, '/' );
/* 3: delete only cookie H: */
$time = time() - 60*60*24*365*10;
setcookie( 'MT8', '', $time, '/' );
/* 4: set cookie H: */
$time = time() + 60*60*24*365*10;
setcookie( 'MT8', 1, $time, '/' );
But I noticed even though I did that for most of my rules, once that permanent cookie is detected "landing=x", it can still be deleted and reseted by another rule when for example it detects a new referrer that is part of another rule, like "landing=y".
Any ideas?
Cheers
Re: Overriding a set a rules with a single rule
If you don't want other rules to be able to override the cookie that was set, you need to do this:
Make the rule that detects the cookie. Put it early in the chain (e.g. first). Ensure it performs the actions that you want it to.
Then in the SUCCEED action, ensure that you set "stop processing" at the end of the SUCCEED action. That way, MetaTemplate will never get to the other rules that could override that cookie. It will quit the whole rule chain.
Best regards,
Stephen
- Index
- » Chameleon / ChameleonLite
- » Chameleon
- » Overriding a set a rules with a...
Board Info
- Board Stats:
- Total Topics:
- 1689
- Total Polls:
- 6
- Total Posts:
- 5943
- Total Posts Today:
- 1
- User Info:
- Total Users:
- 7638
- Newest User:
- moner86658
- Members Online:
- 1
- Guests Online:
- 110
- Online:
- moner86658
Forum Legend:
Topic
New
Locked
Sticky
Active
New/Active
New/Locked
New Sticky
Locked/Active
Active/Sticky
Sticky/Locked
Sticky/Active/Locked