For what it's worth, I've followed the suggested steps from Prasit in the Helloworld MVC tutorial (step 18) and it works fine. I didn't do any parameter merging, just set these params separately to any component parameters. I will add a new (19) step to the doco soon as an Example of using parameters (and stylesheets). Here are the snippets of code used.
Model - updhelloworld.php (just the getitem function)
function &getItem()
{
if (!isset($this->_item))
{
$cache = JFactory::getCache('com_helloworld', '');
$id = $this->getState('
helloworld.id');
$this->_item = $cache->get($id);
if ($this->_item === false) {
// Menu parameters
$menuitemid = JRequest::getInt( 'Itemid' ); // this returns the menu id number so you can reference parameters
$menu = JSite::getMenu();
if ($menuitemid) {
$menuparams = $menu->getParams( $menuitemid );
$headingtxtcolor = $menuparams->get('headingtxtcolor'); // This shows how to get an individual parameter for use
$headingbgcolor = $menuparams->get('headingbgcolor'); // This shows how to get an individual parameter for use
}
$this->setState('menuparams', $menuparams); // this sets the parameter values to the state for later use
}
}
return $this->_item;
}
View - view.html.php (in the display function) just add
$this->state = $this->get('State');
View - default.php
// get the menu parameters for use
$menuparams = $this->state->get("menuparams");
$headingtxtcolor = $menuparams->get("headingtxtcolor");
$headingbgcolor = $menuparams->get("headingbgcolor");
and then use the above variables in some way...
<h2 style="color:<?php echo $headingtxtcolor; ?>; background-color:<?php echo $headingbgcolor; ?>;">Update the Hello World greeting</h2>
View - default.xml (define the parameters)
<fields name="params">
<fieldset name="request">
<field name="headingtxtcolor" type="text" default="#ff0000" size="40"
label="COM_HELLOWORLD_UPDHELLOWORLD_FIELD_HEADINGTXTCOLOR_LABEL"
description="COM_HELLOWORLD_UPDHELLOWORLD_FIELD_HEADINGTXTCOLOR_DESC" />
<field name="headingbgcolor" type="text" default="#0000ff" size="40"
label="COM_HELLOWORLD_UPDHELLOWORLD_FIELD_HEADINGBGCOLOR_LABEL"
description="COM_HELLOWORLD_UPDHELLOWORLD_FIELD_HEADINGBGCOLOR_DESC" />
</fieldset>
</fields>
Works like a charm. Hope this helps. Cheers.