2

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

Tomaw
  • 165
  • 3
  • 5
  • 17

1 Answers1

3

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.

Arnaud
  • 412
  • 6
  • 12
  • Hello Arnaud, Firstly thank you for your help. In fact I don't want to declare a new position, but directly from the management template to display a predefined menu via template parameters. I don't want that the user is going to change the position of the module, but it appears based on his choice of the parameter template. Thanks – Tomaw Apr 16 '12 at 11:54