Template parameter menu Joomla 2.5 - joomla

I try to make a template with options available in the backend, I took the doc about options and I could see that there is a setting that lists the available menu and choose the one you wishes to appear at a specific position (off position statement via modules).
Parameter in templateDetails.xml (from the doc> http://docs.joomla.org/Menu_form_field_type):
TemplateDetails.xml
<field name="mymenu" type="menu"
default="mainmenu" label="Select a menu"
description="Select a menu" />
index.php
<?php // no direct access
defined( '_JEXEC' ) or die( 'Restricted access' );
$mymenu = $this->params->get("mymenu");
?>
...
<?php echo $mymenu; ?>
So I though the list of recorded menus, selecting and saving is possible, no worries on that side.
My problem is I do not understand how to display the selected menu in index.php of my template. I can retrieve the name of this menu, but how to display it?
Thanks

You need to define a module position (example: menu) in TemplateDetails.xml. In your template, place this line of code where you want it to be shown:
<jdoc:include type="modules" name="menu" />
And finally, in the backend, define main_menu in the "menu" position.

Related

In which file Joomla 3.x generating the "edit article" links for authors Front End?

If you are allowed to edit the articles in Joomla, near the each article in the list, an "edit" button is present. How can I find, how that "edit" button generated? I just want to add some parameters. (I'm using a Front End for edit.)
It's in components/com_content/views/article/tmpl/default.php
<?php if ($canEdit) : ?>
<li class="edit-icon"> <?php echo JHtml::_('icon.edit', $this->item, $params); ?> </li>
<?php endif; ?>
You can override this in your template's html folder.
This script calls a function under components/com_content/helpers/icon.php to generate the icon.
You should not override this helper file. If you need to change what that function is doing, filter the content it generates after it has been run, whether via a plug-in or the default.php file.

Changing the position of Joomla 3.2 tags

I have added some tags and linked these to an article. On the front end the tags appear on top (i.e. before) the article text. Instead I would like to display them at the bottom (i.e. after) the article.
I assume I have to make an override of layouts/joomla/content/tags.php
Create a Template Override for the following file:
components/com_content/views/tmpl/default.php
Once done, open this file in your override location and go to line 157 and you will see the following:
<?php if ($params->get('show_tags', 1) && !empty($this->item->tags)) : ?>
<?php $this->item->tagLayout = new JLayoutFile('joomla.content.tags'); ?>
<?php echo $this->item->tagLayout->render($this->item->tags->itemTags); ?>
<?php endif; ?>
Move this section of code somewhere futher down in the file to suit your needs
Hope this helps
This can be easily achieved by simply changing the Position Of Article Info to "Below" in Options Tab in Joomla Menu. The Joomla menu has to be of Type "Article"
No need to create any override.
Hope this helps.
See attached screenshot.

How to remove data from header menu and add new content to it in Magento

I am working with magento.
I have been trying to remove the content from header-menu and add fresh content like
**HOME ABOUTUS SITES CONTACT**
Here is the current situation,
Update
Above is the screen shot that follows after the top-menu
Please guide me to achieve this..
Thank you.
I assume the above menutimes that you've shown in the image are categories. So if you don't need it on the top menu then go to each of the categories (under Catalog -> Manage Categories) in the backend / admin panel and choose "NO" as an value to the option "Include in Navigation Menu". This will remove them from the navigation top menu.
And to bring these menu items
HOME ABOUTUS SITES
Let me describe it for one of the items above. Lets take About Us
At first create the respective CMS static block for "About Us"
Create a category called "About Us"
Go to display settings of the About Us category and choose the display mode as "static block only" and then select the static block "about us"
Save the category and reload your page on the frontend/website
you can find the "about us" category on the top menu and opening it will show the content from the static block.
Repeat the same for the other menu items.
If this helps mark it as answer. Thanks.
I think you didn't want categories in top menu. In place of it you want Custom links like "Home", "About us" etc.
For this open topmenu.phtml file in template->page->html.
In this commented the below line :-
<?php echo $_menu ?>
and in place of it call a static block of name "custom_top_nav" :-
<?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('custom_top_nav')->toHtml() ?>
In this block you can make your custom menu.
We you want both custom links plus categories then you can replace code with this:-
<?php $_menu = $this->getHtml('level-top') ?>
<?php if($_menu): ?>
<div class="nav-container">
<ul id="nav">
<li class="home"> HOME </li>
<?php echo $_menu ?>
</ul>
</div>
<?php endif ?>
Magento hide categories in the header menu - This can be done from your Admin Panel under Manage Categories > To do this is easy if you don't want your categories in top menu of your web site - When you add a new Category Select no for > Include in Navigation Menu * Its under Meta Description at the bottom of the page where you add the the Category name in General Information Tab*

Joomla Change Modules in Sidebar on diffrent Pages

I'm using Joomla 2.5.7 and want to ask, how I can change a bunch of modules in sidebar, when I change to another Page. An example to clarify my question:
I have 3 Links at the navigation bar:
Events
Shop
Blog
and a Homepage as index.html (logical).
Now, I want display in Events the modules "Where to go" and "About Location" in the sidebar.
In Shop I want to display the modules "About Dealer", "Shipping" and "Images" in the sidebar without the modules "Where to go" and "About location".
In Blog I want to display the module "About Author" in sidebar without the modules above (Where to go, about location...).
So, I know I can do this (or similar):
<?php if ($this->countModules('sidebar-a and sidebar-b and sidebar-c')): ?>
<jdoc:include type="modules" name="sidebar-a" />
<jdoc:include type="modules" name="sidebar-b" />
<jdoc:include type="modules" name="sidebar-c" />
<?php endif; ?>
SIDEBAR-A: "Where to go" and "About Location"
SIDEBAR-B: "About Dealer", "Shipping" and "Images"
SIDEBAR-C: "About Author"
But that is not my plan!
I want just the position "sidebar-a" and that the modules getting hidden (like in countModules) if they are not for this page.
I see this method on the granty framework:
<?php /** Begin Main Body **/ ?>
<?php echo $gantry->displayMainbody
'mainbody','sidebar','standard','standard','standard','standard','standard'); ?>
<?php /** End Main Body **/ ?>
You see just simple code, but with other variables.
So very easy in the index.html but this won't work If I do copy and paste ;)(logical)
I don't know how to do it. I do not prefer to get this framework, just for this single sidebar. But there must be a way like this granty framework, but I can't understand the code very well...I'm just an amateur on php. I guess there must be a JavaScript file, which hide and display this diffrent modules.
You can see a live demo here of the single sidebar with lots of modules, which getting hidden and displayed on each page: http://app.ohanah.com/demo-v2/rt/index.php
Have someone an idea how to run this sidebar?
Thanks for reading and helping!
In the Joomla backend, go to the Module Manager, open the module you want to change, and in the bottom left, you can assign the module to specific pages. This should be what you're looking for and it will save you having to hard code it.
You can , for better handling, use the Module Everywhere extension , look for it in JED.
It helps you a lot assigning modules not only to menulinks, but even to articles.

Joomla 1.7 modules - What am I missing?

I am trying to work through building a template in Joomla and seem to be missing a fundamental logic here on how modules work. I have read the wiki and several tutorials which all speak of earlier versions than 1.7 so havent helped much.
Basically I have created two menus:
"Main Menu" menu type mainmenu
"Sub Menu" menu type submenu
When I go into Module Manager though, I see both menus as follows:
"Main Menu" type: Menu
"Sub Menu" type: Menu
So in my index.php the only way I can get the menu to display is with the following:
<jdoc:include type="module" name="menu" title="Main Menu"/>
<jdoc:include type="module" name="menu" title="Sub Menu"/>
if I try setting name="mainmenu" or name="submenu" they simply dont display. This basically just shows two copies of the same menu (the one set to "home" I think).
I am missing something here and I dont know what. Isnt the title suppose to tell Joomla which to display here?
I have tried setting their positions in the module manager, then wrapping them in divs with the same id as the position, that didnt change anything either. Im lost...
Could someone please explain how I am suppose to display these menus?
Any help is greatly appreciated!
You need to use module positions.
<jdoc:include type="modules" name="mainmenu-position" />
<jdoc:include type="modules" name="submenu-position" />
or you can load both menu modules into one single position
<jdoc:include type="modules" name="menus" />
Important thing is to assing the modules to the positions they get displayed in (backend).
There is only one type of menu module in Joomla, not separate module types for mainmenu and submenu.
You mention that you have two modules of type "menu" in the Module Manager.
Open them up and take a look at the paramaters under "Basic Options". Set your Main Menu 'start level' to 1 and 'end level' to 2, and set your Submenu 'start level' to 2 and 'end level' to 'all'.
That should do the trick.

Resources