Need extra help with your Joomla site? Consider paid Joomla support by the developer of Chameleon and MetaMod.
- Index
- » MetaMod
- » MetaMod General Support
- » Recipes for FJRelated
Recipes for FJRelated
Recipes for FJRelated
hinsert wrote:
Maybe it is not a difficult problem, I don't know.![]()
The URL contains the following line part:
index.php?option=com_fjrelated&view=fjrelated&layout=blog&id=0&Itemid=61
For me it would be okay if I can assign a menu to every article that has com_fjrelated as part of the URL, so that it is not dependent on any other parameter. That sounds quiet easy, but I don't know if it is easy to translate into code.
Thanks in advance!
hinsert
Note: "FJ Related" is a great component found for making blog or list-style pages of articles related by certain keywords. You can find it at http://extensions.joomla.org/extensions … 26/details
24-Sep-09 23:47:37
Re: Recipes for FJRelated
Hi Stephen,
One small question. If I would like to assign menus to a specific article, so a specific Itemid, which php variable should I use then for that id? Should it look something like:
Code:
if ($option == "com_fjrelated")
if ($id == "62") return 52;
if ($id == "67") return 57;
return;
Regards,
hinsert
Re: Recipes for FJRelated
Close! Try it this way:
Code:
if ($option == "com_fjrelated") {
if ($id == "62") return 52;
if ($id == "67") return 57;
}
This only works because MetaMod automatically fills in $option and $id for you. (It also fills in some others; see the bottom of this page for the full list: http://www.metamodpro.com/get-started/configuration )
If there are other values that you want to get from the URL (or more correctly from the underlying URL, because SEF URLs can hide these from the user), then you would get them this way:
Code:
$val = JRequest::getVar("special_id");
... where there was a parameter called 'special_id' in the URL.
Cheers,
Stephen
- Index
- » MetaMod
- » MetaMod General Support
- » Recipes for FJRelated
Board Info
- Board Stats:
- Total Topics:
- 1700
- Total Polls:
- 6
- Total Posts:
- 5967
- Posts this week:
- 3
- User Info:
- Total Users:
- 8056
- Newest User:
- no21an
- Members Online:
- 0
- Guests Online:
- 116
- 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