Need extra help with your Joomla site? Consider paid Joomla support by the developer of Chameleon and MetaMod.
- Index
- » MetaMod
- » MetaMod General Support
- » Mosets Tree custom fields recipe
Mosets Tree custom fields recipe
Mosets Tree custom fields recipe
Hi,
I am trying to get Mosets Tree custom field to be included in the recipe, but can't find my way through it. Can you share an example to do this?
Right now I only have this:
Code:
if ($option == 'com_mtree' and JRequest::getVar('task') == 'viewlink' )
{
return XX;
}
But that's only for a link with 'viewlink'.
I am trying to differentiate two types of mosets listing and recognize them by custom field. It seems there is too much page to assigned module by page ID, so it would be wise to include one custom field that differentiate between these two types.
Any help?
Re: Mosets Tree custom fields recipe
Try this:
if ($option == 'com_mtree' and JRequest::getVar('task') == 'viewlink' ) {
$link_id = JRequest::getInt('link_id', 0);
$custom_field_id = 28; // replace with the ID of the custom field you want to check for
$query = "SELECT value FROM #__mt_cfvalues WHERE cf_id = $custom_field_id and link_id = $link_id";
$db->setQuery( $query );
$result = $db->loadResult();
if ( $result == 1 ) return XXX; // replace XXX with module id to return when custom field id "28" has value "1"
}
Cheers,
Stephen
Re: Mosets Tree custom fields recipe
Hi Stephen,
Thanks for the reply! That works for the detail page but when I go to different page/view but same component, this error throws out:
Notice: Undefined variable: result in /home/public_html/xxxx.com/modules/mod_metamod/helper.php(539) : eval()'d code on line 12
This is very close! Any idea?
ps: Hows thing for you? Hopefully all fine and safe!
Re: Mosets Tree custom fields recipe
Hi Pembaris,
if you're getting an error in line 12 then you're not using the exact recipe I sent... perhaps you are using the $result variable outside of the { } characters?
And things for me... not too bad. Still no laptop, but they didn't steal my iMac which was sitting next to it, and all the Meta* stuff was synched with DropBox, so I have good backup. I'm very glad for good backups, DropBox, insurance, and incompetent burglars!
Cheers,
Stephen
Re: Mosets Tree custom fields recipe
Hi Stephen,
haha funny when you called me Pembaris, as i believe you know what it means too from last time
I am the same guy that subscribes the metamod pro, Ajmal but since the site i am handling doesn't subscribe to it that's why i am posting it under metamod forum
Anyway, yeah I somehow missed the '}' when copy pasting so my bad! It works now
Thank you so much for the help I greatly appreciate it. I am sorry to hear about the news (and last time the earthquake news) so looking forward to hearing some great news in the future!
Good thing you are a competent web developer and programmer to have a good practice of backup and all important stuffs
Now I should learn how to "Dropbox" my stuffs too!
Have a good remaining Sunday!
Re: Mosets Tree custom fields recipe
Hi Ajmal,
Thanks for your good wishes. I generally refer to people's login name on the forum, even if I know the real name, unless they have signed their name at the bottom of the post. It's just a matter of privacy
Best regards,
Stephen
- Index
- » MetaMod
- » MetaMod General Support
- » Mosets Tree custom fields recipe
Board Info
- Board Stats:
- Total Topics:
- 1689
- Total Polls:
- 6
- Total Posts:
- 5942
- Posts this week:
- 2
- User Info:
- Total Users:
- 7627
- Newest User:
- rudys68879
- Members Online:
- 0
- Guests Online:
- 173
- 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