set the order of modules load

For Joomla! 3.x Coding related discussions, you could also use: http://groups.google.com/group/joomla-dev-general

Moderators: ooffick, General Support Moderators

Forum rules
Locked
gcubar
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Thu Nov 23, 2017 1:06 pm

set the order of modules load

Post by gcubar » Thu Nov 23, 2017 1:49 pm

Hi collegues,

I have some modules of the same kind in the same web page. There were placed in differents template positions, for instance: "top-1", "top-2", "main-body", "bottom-1", "bottom-2". Then, I need to arrange module load order. In previus example, modules in "top-1" position are loaded firts than modules in "top-2" position, and consecuently, follows modules are loaded in the same order; but I need, for example, that modules in "bottom-2" position would be loaded firsts, next, modules in "bottom-1" position and so on.

I was looking for that trick here in this forum, but i don't found answer that satisfy my requirements.
viewtopic.php?t=542438
viewtopic.php?t=822189
viewtopic.php?t=630399

I looked for outside too, but without much luck.

Anyone have any insight that would bright me, how can i develop some hack for this issue?
Thanks.

Best regards,
Gilberto Cuba

SharkyKZ
Joomla! Hero
Joomla! Hero
Posts: 2903
Joined: Fri Jul 05, 2013 10:35 am
Location: Parts Unknown

Re: set the order of modules load

Post by SharkyKZ » Fri Nov 24, 2017 7:04 am

Switch module positions?

User avatar
Per Yngve Berg
Joomla! Master
Joomla! Master
Posts: 30928
Joined: Mon Oct 27, 2008 9:27 pm
Location: Romerike, Norway

Re: set the order of modules load

Post by Per Yngve Berg » Fri Nov 24, 2017 7:59 am

The modules are rendered in the order the module positions are layed out in the template.

gcubar
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Thu Nov 23, 2017 1:06 pm

Re: set the order of modules load

Post by gcubar » Sat Nov 25, 2017 3:51 pm

Thanks for yours quick answers.

Switching module position isn't we want, we want that modules stay placed where they are.
And yes, we known that module are rendered in the order the module positions are layed out in the template. Thanks again.
I am a newbie hacking Joomla! cores files, its for why we come here. I looking for some event or lazy load that we can hook to change that order, but i don't see how.

Maybe if I explain the initial cause that make we want to change that module load order, it could be another way to give us some insight for solve that issue.

The initial problem is here.
As I explain initially, we have some modules of the same kind in one web page. These modules show title and intro image articles in a box style. Some module show articles of one category, and others modules show articles of many categories that may include category assigned to another module. This setup causes that some articles were showed as duplicated in the same page. Then, we have placed the module have assigned many categories at the top of whole template positions, and consecuently the others modules that have only one assigned category, at the bottom template positions.
For some reason, that i don't know yet (i research in "libraries/cms/module/helper.php" and "libraries/joomla/document/html.php" files but without luck), modules are rendered bottom up as they were placed in template positions, its makes we can't control the module's behaviour for show articles by category like we want.

We are still looking for how to solve this issue.

User avatar
Per Yngve Berg
Joomla! Master
Joomla! Master
Posts: 30928
Joined: Mon Oct 27, 2008 9:27 pm
Location: Romerike, Norway

Re: set the order of modules load

Post by Per Yngve Berg » Sat Nov 25, 2017 5:03 pm

What kind of modules? Is it something you have developed your self?

Where do the modules get it's data and how is it configured?

gcubar
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Thu Nov 23, 2017 1:06 pm

Re: set the order of modules load

Post by gcubar » Sat Nov 25, 2017 7:17 pm

> What kind of modules?

Its a module for show data as a presenter in front page at some template position. Module name is "News Show Pro GK5" from Gavick.com.

> Is it something you have developed your self?

No, we don't develop it, but we made some improves that means we can deep into developed scripts.

> Where do the modules get it's data and how is it configured?

Well... its difficult to say from here. The module has many classes, and in one of them, throught a NSP_GK5_Helper::getDatas() method, it recover the data from database. Then it renders that information throught NSP_GK5_Helper::renderLayout() method.

I could solve this issue if i could make some lazy load of NSP_GK5_Helper::getDatas(), and then, when the calls to the module finished (event that i don't know how to hook), inspect for duplicated articles, fix them, and call NSP_GK5_Helper::renderLayout() methods for each module instance. This insight sound to difficult because the lazy loads and event for hook i think do not there are, its for what we ask the first question.

Thanks.


Locked

Return to “Joomla! 3.x Coding”