Elxis CMS Forum
Extensions => Modules => Topic started by: armpouniotis on February 13, 2009, 15:13:17
-
Hi all !
one question: I have successfully installed the Frontpage module again (which means now I have 2 Frontpage modules), and i have put it in a specific position.
Unfortunately, only one of the two modules works....
How can I make it work both of them at the same time ???
Thank you in advance
Chris
-
What do you mean "installed"? Frontpage module is already a part of Elxis.
-
I mean, that now I have the Frontpage module twice !
And I want to work both of them at the same time !
Any ideas ?
-
What do you mean "installed"?
-
I changed the XML file of this module, I zipped both the xml and php file under the name of "mod_frontpage_2" and then I installed through the admin zone.
The system accepted it, but I can't use both of them at the same time.
-
Why you did that ???
Just create a copy from the site module menu, by selecting the module and press the button "copy" from the top right menu.
-
ok I did that,
but still, I can't use both modules at the same time.... :(
-
Note:
multiply instances of mod_frontpage in the same page won't work.
copy module as Sirigos said but use one of them in same page!
-
For multiply instances in the same page use UDC http://www.elxis-downloads.com/com_downloads/miscellaneous/41.html
-
He want to have 2 instances of FrontPage module ...
This is a normal request ...
He don't want UCD
This is a bug and should be fix ...
-
Farhad anywhere you look there are limitations !
It is as if you are asking the car industry to have any time you want extra space in the luggage dept. in your car.
If you examine the module you will see the instances as a hard code. This is how the module has been created ! if you want, open it and do it yourself, don't present everything as bugs. We can't expect the Elxis Team to do everything for us!!
The UDC is the best way to resolve this limitation & to do the job armpouniotis needs.
-
To fix the problem , download the attached file and extract it ... Copy/Overwrite contained files and folders on your /modules folder
Problem solved
What was the problem ?
The class cannot be redeclare
[attachment deleted by admin]
-
This is not a bug, the module has been designed to work like this.
Going back to the "mambo days", where Elxis began, most modules could be used only once because there were functions written in a "spaghetti style" that loaded without checking if there were previously already defined. Gradually we followed a different approach on modules development (OO programming) that, besides other, allowed us to have more instances of a module available on the same page. This method has not been applied to all modules as some modules have been designed to be used only once. One of them is the front-page module. I can not imagine why you need to have 2 instances of the front-page module on the same page. Of course the solution to your problem is to check if the class has been already defined, as Farhad proposed, it is up to you if you want to apply this patch.
-
You see,
since I have some kind of imagination I just wanted to use 2-3 instances of the Frontpage module in different ways.
Since I did that with banner module or with latest news module, I thought I could do the same thing with Frontpage module.
UCD is quite helpful but it is not convinient in the case that I want to present some content items.
Never mind.... Probably future versions of Elxis will give us the opportunity to do that !
Thank you anyway !
-
Use Farhad's patch. It will work just fine.