Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Menu Parameters - URL or Database?
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  8 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Jedimark  
View profile  
 More options Aug 21 2012, 4:39 am
From: Jedimark <jedim...@gmail.com>
Date: Tue, 21 Aug 2012 01:39:51 -0700 (PDT)
Local: Tues, Aug 21 2012 4:39 am
Subject: Menu Parameters - URL or Database?

Hi,

I am working with Menu Parameters for the first time and I need a little
bit of help.

From what I have figured out so far I can define menu parameters which are
either appended to the URL or saved in the 'params' field in the database.

So I get either:
index.php?option=com_mycomponent&view=default&id=2&theme=green

Or:
{"id":"2","theme":"green","menu-anchor_title":"","menu-anchor_css":"","menu _image":"","menu_text":1,"page_title":"","show_page_heading":0,"page_headin g":"","pageclass_sfx":"","menu-meta_description":"","menu-meta_keywords":"" ,"robots":"","secure":0}

What I would really like is for the ID parameter to be appended to the URL
and for the THEME parameter to be stored in the database. But I'm not sure
how to split them like this.

This is my default.xml file:

<?xml version="1.0" encoding="utf-8"?>

<metadata>

 <layout title="SL_COMP_MENU_ITEM_TYPE">

  <message>

   <![CDATA[SL_COMP_MENU_ITEM_TYPE_DESC]]>

  </message>

 </layout>

 <fields name="request">

  <fieldset name="request"
addfieldpath="/administrator/components/com_mycomponent/models/fields">

   <field name="id" type="modal_comp" label="SL_CO_SELECT" required="true"
/>

   <field name="theme" type="list" label="SL_SELECT_THEME" required="true">

    <option value="green">Green</option>

    <option value="blue">Blue</option>

    <option value="red">Red</option>

   </field>

  </fieldset>

 </fields>

</metadata>

My changing <fields name="request"> to <fields name="params"> I get ID and
THEME stored in the 'params' but like I said, I'd like ID to be in the URL
and THEME to be in the database. Hope I've made sense!!

Many thanks,

Mark


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
b2z  
View profile  
 More options Aug 21 2012, 10:46 am
From: b2z <bzzj...@gmail.com>
Date: Tue, 21 Aug 2012 07:46:49 -0700 (PDT)
Local: Tues, Aug 21 2012 10:46 am
Subject: Re: Menu Parameters - URL or Database?

Hi!

Just create separate fieldset, name it "params" and move there everything
except ID.

Best regards,
Dmitry.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jedimark  
View profile   Translate to Translated (View Original)
 More options Aug 21 2012, 11:14 am
From: Jedimark <jedim...@gmail.com>
Date: Tue, 21 Aug 2012 08:14:34 -0700 (PDT)
Local: Tues, Aug 21 2012 11:14 am
Subject: Re: Menu Parameters - URL or Database?

Thanks for the reply Dmitry,

So simple!

Is it possible, however, to have all the options contained within the same
page slider. I note creating a separate fieldset also creates a new slider.

Thanks,

Mark


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
elin  
View profile   Translate to Translated (View Original)
 More options Aug 21 2012, 12:52 pm
From: elin <elin.war...@gmail.com>
Date: Tue, 21 Aug 2012 09:52:29 -0700 (PDT)
Local: Tues, Aug 21 2012 12:52 pm
Subject: Re: Menu Parameters - URL or Database?

You really don't want to have things that are part of the request in the
request slider.

You can assign any template style to any menu item so it's best to do it
that way  rather than adding the individual parameters to manage the
template. Why not make your color list correspond to template styles?

Elin


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
elin  
View profile  
 More options Aug 21 2012, 2:31 pm
From: elin <elin.war...@gmail.com>
Date: Tue, 21 Aug 2012 11:31:19 -0700 (PDT)
Local: Tues, Aug 21 2012 2:31 pm
Subject: Re: Menu Parameters - URL or Database?

I mean NOT part of the request. :P  

Ellin


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jedimark  
View profile  
 More options Aug 23 2012, 2:09 pm
From: Jedimark <jedim...@gmail.com>
Date: Thu, 23 Aug 2012 11:09:53 -0700 (PDT)
Local: Thurs, Aug 23 2012 2:09 pm
Subject: Re: Menu Parameters - URL or Database?

Thank you Ellin.

I have another question - this time concerning Component-wide default
parameters.
I create this parameter on a new install by adding the following in my
components Manifest file:

 <config>
  <fields name="params">
          <fieldset name="" description="">
    <field name="test" default="hello" />
          </fieldset>
  </fields>
 </config>

This puts {"test":"hello"} into jos_extensions and that's great.

However I also want this parameter to be inserted for upgrades to the
component. At the moment all I have is {} in the table.
Will I have to run a script on upgrade to check for this or is there a
better way?

Thanks,

Mark


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Rouven Weßling  
View profile  
 More options Aug 23 2012, 2:47 pm
From: Rouven Weßling <m...@rouvenwessling.de>
Date: Thu, 23 Aug 2012 20:47:56 +0200
Local: Thurs, Aug 23 2012 2:47 pm
Subject: Re: [jgen] Menu Parameters - URL or Database?

On 23.08.2012, at 20:09, Jedimark <jedim...@gmail.com> wrote:

> Will I have to run a script on upgrade to check for this or is there a better way?

The way we employ in the core is that we supply the default value when get the param (second argument of the get method). This way we a also have a failsafe when something goes wrong in the database.

Rouven

  smime.p7s
6K Download

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jedimark  
View profile   Translate to Translated (View Original)
 More options Aug 23 2012, 2:55 pm
From: Jedimark <jedim...@gmail.com>
Date: Thu, 23 Aug 2012 11:55:12 -0700 (PDT)
Local: Thurs, Aug 23 2012 2:55 pm
Subject: Re: [jgen] Menu Parameters - URL or Database?

Thanks Rouven - I wasn't aware of the second argument of get.

Mark


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions Older topic »