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.

 

content_genius odd behaviour

content_genius odd behaviour

I have this rule set up on my meta template

if ( $content_genius->check("section_id = 11") ) return true;

the multi select boxes for sections didn't work so I used the content_genius instead.

works fine except for on this page

http://www.thesmilelounge.org.uk/Team-E … ffort.html

which is in section id 3 category id 6


I have no other rules in place and im running the latest build of metamodpro metatemplatepro and sh404sef.

I can't find any other pages on the site that behave like this except the pages in section id 11, which is fine.

I'm totally perplexed, would it be easier just to set up another rule in the chain to make that specific page load the desired template?

Thanks for your help in advance, as ever great product, great support.

lordbarron
Guest
useravatar
Offline
Administrator has disabled public posting

Re: content_genius odd behaviour

Hi lordbarron,

can you double check that you have MetaTemplatePro 1.5c installed? 1.5 and 1.5b had some problems in the section detection which I am pretty sure are fixed in 1.5c.

Then, in MTP, set up a new rule that has this in the PHP box. It may play havoc with your page design (temporarily) but is one of the few ways to get debug output:

echo "section id: " . $content_genius->info("sectionid");

Then look at that page again. Does it give a valid section id? Is it the one you were expecting?

I'm also perplexed that the section/category select box isn't working for you. Is it just for this particular page that it isn't working? Or for all pages?

Hope that helps,
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

Re: content_genius odd behaviour

Argh damn I had 1.5b installed not 1.5c

The section/category manager still doesn't want to play ball.

when I do an echo for the section ID i just get returned:

Code:

section id:

no actual ID is returned. This applies to all pages. and it doesn't show up in the source, although it gets parsed before the doctype

Code:

section id: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

is that normal?

Thanks again, the updated mtp worked a charm with jom_genius code. Which is really handy and will save everyone loads of time. Good stuff. Bring it to the core!

lordbarron
Guest
useravatar
Offline
Administrator has disabled public posting

Re: content_genius odd behaviour

Oh, that's really annoying... I had a typo in the PHP above :-(  Still getting used to my own code.

Try this:

echo "section id: " . $content_genius->info("section_id");

(sectionid vs. section_id)

Does that work any better? Yes, the "echo" output will appear before the doctype. That's because MetaTemplate works very early in Joomla, before the template is chosen (obviously), so it comes before the doctype and anything else that appears in the template.

Sorry bout that,
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

Re: content_genius odd behaviour

no need to apologise you do great work.

This worked well and did return the expected ids for each section. And now I have this working nicely. Thank you.

The template is suceeding on a seciton id 3 when it is set to 11 as per:

Code:

if ( $content_genius->check("section_id = 11")) return true;

This is very stange. I tried adding:

Code:

echo "section id: " . $content_genius->info("section_id"); 

if ( $content_genius->check("section_id = 11")) return true;
if ( $content_genius->check("section_id = 3")) return false;

But this did not override the problem.

This is not normal right?

Thanks again.

lordbarron
Guest
useravatar
Offline
Administrator has disabled public posting

Re: content_genius odd behaviour

With your override, you should put the check for "3" before the one for "11", so that the 3 gets caught first.

However that doesn't explain why this thing is failing in the first place...

Any chance I can log in to your site and check it out? (I would need an admin account, if you PM me the details). There's so much strange stuff going on that I can't quite believe it's MTP causing it all.

Cheers,
Stephen

ps. your e-mail address doesn't seem to be working. Do you have a new one?

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: content_genius odd behaviour

I found the problem :-)

The reason why the http://www.thesmilelounge.org.uk/Team-E … ffort.html page was using the alternative template was simply because you had allocated that template to that menu item using the normal Joomla template allocation. (i.e. not via MetaTemplate Pro).

This is actually indicated when you edit a MetaTemplate rule. In the "Available Templates" table, in the right column, this shows you all the menu items that that template has been assigned to using the normal template manager. In this case it says "A Team Effort".

So all you have to do is go into the normal template manager and set "yoo_practitioners" back to "none", then leave it all up to MetaTemplate Pro to organise.

There were a couple of other things as well:

- in the rule you were using for detecting logged-in users, you had the following rule:

if MM_LOGGED_IN return true;

This was wrong on 2 counts: (1) you need brackets around the MM_LOGGED_IN (so this was causing an error that wasn't being reported), and (2) you don't need to use PHP for this - just use the radio button on "groups" to set "All Logged In".

So I fixed this, and now all logged-in users get the new template.

Once the "A Team Effort" thing is sorted out (you need to remove that using the normal template manager), then you'll find that the section/category chooser is actually working correctly. I removed the content_genius code from the PHP and just used the selector box to select "Practitioners [section]", and now it's working perfectly.

Best regards,
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

Re: content_genius odd behaviour

Thank you very much. I have no recollection of making the change in the menu so it never occurred to me that was where I fluffed up. And yes now all the select boxes work! Brilliant. I've only gone and broke the whole site by updating the sh404sef component :s

Thank you again, your a star!

lordbarron
Guest
useravatar
Offline
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:
196

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