Hi all,
I'm creating a custom component in J!2.5.1 and when creating a new menu item link to my component I'd like to add the value from my custom options to the menu item link!
Currently I'm pulling the required data from the params when the view loads. However, this works fine, but I'd also like to add the 'task' paramter to the URL; and if I can do that I'd like to add my other option values as well.
Currently, when creating a menu item link to my component the link field looks like this:
Code:
index.php?option=com_roleprofiler&view=profiler&layout=assessmenthome
I'd like to add the option value from my option dropdown and a task (which would be a static value) as well so this link field looks like this:
Code:
index.php?option=com_roleprofiler&view=profiler&layout=assessmenthome&task=xxx&id=#
The view's XML file looks like this so far:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<metadata>
<layout title="COM_ROLEPROFILER_PROFILER_VIEW_SELECTDEPARTMENT_TITLE" option="COM_ROLEPROFILER_PROFILER_VIEW_SELECTDEPARTMENT_OPTION">
<message>
<![CDATA[COM_ROLEPROFILER_PROFILER_VIEW_SELECTDEPARTMENT_DESC]]>
</message>
</layout>
<!-- Add fields to the parameters object for the layout. -->
<fields name="params">
<!-- Basic options. -->
<fieldset name="basic" label="Basic Options">
<field name="id" type="sql" label="Assessment" query="SELECT id AS id, title AS title FROM #__roleprofiler_assessments" key_field="id" value_field="title" description="Please select which assessment you are linking this menui item too." message="Message goes here!" required="true">
<option value="">Select</option>
</field>
</fieldset>
</fields>
</metadata>
Is it a matter of adding further fields to this XML document to force these extra parameters to the link field? If not, could somebody please explain?
Thanks for reading,
Kris...