Elxis CMS Forum

Extensions => Modules => Topic started by: armpouniotis on February 13, 2009, 15:13:17

Title: About Frontpage module
Post 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
Title: Re: About Frontpage module
Post by: Ivan Trebješanin on February 13, 2009, 16:02:20
What do you mean "installed"? Frontpage module is already a part of Elxis.
Title: Re: About Frontpage module
Post by: armpouniotis on February 13, 2009, 16:31:54
I mean, that now I have the Frontpage module twice !

And I want to work both of them at the same time !

Any ideas ?
Title: Re: About Frontpage module
Post by: CREATIVE Options on February 13, 2009, 16:32:58
What do you mean "installed"?
Title: Re: About Frontpage module
Post by: armpouniotis on February 13, 2009, 16:35:19
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.
Title: Re: About Frontpage module
Post by: CREATIVE Options on February 13, 2009, 16:54:33
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.
Title: Re: About Frontpage module
Post by: armpouniotis on February 13, 2009, 16:58:28
ok I did that,

but still, I can't use both modules at the same time.... :(
Title: Re: About Frontpage module
Post by: ks-net on February 13, 2009, 20:12:12
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!
Title: Re: About Frontpage module
Post by: CREATIVE Options on February 13, 2009, 20:22:44
For multiply instances in the same page use UDC http://www.elxis-downloads.com/com_downloads/miscellaneous/41.html
Title: Re: About Frontpage module
Post by: Farhad Sakhaei on February 23, 2009, 17:31:28
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 ...
Title: Re: About Frontpage module
Post by: CREATIVE Options on February 23, 2009, 19:37:52
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.
Title: Re: About Frontpage module
Post by: Farhad Sakhaei on February 23, 2009, 20:51:13
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]
Title: Re: About Frontpage module
Post by: datahell on February 23, 2009, 21:43:38
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.
Title: Re: About Frontpage module
Post by: armpouniotis on February 26, 2009, 15:26:39
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 !
Title: Re: About Frontpage module
Post by: datahell on February 26, 2009, 18:43:07
Use Farhad's patch. It will work just fine.