-
AuthorPosts
-
March 19, 2007 at 10:37 pm #119246
Is there any way to only have the main menu appear on the front page? ie main menu on front page andutilize only top menu on subpages?
bernhar Friendbernhar
- Join date:
- July 2006
- Posts:
- 214
- Downloads:
- 0
- Uploads:
- 1
- Thanks:
- 3
- Thanked:
- 3 times in 1 posts
March 20, 2007 at 7:49 am #216146Hi snepple,
you have to modify the source code to achieve this. Look at the pathway and how it is done to exclude it on the frontpage and you will get the idea.
Bernhard
ErikThorsen FriendErikThorsen
- Join date:
- December 2005
- Posts:
- 1098
- Downloads:
- 0
- Uploads:
- 7
- Thanks:
- 22
- Thanked:
- 10 times in 1 posts
March 20, 2007 at 10:35 am #216157Under Modules you can choose which pages the main menu should be visible on. ( parameter ) You can from there choose the number of pages you want it visible on.
March 20, 2007 at 1:21 pm #216168<em>@bernhar 10322 wrote:</em><blockquote>Hi snepple,
you have to modify the source code to achieve this. Look at the pathway and how it is done to exclude it on the frontpage and you will get the idea.
Bernhard</blockquote>
Serious with this answer?
Snepple i know exactly what your talking about. I’ll see if I can clarify it so as to avoid these type answers in the future.
If one was to unpublish ALL of the mod_mainmenu modules, Main Menu would still appear published to the left of the ja_header. Changing the locations where it publishes to doesn’t seem to affect Main Menu either.
I have set mine to unpublished and display “none”, yet its still there.Its like a persistant menu. The question still remains “How to set this Main Menu to only appear on the FrontPage and remove its persistant nature?”
<!-- BEGIN: MAIN NAVIGATION -->
<div id="ja-mainnav"<?php echo $bottomborder;?>>
<?php
switch ($ja_menutype) {
case 1: echo $topnav;
break;
case 2:
include($ja_template_absolute_path."/ja_cssmenu.php");
break;
case 3:
include($ja_template_absolute_path."/ja_transmenu.php");
break;
case 4:
echo $topnav;
break;
}
?>
</div>
<!-- END: MAIN NAVIGATION -->Removing that div tag effects that particular area and subsequent menu, but I couldn’t explain the functioning of it.
I’d just like to add that “Getting the idea” does nothing to help answer the question. Any one of us could be starring @ the bloody thing for 2 hours and/or never get the idea. So please refrain from feeling compelled to answer a question when you’re not prepared to give the full answer. >:(
bernhar Friendbernhar
- Join date:
- July 2006
- Posts:
- 214
- Downloads:
- 0
- Uploads:
- 1
- Thanks:
- 3
- Thanked:
- 3 times in 1 posts
March 20, 2007 at 10:26 pm #216190@filter2k
I am really sorry for having not been helpful with my last post. Let´s try again.
@all
One of the features of Antares is that the main menu is hardcoded as pointed out correctly. Therefore it is not published in one of joomla´s module positions.
And therefore it cannot be published/ unpublished by joomla´s settings. (Erik is wrong here!)
My proposal has been to look at how the pathway is handled in this template.Here is the code:
<?php if (strtolower($option) != 'com_frontpage'){ ?><div id="ja-pathway">
<?php mosPathway(); ?>
</div>
<?php } ?>You can see that the pathway is wrapped in a conditional statement, that excludes it on the frontpage. This is where I thought one could get the idea. What about wrapping the main menu in such a condition.
<?php if (strtolower($option) = 'com_frontpage'){ ?>
Put here anything that should only appear on the frontpage!
In your case the main menu code you gave above.
<?php } ?>I didn´t try it myself but this should make the main menu appear only on the frontpage.
Getting the idea?
Another idea would be to connect the main menu to a new module position, in order to make it like a normal module. Is this what you are trying to achieve?Sorry again for my too short hint above but I had been very busy when I wrote it.
Bernhard
March 21, 2007 at 1:46 am #216194Thanks for the help!
Interestingly enough when I tried the code you suggested I get an error upon loading the site: “Parse error: syntax error, unexpected ‘=’ in /home/user/public_html/templates/ja_antares/index.php on line 209” However, I can make the menu only appear on subpages and not the front page using…. “!=”. Any ideas?bernhar Friendbernhar
- Join date:
- July 2006
- Posts:
- 214
- Downloads:
- 0
- Uploads:
- 1
- Thanks:
- 3
- Thanked:
- 3 times in 1 posts
March 21, 2007 at 8:18 am #216208Aaah, sorry again, wrong PHP-syntax! Try == instead of = please and report back. This should work.
The != means unequal while == means equal.March 21, 2007 at 2:18 pm #216234Thanks Bernhar for helping us out. Every little piece def gets sucked in. I’m more the wiser for it. So I thank you whole heartedly for that.
I’ve wrapped your lines of code round the portion that effects the embedded Main Menu. Barring that i’ve done something incorrectly it still remains…embedded. Must be a piece of the puzzle still hidden. I’m going to attack your new module idea.
<!-- BEGIN: MAIN NAVIGATION -->
<?php if (strtolower($option) == 'com_frontpage'){ ?>
<div id="ja-mainnav"<?php echo $bottomborder;?>>
<?php
switch ($ja_menutype) {
case 1: echo $topnav;
break;
case 2:
include($ja_template_absolute_path."/ja_cssmenu.php");
break;
case 3:
include($ja_template_absolute_path."/ja_transmenu.php");
break;
case 4:
echo $topnav;
break;
}
?>
</div>
<?php } ?>
<!-- END: MAIN NAVIGATION -->bernhar Friendbernhar
- Join date:
- July 2006
- Posts:
- 214
- Downloads:
- 0
- Uploads:
- 1
- Thanks:
- 3
- Thanked:
- 3 times in 1 posts
March 21, 2007 at 2:25 pm #216235What do you mean by embedded? Does the menu show on every page?
ErikThorsen FriendErikThorsen
- Join date:
- December 2005
- Posts:
- 1098
- Downloads:
- 0
- Uploads:
- 7
- Thanks:
- 22
- Thanked:
- 10 times in 1 posts
March 21, 2007 at 2:32 pm #216236Sorry for giving bad advice. :p
I just didn’t do the proper research and check which template this was for. Again, sorry about that. Hope you can figure this out still…
March 21, 2007 at 2:41 pm #216237I’ve attempted the new module and was successful, however it would seem that I was able to deliever my Main Menu to the frontpage (== only) but the old persistant menu was still being delivered through out the rest of the site.
Come on Puzzle Pieces.
March 21, 2007 at 2:57 pm #216238How does one change the background color of the three user boxes below the header? I’ve created new modules but cannot figure out how to change the background colors so they match the template online?
March 21, 2007 at 3:07 pm #216240The odd thing is that using != removes the menu from the front page and leaves it on all other pages. So Im not sure why == doesnt work to remove it from all pages but the front page. I am not familiar with php but use we use <?php if (strtolower($option) != ‘com_frontpage’){ ?> , have the script do nothing in the case of if, and then place the menu in an “else”?
bernhar Friendbernhar
- Join date:
- July 2006
- Posts:
- 214
- Downloads:
- 0
- Uploads:
- 1
- Thanks:
- 3
- Thanked:
- 3 times in 1 posts
March 21, 2007 at 3:13 pm #216241@filter2k
Could you be so kind and state again, what you are trying to achieve?1. Do you want the hardcoded/persistant menu but only on some/no/all pages?
2. Do you want a “normal” menu position for this hardcoded menu, in order to set the apperance in joomla backend?
3. Or do you want to delete this hardcoded menu entirely and use a existing module (e.g. right) to publish the main menu in?ErikThorsen FriendErikThorsen
- Join date:
- December 2005
- Posts:
- 1098
- Downloads:
- 0
- Uploads:
- 7
- Thanks:
- 22
- Thanked:
- 10 times in 1 posts
March 21, 2007 at 3:16 pm #216242Ok, gave some bad advice earlier but wouldn’t it be a good solution to remove it from the template ( hard code ) and just add it as a module and make it show on only the front page???
I must say I think this solution of hardcoding the stuff sounds really good and I would love to get my hands on this if you can get it to work as it can have many excellent uses for me. 😮
-
AuthorPosts
This topic contains 23 replies, has 6 voices, and was last updated by qbgraphics 17 years, 7 months ago.
We moved to new unified forum. Please post all new support queries in our New Forum