1. How to invoke a module from a component's view?
ANSWER:
引用
jimport('joomla.application.module.helper');
$module = JModuleHelper::getModule('modulename');
echo JModuleHelper::renderModule($module);
But if you want more control of the output, then take a look at the code that parses the {loadmodule ...} syntax.
This is located in the content plugin loadmodule in the file plugins\content\loadmodule.php
2. Layout of Home different from other pages...
Hello I would like to have a template pra Home Site, and when he clicked on any item change the layout ... all internal pages would have a layout and Home Another would:
Explain better the image below, Thanks
Actually, think the other way around. The HOME has one layout, ALL THE REST have a different one.
if using a separate template, this is the way you do it:
This is acomplished by adding a separate template to your installation, configuring it the way you want, then assigning that template to ALL menu link items, EXCEPT HOME. You do this thru Admin>>Template Manager and open the #2 template and assign it to all menu items, except home. Hold the CTRL key down to select multiple items.
If you intend to use the same template exactly, but just re-arranged differently, you will have to do it this way:
From what you presented, it appears that there are only two modules involved, main menu and #2 menu.
ANSWER:
引用
1) First create the site with main menu as is.
2) Duplicate the main menu in the module manager (even if you will change the link items).
Now you have the two menus in separate modules.
3) On the template/index.php page, create a placeholder position above the content.
4) Assign the #2 menu to that physical location.
You now have two menus displayed on the index.php page.
5) Open the main menu module and at the bottom, select NONE, then SELECT, and highlight the HOME menu link item. This says: show me only when the home button is active/clicked.
6) Opent the #2 menu and at the bottom, select NONE, then SELECT, and select all but HOME while holding down the CTRL key. This says: show me all the time EXCEPT when the home button is active/clicked.
7) Configure the menu link items in menu #2 as desired.