[SOLVED] add post parameter to menu item

  • Posts: 73
  • Thank you received: 1
11 years 8 months ago #93770

Hello again :)

I want to add an extra parameter to the menu item URL to get a different/custom view for a certain product. I got everything set up, I just need to add the parameter to the url. I'm using the product page menu type. According to Joomla MVC I have to use an XML file to add certain fields which will be visible in the admin back-end area.

What I want to do is add a dropdown in the admin back-end where I can select 3 different values (arbitrary) which are then added to the URL and are then parsed by the show.php file to get the right view.

Currently I have this, but the parameter is not added (show.xml)

<?xml version="1.0" encoding="utf-8"?>
<metadata>
    <state>
        <name>Product page</name>
        <params addpath="/components/com_hikashop/params">
            <param name="product_id" type="selectproduct" default="0" label="Select a product" description="Select here the product to display for the current link" />
        </params>
    </state>
    <layout title="COM_HIKASHOP_PRODUCT_FORM_VIEW_DEFAULT_TITLE">
        <message></message>
    </layout>
    <fields name="params" addfieldpath="/components/com_hikashop/fields">
        <fieldset name="basic" label="Select a product">
            <field
                id="product_id"
                name="product_id"
                type="selectproduct"
                label="Select a product"
                description="Select here the product to display for the current link"
								/>
            
            <fieldset name="request">
                <field
                    name="viewType"
                    type="list"
                    label="Type of Product"
                    description="Select the type of product to grab the correct template"
                    default="1"
                >
                    <option value="1">Brace</option>
                    <option value="2">Shoe</option>
                    <option value="3">misc</option>
                </field>
            </fieldset>
        </fieldset>
        
    </fields>

</metadata>

Last edit: 11 years 8 months ago by Ortix.

Please Log in or Create an account to join the conversation.

  • Posts: 73
  • Thank you received: 1
11 years 8 months ago #93774

solved it:

<?xml version="1.0" encoding="utf-8"?>
<metadata>
    <state>
        <name>Product page</name>
        <params addpath="/components/com_hikashop/params">
            <param name="product_id" type="selectproduct" default="0" label="Select a product" description="Select here the product to display for the current link" />
        </params>
    </state>
    <layout title="COM_HIKASHOP_PRODUCT_FORM_VIEW_DEFAULT_TITLE">
        <message></message>
    </layout>
<fields name="params" addfieldpath="/components/com_hikashop/fields">
    <fieldset name="basic" label="Select a product">
        <field
            id="product_id"
            name="product_id"
            type="selectproduct"
            label="Select a product"
            description="Select here the product to display for the current link"
                            />
        <field
            name="viewType"
            type="list"
            label="Type of Product"
            description="Select the type of product to grab the correct template"
            default="2"
        >
            <option value="1">Brace</option>
            <option value="2">Shoe</option>
            <option value="3">misc</option>
        </field>
    </fieldset>
</fields>

</metadata>

Please Log in or Create an account to join the conversation.

Time to create page: 0.052 seconds
Powered by Kunena Forum