开发者

JOOMLA : how to use multiple modules in the same webpage?

开发者 https://www.devze.com 2023-04-07 06:28 出处:网络
my question sounds simple, but for me it isn\'t, i\'m developing a joomla module and i want to use it multiple times and at different different position on each page load, ca开发者_StackOverflow社区n

my question sounds simple, but for me it isn't, i'm developing a joomla module and i want to use it multiple times and at different different position on each page load, ca开发者_StackOverflow社区n you just guide me? or gimme an example to accomplish this task? your help will be much appreciated.

Googling didn't helped me this time


Are you creating a module or a component? A component can only be displayed once per page and only in the area designated in the template by the tag. A module can be displayed several times per page and in several positions in your site. Simply go to the module manager, click on "New", fill in the details and the position and click on save.


It depends a little on which version of Joomla you're using (you don't say?), but in Joomla 1.7:

Administration Area -> Extensions -> Module Manager

Select the module you want to duplicate (tickbox to the left), hit the 'Duplicate' button at the top.

Now there are two separate modules, that use the same /DOCROOT/modules/mod_MODULENAME.php file for their logic. They can be assigned to separate module positions (or different pages), and given separate module parameters. You can have as many 'copies' of a module as you want. You can give them different names - but they'll all have the same 'Type' (this refers to the actual PHP file they use).

You'll probably notice that the example modules that come with Joomla are often copies - especially of common modules like 'Custom HTML'.

I've seen this confusion before, between a module (a small bunch of files you install that go in the /modules/ directory), and a module (the use of that bunch of files in the admin area, that appears on your site - it's actually a row in the Joomla database). When you first install a modules files, Joomla creates a single copy of the database row for you to use.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号