Welcome, Guest
Please Login or Register.    Lost Password?

Placing a module in the body of a page
(1 viewing) (1) Guest
Go to bottomPage: 1
TOPIC: Placing a module in the body of a page
#41
Placing a module in the body of a page 4 Years, 8 Months ago Karma: 0
Hi all,

I'm developing a site at www.editexcel.com/nisus/

I've downloaded the flash image module at www.joomlashack.com/index.php?option=com...70& Itemid=15

Installed and working fine. However, at the moment I can only publish it to either the left or top of the page (you will see it at the bottom of the left coloumn). I would like to replace one of the static images currently in the main body with the module.

Is this possible? If so how?

Many thanks in advance,

johnmc
johnmc
Fresh Boarder
Posts: 16
graphgraph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
#42
Re:Placing a module in the body of a page 4 Years, 8 Months ago Karma: 41
Hi John

I believe someone has written an extension that lets you publish a module in your main content area but I'm not 100% sure - you'd need to dig around in extensions.joomla.org/

The other way is to add another module position to index.php either above or below the main content - This is very easy and I'll post some instructions shortly.

If you do add another module position it would bring up any content you had published inside it additional to the main content - and the content in your new module would display either above or below the main content depending on where you placed it in the template.

More soon
Big Bear
Administrator
Posts: 1004
graph
User Offline Click here to see the profile of this user
Joomla Templates
The administrator has disabled public write access.
 
#43
Re:Placing a module in the body of a page 4 Years, 8 Months ago Karma: 41
If you open index.php inside your Templates/NiftyCorners directory and locate the following code:

<div id="content">
<?php mosMainBody(); ?>
</div>

You could then add the php code to load a another module:
<?php mosLoadModules ( 'banner',-2 ); ?>

It would then look like this:
<div id="content">
<?php mosLoadModules ( 'banner',-2 ); ?>
<?php mosMainBody(); ?>
</div>

I have only used 'banner' because User1-User9 are already used in the left column.

Also note that by placing the additional banner module into the DIV with id "content" the module will be subject to the styling that has been applied to #content in NiftyLayout.css

This can be a good thing - it will have same padding, etc

If this isn't working for you then you could add another div above or below the content div and and add styling for it in NiftyLayout.css

If you decide to go this route let me knwo and I'll give you some more tips<br><br>Post edited by: Big Bear, at: 2007/09/12 13:00
Big Bear
Administrator
Posts: 1004
graph
User Offline Click here to see the profile of this user
Joomla Templates
The administrator has disabled public write access.
 
#45
Re:Placing a module in the body of a page 4 Years, 8 Months ago Karma: 0
Big Bear wrote:


You could then add the php code to load a another module:
&lt;?php mosLoadModules ( 'banner',-2 ); ?&gt;



Hi Big Bear, thanks for the help again.

I tried doing this and it broke the template. However, it is now working after I added the code
Code:


&lt;div id=&quot;content&quot;&gt;

&lt;?php mosMainBody(); ?&gt;
&lt;?php mosLoadModules ( 'nisus1' ); ?&gt;
&lt;?php mosLoadModules ( 'nisus2' ); ?&gt;
&lt;?php mosLoadModules ( 'nisus3' ); ?&gt;

&lt;/div&gt;



I would now like to float the second and third module position to the right of the first one, giving them a specific width. I'm guessing this will be done in the css, would I have to create put them in three new layers for this?

Thanks again,

johnmc<br><br>Post edited by: Big Bear, at: 2007/09/12 13:04
johnmc
Fresh Boarder
Posts: 16
graphgraph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
#46
Creating Custom Joomla Module Name/ Position 4 Years, 8 Months ago Karma: 41
Hi John,

Very sorry about that code example John, I just looked at it again and there was an extra { curly bracket - have removed from my example.

It's good you have it working but it looks like you are using custom module names - nisus1, etc

You'll need to add those custom names to your template module positions.

Just got to Site &gt; Template Manager &gt; Module Positions and add the names you have specified.



Post edited by: Big Bear, at: 2007/09/12 13:17<br><br>Post edited by: Big Bear, at: 2007/09/12 13:19
Big Bear
Administrator
Posts: 1004
graph
User Offline Click here to see the profile of this user
Joomla Templates
The administrator has disabled public write access.
 
#47
Re:Placing a module in the body of a page 4 Years, 8 Months ago Karma: 41
Hi John,

You're right about the layers/DIVS

You'll want to create a DIV with an ID around each of those module positions.

Code:

&lt;div id=&quot;content&quot;&gt;

&lt;?php mosMainBody(); ?&gt;
&lt;div id=&quot;nisus1&quot;&gt;
&lt;?php mosLoadModules ( 'nisus1' ); ?&gt;
&lt;/div&gt;
etc, etc,
&lt;/div&gt;



You'd then create a class in your CSS as follows
Code:

#nisus1 {
float: left;
width: 200px;
etc, etc
}



Obviously don't put my etc, etc in and the float and width properties are just examples.

If you get this done and still want more! you can make the modules
  • collapsable
  • i.e. they won't be published if no module is published in that position.

    All you need to do is wrap each DIV with the following php tags:
    &lt;?php if (mosCountModules('nisus1')) { ?&gt;
    &lt;?php } ?&gt;
    Code:


    &lt;?php if (mosCountModules('nisus1')) { ?&gt; 
    &lt;div id=&quot;nisus1&quot;&gt;
    &lt;?php mosLoadModules ( 'nisus1' ); ?&gt;
    &lt;/div&gt;
    &lt;?php } ?&gt;



    Hopefully that makes sense? You're simply using PHP to detect if the module has been published and if not then don't load the div either.<br><br>Post edited by: Big Bear, at: 2007/09/12 13:33
    Big Bear
    Administrator
    Posts: 1004
    graph
    User Offline Click here to see the profile of this user
    Joomla Templates
    The administrator has disabled public write access.
     
    #48
    Re:Placing a module in the body of a page 4 Years, 8 Months ago Karma: 0
    Thanks so much!

    Have implemented and it all works exactly as I need it to.

    Great, great, great!

    Johnmc
    johnmc
    Fresh Boarder
    Posts: 16
    graphgraph
    User Offline Click here to see the profile of this user
    The administrator has disabled public write access.
     
    #49
    Re:Placing a module in the body of a page 4 Years, 8 Months ago Karma: 41
    My god you are fast! I barely finished typing the post.
    :)
    Big Bear
    Administrator
    Posts: 1004
    graph
    User Offline Click here to see the profile of this user
    Joomla Templates
    The administrator has disabled public write access.
     
    #51
    Re:Placing a module in the body of a page 4 Years, 8 Months ago Karma: 0
    actually, I had just about got there myself except for the collapsable module code. I'd not have got that, but that finished it off perfectly.
    johnmc
    Fresh Boarder
    Posts: 16
    graphgraph
    User Offline Click here to see the profile of this user
    The administrator has disabled public write access.
     
    Go to topPage: 1
    Moderators: Support
     
    JOOMLA TEMPLATES Joomla Templates By JoomlaBear