Dynamic Values in <Params> in component.xml [J1.0]
Posted: Fri Mar 07, 2008 9:43 pm
Is there any way to dynamically set the values in the Parameters section of a menu item? Specifically, I'd like to populate a select field with options pulled through from a db.
For example, I have the following in my component.xml
I need to replace these with values selected from one of the component's dbs, so that it becomes something like:
for each value found. Is there any way to tell Joomla to update the relevant xml values while parsing?
My current workaround is to use a url link with the $id value added by hand, but this is not very flexible, or convenient for the content managers. Fortunately, it's not a value that will change very often, but I'd prefer a more elegant approach.
For example, I have the following in my component.xml
Code: Select all
<params>
<param name="category" type="list" default = "0" label="Display Category" description="Test">
<option value="0">First</option>
<option value="1">Second</option>
<option value="2">Third</option>
</param>
Code: Select all
<option value="<?php echo $id; ?>"><?php echo $name; ?></option>
My current workaround is to use a url link with the $id value added by hand, but this is not very flexible, or convenient for the content managers. Fortunately, it's not a value that will change very often, but I'd prefer a more elegant approach.