Welcome to the MetaMod and Chameleon Support Forums.

Before posting, please check out the FAQs.

helpme

 

Need extra help with your Joomla site? Consider paid Joomla support by the developer of Chameleon and MetaMod.

 

Recipes for FJRelated

Recipes for FJRelated

hinsert wrote:

Maybe it is not a difficult problem, I don't know. smile

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

Edited By: metamodguy
24-Sep-09 23:47:37

Stephen Brandon
MetaMod / Chameleon developer
If you use MetaMod or Chameleon, please post a rating and a review at the Joomla! Extensions Directory: Chameleon | MetaMod

metamodguy
useravatar
Offline
3314 Posts
User info in posts
Administrator has disabled public posting

Re: Recipes for FJRelated

In this case I'd use the rule:

Code:

if ($option == "com_fjrelated") return 101; /* customise module ID */

Stephen Brandon
MetaMod / Chameleon developer
If you use MetaMod or Chameleon, please post a rating and a review at the Joomla! Extensions Directory: Chameleon | MetaMod

metamodguy
useravatar
Offline
3314 Posts
User info in posts
Administrator has disabled public posting

Re: Recipes for FJRelated

Thanks a lot, that rule is useful for other components as well! lol

hinsert
Beginner Modder
ranks
useravatar
Offline
6 Posts
Administrator has disabled public posting

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

hinsert
Beginner Modder
ranks
useravatar
Offline
6 Posts
Administrator has disabled public posting

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

Stephen Brandon
MetaMod / Chameleon developer
If you use MetaMod or Chameleon, please post a rating and a review at the Joomla! Extensions Directory: Chameleon | MetaMod

metamodguy
useravatar
Offline
3314 Posts
User info in posts
Administrator has disabled public posting

Board Info

Board Stats:
 
Total Topics:
1691
Total Polls:
6
Total Posts:
5912
Total Posts Today:
6
User Info:
 
Total Users:
11515
Newest User:
velis415
Members Online:
0
Guests Online:
120

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