Members: 10,140
Threads: 38,830
Posts: 159,367
Online: 31

Newest Member: Xoote



Go Back   Mambers.com > Development > Module 'How Do I' Questions

Reply
 
Thread Tools Display Modes
Old 29.04.2004, 13:00   #1
njcallen
Baby Mamber
 
Join Date: Apr 2004
Posts: 16
njcallen is on a distinguished road
Default Template -> what does mosCountModules do?

Hi,

Just a quick question. While looking through a couple of the templates that I have, they use the function mosCountModules. What does this function do?

For example:

if (mosCountModules( "left" ) + mosCountModules( "user1" ) > 0) {

What does that line evaluate?

Cheers,

Nathan
njcallen is offline   Reply With Quote
Sponsored Links
Old 29.04.2004, 23:12   #2
Riba
Mamber
 
Riba's Avatar
 
Join Date: Apr 2004
Posts: 79
Riba is on a distinguished road
Default Re: Template -> what does mosCountModules do?

It checks if there are any modules configured to display in the particular area of the site on locations user1 and user2, and if there aren't any it won't put the empty space where they are supposed to be. There was a good example what happens when you don't use this function on www.rsdev.nl, but they fixed it
Anyway, if you just configure your modules not to show in a specific area you will get empty spaces, if you use mosCountModules() to check if there are any modules to be displayed, you can skip the html stuff that will draw the module 'boxes'. Hope this makes sense.
Riba is offline   Reply With Quote
Old 29.04.2004, 23:14   #3
makinations
Baby Mamber
 
Join Date: Apr 2004
Posts: 11
makinations is on a distinguished road
Default Re: Template -> what does mosCountModules do?

I believe it counts how many Modules are set to display on the left or right or top or bottom. You can use this information to display a header of some sort or to appropriately construct a box (or whatever) around a menu.

That specific line would check if there were any items set to display on the left or in the user1 area.

(My understanding could be a little off. I only started playing with Mambo a couple weeks ago.)
makinations is offline   Reply With Quote
Old 16.02.2007, 00:19   #4
rbnz
Baby Mamber
 
Join Date: Feb 2007
Posts: 1
rbnz is on a distinguished road
Default Re: Template -> what does mosCountModules do?

It returns 1 or 0 depending on if there are published modules in the section indicated in the backets;

mosCountModules('left') will return 0 if there are no modules set to the 'left' position in the module manager that are published. It will return 1 if there are 1 or more published as 'left'.

I'm thinking of advancing this on my own site to actually count the modules, or at least make some other function that counts the modules that are registered or not.

Issues I've found are the inability of joomla to allow a registered/public distinction that shows or hides modules depending if users are logged in or not, for say a registration promotion image, pointless for a user to see if they're already registered
rbnz is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 10:19.

Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
A vBSkinworks Design
© Copyright 2004-2008 by Arthur Konze Webdesign.