PDA

View Full Version : Do I have to design *every* custom module position in my template?


tamper
22.06.2004, 10:28
Hi,

I'm working on a template, using some of the visualdensity PSD sources as a guide of just 'how much' of the template I need to design.

Similar to visualtech for example, I would like to create multiple module 'boxes', based on the same graphic style. My question is how to make these boxes only appear if a module is published into them.

What I don't want is empty module panels appearing, just becuase they're hard-coded into the template.

Can module box panel graphics be conditional in this way?

Thanks,
t

michelerocco
22.06.2004, 10:38
yes, if you use the search in this forum you'll find other post related to this.

U can do it using some php coding.

Where you want the module you must insert an if statement for look if the position is empty or not, so if empty just jump the part of html code for the box, if not show it ...

if I find the code i'll post it.

Bye

tamper
22.06.2004, 10:41
Thanks. I did do a search, but I didn't really know what I was looking for.

So does this mean the HTML has to be structured in a certain way? Would you put each box on a seperate DIV or something?

zorkhh
22.06.2004, 10:43
Hi,

try this one: <?php if (mosCountModules('user2')>0) {
mosLoadModules ( "user2" );
}
?>


hth

Greetings, Zork

pixelsoul
22.06.2004, 12:42
<?php if (mosCountModules( "user1" )) { ?>
<div class="canalsobeatableorwhatever"><?php mosLoadModules ( 'user1' ); ?></div>
<?php } ?>

tamper
22.06.2004, 12:47
Thanks for the help! Excuse my continued ignorance, but would this solution also cause the other modules to 'adapt' to the missing one?

Suppose I had a column of three boxes (user1, user2, user3). One day I decide to unpublish the module in user2. Would user 1 and user 3 then move up next to each other, or would there be a large gap where user2 should be?

zorkhh
22.06.2004, 14:03
Hi,

depends on the way you place it into your template. If you surround the whole HTML for the module output (tables and so on) with this IF-clause, nothing is displayed if there are no modules. The others will move up or right, whatever you designed in HTML.

hth

Zork

tamper
22.06.2004, 14:15
Thanks again- I'll give it a try.

t

fede-k3
22.06.2004, 15:47
Hey Man!

You are great...you help me too a lot :)

I will soon anounce my new project of templates..

I love Mambo and this community... and as i dont know much of php coding... (just for little hacks) i will start making templates.. :)