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.

 

Selecting Menu Item to Lead to Template Change?

Selecting Menu Item to Lead to Template Change?

Hi, I am using two themes for my mobile use.

Mojoom (for JomSocial) and TapTheme (for the Site Overall)

I'd like to be able to setup Chameleon so that if you clicked on a menu item (say Profile), that it would send the user to the link and display it with the Mojoom template.

I've tried figuring this out but I can't get it to work.  Basically, the user shows up at the site and it is displaying the TapTheme Template (let's say on the iPhone).  When the user clicks on the "Profile" Icon (which is simply a menu item that redirects the user to their jomsocial profile page), it should send them there and display it with the Mojoom template.

However, without any rules set, it displays the "Profile" page in the TapTheme Template.  I have tried many things but I just can't figure it out.

Thanks in Advance for any help.

Best,

Steven

Odublar
Junior Modder
ranks
useravatar
Offline
22 Posts
Administrator has disabled public posting

Re: Selecting Menu Item to Lead to Template Change?

Hi Steven,

if the MoJoom template is to be used for ALL pages in JomSocial, then the easiest way to set this up is in the Content and Components section of a Chameleon rule, select "com_community". Then in the SUCCEED action on the right, select MoJoom as the template to use, and save the rule.

This will use the selected template for all pages that are part of com_community (aka JomSocial).

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
3328 Posts
User info in posts
Administrator has disabled public posting

Re: Selecting Menu Item to Lead to Template Change?

I think the confusing part is that mojoom isn't available in the template manager because it is actually a component.  Anytime I want to use it, I must publish a "system - mojoomswitcher" plugin, which automatically takes over for the mobile display and ignores my rules in chameleon.

If I leave the "system - mojoomswitcher" plugin unpublished, it will follow the rules and display the "tapthemeiphone" template for my rule "iphone".

I am sending you my information via PM.

Odublar
Junior Modder
ranks
useravatar
Offline
22 Posts
Administrator has disabled public posting

Re: Selecting Menu Item to Lead to Template Change?

Hi Steven,

the short answer is that if it ain't a template, then Chameleon can't select it.

A longer answer would be that it's probably possible to edit the mojoom system to allow it to be triggered by Chameleon (providing the source files are not encrypted). This would be a custom programming job - write me for details.

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
3328 Posts
User info in posts
Administrator has disabled public posting

Re: Selecting Menu Item to Lead to Template Change?

Stephen,

As per your request, I sent you a message.  From what I see by looking at the folder, it doesn't look encrypted.

Best,

Steven

Odublar
Junior Modder
ranks
useravatar
Offline
22 Posts
Administrator has disabled public posting

Re: Selecting Menu Item to Lead to Template Change?

Ok, another question for you: When do you want the MoJoom template to be used? Will it be for ALL clients and ALL JomSocial pages? i.e. are you wanting it to act like any other template that you can just select for certain pages on your site?
In other words, if MoJoom was to appear in the list of template styles, would that suffice?
I just installed MoJoom on my test site, and a template style appeared for it in the style manager. I was able to assign it like normal pages (except that it does a few strange redirects to its own component). Apart from that it seems to operate more or less like a normal template.

If you have phpMyAdmin or some other way of writing directly to the database I am sure you could repair this.

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
3328 Posts
User info in posts
Administrator has disabled public posting

Re: Selecting Menu Item to Lead to Template Change?

Hey Stephen,

Yeah, it will be used just for logged in users who access the website through a mobile device.  Taptheme has a template for iPad, iPhone and Android Phones.  Yeah, I think if I did that, it would work.

Maybe I should try to reinstall it?  I haven't done anything with it to where an uninstall is not possible.

Odublar
Junior Modder
ranks
useravatar
Offline
22 Posts
Administrator has disabled public posting

Re: Selecting Menu Item to Lead to Template Change?

It always is something dumb.  The template was unpublished to the "site".  So I am going to try and figure out how to do it this way...Not sure if I need the plugin or not.  Any ideas?  Did you try it with the taptheme file?

Odublar
Junior Modder
ranks
useravatar
Offline
22 Posts
Administrator has disabled public posting

Re: Selecting Menu Item to Lead to Template Change?

Yeah, it doesn't seem to be working.  No matter what, I have to publish the mojoomswitcher system plugin to get the template to display.  So when I do that, it ignores the taptheme template.  Perhaps you could check my rules and see if I am right?

Or else, I guess we will have to proceed with the customization.

Odublar
Junior Modder
ranks
useravatar
Offline
22 Posts
Administrator has disabled public posting

Re: Selecting Menu Item to Lead to Template Change?

Hi again

I just looked at the setup on your site. Part of the reason that the "normal" menu assignments, and indeed the *chameleon* rules dealing with menu assignment are not working is because the menus that you are trying to assign to are *menu aliases*. This means that Joomla cannot actually detect when these are clicked on. That is, if the menu item you are linking to (the "real" menu item) has Itemid=10, and you have an alias to it from another menu item, then that other menu item will also link to Itemid=10 even though this menu alias in itself may have an Itemid of 11. Then, after you have clicked on it, you're on Itemid 10, and Joomla has no idea that you got there by clicking on a link that was an alias. You have truly arrived on "the real thing".

This suggests that you may need to link things to the main menu item instead of the alias. Now, using the standard Joomla template assignment system isn't going to work in your case, since you're trying to assign (e.g.) the Profile page but at the same time only allow that for iPhone. Therefore one hopes that Chameleon can do that part of it for you.

However, the system is even more tangled that I thought. There are aliases upon aliases, and also strange redirections going on that appear to be a combination of MoJoom (which works in very mysterious ways), JomSocial, and the standard template assignment system.

Anyway, I managed to get things half working by editing your 1st Chameleon rule to include the menu items "XXXXXX || XXXXXXXX" and "My Profile" since those are the original items.

The template looks a bit awful... but that's up to you to work on!

However it breaks when I try to click on "Change Profile Picture". The link has an Itemid of 273, URL index.php?option=com_community&view=profile&task=uploadAvatar&Itemid=273 (which should equate to "My Profile" which I had assigned in Chameleon), but some strange redirect goes on and it ends up on the page index.php?option=com_mojoom&view=mojoom&Itemid=628 which is a completely different Itemid... and one which should not even exist since there's no menu item with an id of 628! So I really don't know what's going on there. I guess we could get Chameleon to trap that particular URL, but it would be better to understand what's actually going on behind the scenes.

So I made another rule to trap Itemid=628 and that partly works... except that now the link to change the profile picture ends up on a page that doesn't actually edit the profile picture.

It looks like somewhere in here there's a system that is trying to override both the functionality AND the template at the same time. So simply assigning templates to menu items is doomed to fail.

I'd advise you to start afresh on this and do something like find a standard template that's customised for iPhone and can be assigned to menu items in the normal way, or assigned via Chameleon so that you can be more specific about when it can be used. MoJoom does not seem to be suitable for this as it's more than just a template.

Cheers,
Stephen

Edited By: metamodguy
18-Apr-12 02:37:14

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
3328 Posts
User info in posts
Administrator has disabled public posting

Board Info

Board Stats:
 
Total Topics:
1679
Total Polls:
6
Total Posts:
5933
Posts this week:
3
User Info:
 
Total Users:
4386
Newest User:
verlywl7
Members Online:
1
Guests Online:
586

Online: 
verlywl7

Forum Legend:

 Topic
 New
 Locked
 Sticky
 Active
 New/Active
 New/Locked
 New Sticky
 Locked/Active
 Active/Sticky
 Sticky/Locked
 Sticky/Active/Locked