Joomla,为特定视图添加任务参数

时间:2013-01-15 08:51:38

标签: xml view joomla task

我尝试添加url参数task =所有车辆,但是在创建了此视图的菜单链接后,任务参数仍然不存在

<?xml version="1.0" encoding="utf-8"?>
<metadata>
    <layout title="Multiple Categories">
        <message><![CDATA[Displays a selected categories of an application]]></message>
    </layout>

    <fields name="params">
        <fieldset name="params" addfieldpath="/administrator/components/com_vehiclemanager/elements" label="Params">
            <field name="categorylayout" type="categorylayout" default="1" class="inputbox" label="Select layout" multiple ="false" size="1" description="Choose a layout" required="false" />
            <field name="back_button" type="list" label="Back Button" required="false" description="Show/Hide a Back Button" >
                <option value="">Use Global</option>
                <option value="0">Hide</option>
                <option value="1">Show</option>
            </field>
            <field name="single_category" type="category" default="1" class="inputbox" label="Category" multiple ="true" size="1" description="Choose a vehicle Categories" required="true" />
        </fieldset>
    </fields>
    <url>
        <param name="task" value="all_vehicles" ></param>
    </url>
</metadata>

1 个答案:

答案 0 :(得分:4)

你可以试试这个 -

<!-- Add fields to the request variables for the layout. -->
<fields name="request">
    <fieldset name="request">    
        <field name="task" type="hidden"
            label=""
            required=""
            description=""
            default="all_vehicles"
        />
    </fieldset>
</fields>