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
Get module paremeters from elsewhere!!!
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
  5 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
 
fornandakishore  
View profile  
 More options Aug 3 2012, 12:23 am
From: fornandakishore <fornandakish...@gmail.com>
Date: Fri, 3 Aug 2012 09:53:43 +0530
Local: Fri, Aug 3 2012 12:23 am
Subject: Re: [jgen] Get module paremeters from elsewhere!!!

Hello Harmer,

Try to use this code ...

jimport('joomla.application.module.helper');
$module = JModuleHelper::getModule('mod_login', 'YourModuleTitle');
//echo JModuleHelper::renderModule($module);

I hope this code will help you to give the specified module parameter in
any component, module and plugin.

Thanks & Regards

Nanda Kishore. M
Senior PHP Developer

http://php-desk.blogspot.com

Mobile: + 91 98499 71144


 
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.
allon moritz  
View profile  
 More options Aug 3 2012, 12:56 am
From: allon moritz <allon.mor...@gmail.com>
Date: Fri, 3 Aug 2012 06:56:51 +0200
Local: Fri, Aug 3 2012 12:56 am
Subject: Re: [jgen] Get module paremeters from elsewhere!!!

Because joomla doesn't provide a way to get the params by module id (mostly
you don't have the module title!!) I get it from the table directly
$db = JFactory::getDbo();
$query = $db->getQuery(true);
$query->select('m.*');
$query->from('#__modules AS m');
$query->where('id = '.JRequest::getInt('moduleid'));
$db->setQuery($query);
$module = $db->loadObject();
$params = new JRegistry($module->params);

I also don't like to get it form the database rather than via API, but I
was searching up and down for a function to get the params by module id via
API.

On Fri, Aug 3, 2012 at 6:23 AM, fornandakishore
<fornandakish...@gmail.com>wrote:


 
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.
piotr_cz  
View profile  
 More options Aug 3 2012, 4:18 am
From: piotr_cz <pkoniec...@hotmail.com>
Date: Fri, 3 Aug 2012 01:18:21 -0700 (PDT)
Local: Fri, Aug 3 2012 4:18 am
Subject: Re: Get module paremeters from elsewhere!!!
It seems that module parameters are being loaded as string in
JModuleHelper::getModule().

You could convert these to a JRegistry using:

// Get First module
$module = JModuleHelper::getModule('mod_login')

// Get module parameters
$params = new JRegistry;
$params->loadString($module->params);

But, as Allon Moritz mentioned this doesn't filter module by id and
'title' is up to user.

If you are inside the module itself, you may use $params variable.

I guess it was an unlikely scenario to prepare loading module
paramaters for other reasons that in template positions or inside a
module.

On Aug 3, 6:56 am, allon moritz <allon.mor...@gmail.com> wrote:


 
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.
Ove  
View profile  
 More options Aug 3 2012, 10:49 am
From: Ove <tobby.eriks...@gmail.com>
Date: Fri, 03 Aug 2012 16:49:56 +0200
Local: Fri, Aug 3 2012 10:49 am
Subject: Re: [jgen] Re: Get module paremeters from elsewhere!!!
IMHO it's not possible to use module parameters from another extension.
Wich module? You can have a couple of them if the user clicks on the
Duplicate button.  You do not have any unique identifier, On a private
site you can hardcode it but not for a general solution. I guess you'll
need a small backend component to set the needed general parameters.

Ove

piotr_cz skrev 03.08.2012 10:18:


 
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.
Carlos M. Cámara  
View profile  
 More options Aug 3 2012, 12:58 am
From: Carlos M. Cámara <cmcam...@gmail.com>
Date: Fri, 3 Aug 2012 06:58:54 +0200
Local: Fri, Aug 3 2012 12:58 am
Subject: Re: [jgen] Get module paremeters from elsewhere!!!

Using module params from one module would work for a specific design, as to
get the specific module instance you have to set type of module and title,
but if the user has 2 modules, or if the user changes the module title,
this will not work.

Obviously solution provided by Allon Moritz will work too, as far as you
know the specific module id.

All best!!

I think it would be better to set these parameters in a component. This way
you guarantee that not matter what user makes with the module, your
parameters will remain the same.

On Fri, Aug 3, 2012 at 6:23 AM, fornandakishore
<fornandakish...@gmail.com>wrote:


 
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 « Newer topic     Older topic »