Need extra help with your Joomla site? Consider paid Joomla support by the developer of Chameleon and MetaMod.
- Index
- » MetaMod Pro
- » MetaMod Pro General Support
- » need a case by case variable for a...
need a case by case variable for a keyword in URL
need a case by case variable for a keyword in URL
i need to show modules based on keywords found in the URL.
Example, in this URL I have the word "automobiles": hxtp://www.ehrcompare.com/reviews/automobiles
The keyword may be in any number of locations in the URL, so I can't be very specific - just that the word is in the url somewhere.
I have a working metamod that uses this but it's too specific:
Code:
if ( JRequest::getVar('url') == 'search-results' ) {
$brand = (JRequest::getVar('jr_specialties'));
switch ($brand) {
case "Allergy": return 382;
case "Audiology": return 383;
How could I rewrite that code so that the keyword can be anywhere in the URL?
Re: need a case by case variable for a keyword in URL
Hi,
I would use the following JomGenius code:
if ($core_genius->check("url contains automobiles")) return 383;
if ($core_genius->check("url contains allergy")) return 382;
That should do it :-)
Stephen
- Index
- » MetaMod Pro
- » MetaMod Pro General Support
- » need a case by case variable for a...
Board Info
- Board Stats:
- Total Topics:
- 1689
- Total Polls:
- 6
- Total Posts:
- 5944
- Posts this week:
- 2
- User Info:
- Total Users:
- 7658
- Newest User:
- carre82601
- Members Online:
- 0
- Guests Online:
- 153
- Online:
- There are no members online
Forum Legend:
Topic
New
Locked
Sticky
Active
New/Active
New/Locked
New Sticky
Locked/Active
Active/Sticky
Sticky/Locked
Sticky/Active/Locked