Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1
  • 2

TOPIC: [HOW TO] ADD & WORK WITH PARAMS

Re: [HOW TO] ADD & WORK WITH PARAMS 13 Feb 2013 15:40 #6733

  • JoomGuy
  • JoomGuy's Avatar
  • Offline
  • Moderator
  • Joomla Enthusiast, Lover of Cooking
  • Posts: 1115
  • Thank you received: 195
  • Karma: 64
Hi @admin,
About your question :
'params' are replaced by 'attribs' in 2.0. It will fix your problem.
Just to clarify, do you mean that the forthcoming release (v2.0) will automatically solve the issue of not being able to 'grab' the params (attribs) in the view?

Many thanks!

Gez

PS I am so damn excited about version 2 :woohoo:
Need help with your Cook/Joomla Project? . PM me to find out what I can help with. NO time wasters please!!!
The administrator has disabled public write access.

[HOW TO] ADD & WORK WITH PARAMS 25 Apr 2014 20:57 #12413

  • rasia
  • rasia's Avatar
  • Offline
  • New Member
  • Posts: 9
  • Karma: 0
Hello,

I can't get component's param in frontend. I set param throught admin menu item (please have a look at the attached picture).



I'm talking about param -> country

<fields name="params" label="COM_MENUS_LINKTYPE_OPTIONS_LABEL"
>
<fieldset name="menu-options"
label="COM_MENUS_LINKTYPE_OPTIONS_LABEL"
>
<field name="country" type="sql" default="0" label="COM_MENUS_ITEM_FIELD_COUNTRY_TITLE_LABEL" query="SELECT concat(c.country, ' (', l.title_native, ')') AS country FROM `#__contacts_countries` as c LEFT JOIN `#__languages` as l ON c.kalba = l.lang_id" />

I need to get this param -> 'country' in frontend. I have tried many ways, but after playing like 3 hours i decided to ask for help her in forum.

i would really appreciate for your help.
Last Edit: 25 Apr 2014 20:59 by rasia.
The administrator has disabled public write access.

[HOW TO] ADD & WORK WITH PARAMS 24 Jul 2014 07:46 #12530

  • Romkabouter
  • Romkabouter's Avatar
  • Offline
  • Elite Member
  • Posts: 310
  • Thank you received: 131
  • Karma: 48
Hi,

In the front-end view (fork) add in view.html.php (function displayDefault):

$jinput = JFactory::getApplication()->input;
$menu = JSite::getMenu();
$params = $menu->getParams( $jinput->get( 'Itemid',0,'int') );
$country = $params->get('country');

This is default Joomla, not Cook
Last Edit: 24 Jul 2014 07:47 by Romkabouter.
The administrator has disabled public write access.
The following user(s) said Thank You: admin
  • Page:
  • 1
  • 2
Time to create page: 0.095 seconds

Get Started