OK,
and another question more or less in the same direction:
I try to add a link to he main menu using the add menu item dialog. This link supposed to point to the create view of of my component xyz. The problem that I have that this link does say anything about the task my component is supposed to get onto.
example:
The link that looks like that:
index.php?option=com_xyz&view=xyzCreateLandingPage&layout=createLandingpage
what I expexted to see is
inex.php?option=com_xyz&view=xyzCreateLandingPage&layout=createLandingpage&task=createobject
Anyone any idea?
Thanks,
Uwe
How to set $task in new menu items
Moderators: tjay, seadap, Rogue4ngel, matthewhayashida
- uweD
- Joomla! Apprentice
- Posts: 39
- Joined: Mon May 14, 2007 9:38 pm
- Location: Auckland -- New Zealand
- Contact:
How to set $task in new menu items
Last edited by uweD on Wed Sep 12, 2007 1:55 am, edited 1 time in total.
Re: How to set $task in new menu items
uweD wrote:OK,
and another question more or less in the same direction:
I try to add a link to he main menu using the add menu item dialog. This link supposed to point to the create view of of my component xyz. The problem that I have that this link does say anything about the task my component is supposed to get onto.
example:
The link that looks like that:
index.php?option=com_xyz&view=xyzCreateLandingPage&layout=createLandingpage
what I expexted to see is
inex.php?option=com_xyz&view=xyzCreateLandingPage&layout=createLandingpage&task=createobject
Anyone any idea?
Thanks,
Uwe
In your XML file for your component, create a parameters section and include tabs for your parameters. You can then access this using J Menu get instance.
Sample XML file
Code: Select all
<?xml version="1.0" encoding="utf-8"?>
<install type="component" version="1.5.0">
<name>Title</name>
<author>auhtor</author>
<creationDate>date</creationDate>
<copyright>copyright</copyright>
<license>link to license</license>
<authorEmail>email</authorEmail>
<authorUrl>website</authorUrl>
<version>version</version>
<description>description</description>
<params>
<param name="task" type="text" default="0" label="Task link" description="task to perform">
</param>
</params>
</install>
Sample code to get parameter:
Code: Select all
$menu =& JMenu::getInstance();
$item = $menu->getActive();
$params =& $menu->getParams($item->id);
$linksection = $params->get('task',1);
Hope that helps
- uweD
- Joomla! Apprentice
- Posts: 39
- Joined: Mon May 14, 2007 9:38 pm
- Location: Auckland -- New Zealand
- Contact:
Re: How to set $task in new menu items
Sorry for reacting so late, and thanks for your help,
I simply missed that posts
Uwe
I simply missed that posts
Uwe