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.

 

[solved] module only on front page

[solved] module only on front page

i use the component "mosets tree" and i have a problem and I read a lot about it, and still could not read it, I want the module will be displayed only on the front page that happens to be "mosets tree".

the problem is I can not use the $Itemid Because all the pages under the same component, using the same $Itemid, and i cant change the $id only on front page.

for exmple: the front page is: index.php?option=com_mtree&Itemid=30
and all the rest of the page under the mosets tree component useing the same &itemid=30.

I tried to find a unique element, and have not yet found something that differentiates it from other pages in the same component

I would like to hear a solution to the problem.

Edited By: metamodguy
21-Nov-13 20:25:28

swis770
Beginner Modder
ranks
useravatar
Offline
3 Posts
Administrator has disabled public posting

Re: [solved] module only on front page

Hi swis770,

MetaMod can definitely do this; we just need a bit more info about the other pages in order to be able to identify the front page specifically.

Can you please enable MetaMod "advanced debug" mode, and assign the MetaMod to "all" pages?

Then, visit a selection of Mosets Tree pages, and take a note of the output of the MetaMod.

This produces some PHP code that identifies all the URL parameters on the different pages. Sure, the front page looks like it just has the $option and $Itemid, but all the others are going to have things like view/task/page/id etc. The rule that we end up creating will check for option = com_mtree, and will check for the *absence* of those other parameters.

Make sense?

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

Re: [solved] module only on front page

First I thank you for your answer fastest

Yes, I figured it out
But the problem is that if I write the parameters that appear on the home page module is also displayed in all other pages
That all the other pages has the same parameters as homepage

Only the rest of the pages have additional parameters
How do I tell the module to be displayed, just on the home page,  and not like the rest of the pages that have more parameters

For example:
home page:
if (
$option == 'com_mtree'
and $Itemid == '21'
) return XXX; /* replace XXX with the module ID or position to display */
MetaMod debug info:
Module ID: 58
$option: com_mtree
$view:
$id:
$Itemid: 21
Including modules: 53

rest of the pages:
if (
$option == 'com_mtree'
and $Itemid == '21'
and JRequest::getVar('cat_id') == '7'
and JRequest::getVar('task') == 'listcats'
) return XXX; /* replace XXX with the module ID or position to display */
MetaMod debug info:
Module ID: 58
$option: com_mtree
$view:
$id:
$Itemid: 21
Including modules: 53

I hope I explained myself correctly I am new at this

swis770
Beginner Modder
ranks
useravatar
Offline
3 Posts
Administrator has disabled public posting

Re: [solved] module only on front page

Hi swis770,

You're asking exactly the right question smile

The way to get MetaMod to exclude a certain page is like this:

if ($option == "com_mtree"
and JRequest::getVar('task') == '') return XXX;
// replace XXX with the module ID or position to display


So what we're saying is "only show this on mtree pages that DO NOT have a task set". It's an educated guess that the only mtree page without a task set is the home page.

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

Re: [solved] module only on front page

Thank you very much, you helped me a lot..

swis770
Beginner Modder
ranks
useravatar
Offline
3 Posts
Administrator has disabled public posting

Re: [solved] module only on front page

Hi, I have the same question.I want one module only on home page. My site is in joomla1.7 .I have used :

if ($core_genius->check("pagetype = frontpage")) return 86;

Then also it doesn't work  .Plz  give me solution.

tejal2527
Beginner Modder
ranks
useravatar
Offline
3 Posts
Administrator has disabled public posting

Re: [solved] module only on front page

What type is the default menu item on your site? Is it "Featured" / "Frontpage" ? Or have you changed it to a different one?

I suggest that you turn on MetaMod's advanced debug mode and view the front page, then copy and paste the output from MetaMod into this thread. That should help to identify what's going on.

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

Re: [solved] module only on front page

I have used component jshopping as frontpage type.

even i tried after enable metamod's debug option then also it shows com_jshopping in option,in itemid it shows 435 in component's all page, $view and $id shows blank in all pages .

Plz help me for this.
I want the module only in home page.
check this :
http://bugletech.com/clients/idsmenu/index.php

i want the video module only on home page. when i click on any product it shows that module.

PlzPLz  help me.

tejal2527
Beginner Modder
ranks
useravatar
Offline
3 Posts
Administrator has disabled public posting

Re: [solved] module only on front page

After so many trials


finally i have done.

great module!!!!!!!!!!!!!

tejal2527
Beginner Modder
ranks
useravatar
Offline
3 Posts
Administrator has disabled public posting

Re: [solved] module only on front page

Sorry didn't get back to you sooner, glad you got it working. MetaMod debug mode for the win!

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

Board Info

Board Stats:
 
Total Topics:
1679
Total Polls:
6
Total Posts:
5913
Dormant:
User Info:
 
Total Users:
10789
Newest User:
parus6
Members Online:
1
Guests Online:
246

Online: 
parus6

Forum Legend:

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