How to add a new module position.

Everything to do with Joomla! 1.5 templates and templating.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
User avatar
mdb76
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 183
Joined: Sat Oct 15, 2005 3:56 pm
Location: Toowoomba, Australia
Contact:

How to add a new module position.

Postby mdb76 » Mon Aug 27, 2007 12:35 pm

How do you add an extra module position to the default Joomla template?

I would like to add a module position to sit directly above the mainbody and below the user1 & user2 positions. I would like the new module position to be flush with the mainbody and not sit on top of the right module position.
You do not have the required permissions to view the files attached to this post.

User avatar
fire2006
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 111
Joined: Tue Jun 06, 2006 7:46 am
Location: Vancouver
Contact:

Re: How to add a new module position.

Postby fire2006 » Wed Sep 05, 2007 10:16 am

i am trying to figure out the same thing... i tried to just add one called user11, but its not showing up in the list of available positions in my template... here's what i did:



but doesnt seam to work.. any ideas?
Paul Preibisch - Educational Technologist
Fire Centaur - English Village - Secondlife
http://slurl.com/secondlife/English%20V ... 20Village&

User avatar
fire2006
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 111
Joined: Tue Jun 06, 2006 7:46 am
Location: Vancouver
Contact:

Re: How to add a new module position.

Postby fire2006 » Wed Sep 05, 2007 10:19 am

I think I figured it out:
I found the answer here: http://www.dart-creations.com/joomla/tu ... tions.html


Code: Select all

!-- BEGIN: adlinks -->
  <div id="adlinks" >

   <div class="adlinks-class">
    <?php mosLoadModules ( 'adlinks', -1 ); ?>
   </div>
  

  </div>
  <!-- END: adlinks -->



We then need to create the Module Position in Site > Template Manager > Module Positions by creating a new adlinks entry

Create a new position in the Module Positions

Once this is done, we can now assign a module to this position in the Modules > Site Modules page.

Image
Paul Preibisch - Educational Technologist
Fire Centaur - English Village - Secondlife
http://slurl.com/secondlife/English%20V ... 20Village&

Laurenca
Joomla! Intern
Joomla! Intern
Posts: 54
Joined: Wed Jun 21, 2006 6:16 pm

Re: How to add a new module position.

Postby Laurenca » Thu Sep 06, 2007 5:51 pm

I am just downloaded and installed 1.5. Module Position in Site > Template Manager > Module Positions does not exist. Where do I add the Module position?

Naesstrom
Joomla! Intern
Joomla! Intern
Posts: 96
Joined: Thu Dec 15, 2005 9:39 pm

Re: How to add a new module position.

Postby Naesstrom » Thu Sep 06, 2007 6:54 pm

Laurenca wrote:I am just downloaded and installed 1.5. Module Position in Site > Template Manager > Module Positions does not exist. Where do I add the Module position?



I was searching for the same thing and found that in the templateDetails.xml file you should add:

      left
      right
      top
      bottom
      inset
      banner
      header
      footer
      custom_position_1
      newsflash
      legals
      pathway
      breadcrumb
      syndicate
 


and so on for every cusom position you need, after that just go and select the position you want for your module!
Last edited by Naesstrom on Thu Sep 06, 2007 7:08 pm, edited 1 time in total.

User avatar
gChambers
Joomla! Apprentice
Joomla! Apprentice
Posts: 17
Joined: Wed May 16, 2007 4:51 pm
Location: Chicago, IL USA

Re: How to add a new module position.

Postby gChambers » Wed Oct 03, 2007 8:56 pm

GREAT!

I was searching the forum for this exact answer. Copy/pasting the codes from the list above into my templateDetails.xml file did the trick.  The only additions I made to the list above were to add user5, user6, user7 etc.

When I went back into Module Manager all the new postions were displayed in beautiful alpha order.

wholepair
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Thu Oct 04, 2007 6:44 am

Re: How to add a new module position.

Postby wholepair » Thu Oct 04, 2007 7:53 pm

I am very new to Joomla - and page templates in general.  I have been adding static-content(uncategorized) and creating menu items that link to these articles with my newly installed Joomla 1.5 CMS.  It is very exciting! 
I am working on a page that can be seen at: http://www.bikegeeks.com/joomla/
Previously I was playing around with tiddlywiki which you can see here: http://www.bikegeeks.com/

But I have come to the conclusion that tiddlywiki isn't the right thing to use for a small business web page, not that it doesn't have it's benefits as a small local wiki page for organizing information and projects.  I just don't think it is good for promotional web sites.

As you can see in my Joomla site I rewrote one of the header images with a banner of sorts but it gets cutoff.  As far as I can tell the 'Top' position in the page template is made up of three div sections and they get the id's header_l, header_r, and logo.  I thought I would be able to make more sense of how this page template produces the web page by opening index.php in dreamweaver but the layout preview doesn't make sense to me and I am afraid of making changes.
My default installation already had these positions in the xml file:


left
right
top
user1
user2
user3
user4
debug
syndicate


How can I edit the index.php template to fit a single banner in the 'Top' area of the layout?
Maybe thats not the right question.  How can I get a single full-length header image at the top of my page?

alforrest
Joomla! Apprentice
Joomla! Apprentice
Posts: 8
Joined: Sun Aug 24, 2008 1:03 am

Re: How to add a new module position.

Postby alforrest » Mon Aug 25, 2008 3:40 pm

Hi everyone.

I've been trying to follow this thread but am quite new to the whole "build your own website" thing. I've managed to tinker around and came up with this http://www.laurelicon.co.uk/home . I've pulled down one of the udpated Login module and would like to place it on the right hand side of the "Newsflash" module. which I've managed to position in the middle of the "Top" but am finding it nigh on impossible to understand the detail above. Is someone able to help at all? :(

GameDaddy
Joomla! Guru
Joomla! Guru
Posts: 725
Joined: Sun Aug 24, 2008 4:35 pm

Re: How to add a new module position.

Postby GameDaddy » Tue Aug 26, 2008 12:50 pm

alforrest wrote:Hi everyone.

I've been trying to follow this thread but am quite new to the whole "build your own website" thing. I've managed to tinker around and came up with this http://www.laurelicon.co.uk/home . I've pulled down one of the udpated Login module and would like to place it on the right hand side of the "Newsflash" module. which I've managed to position in the middle of the "Top" but am finding it nigh on impossible to understand the detail above. Is someone able to help at all? :(


Yes, those positions, which are originally defined in the templateDetail.xml file are actually laid out in the template using the index.php file. index.php tells joomla where top, right, user1, and user2 are to be displayed withing the template

User avatar
Chalk_Dust
Joomla! Intern
Joomla! Intern
Posts: 90
Joined: Fri Aug 01, 2008 3:50 am
Location: Chicago

Re: How to add a new module position.

Postby Chalk_Dust » Mon Sep 29, 2008 4:08 pm

How do you make the template understand WHERE the custom position goes? How can I connect it to a particular image?

GameDaddy
Joomla! Guru
Joomla! Guru
Posts: 725
Joined: Sun Aug 24, 2008 4:35 pm

Re: How to add a new module position.

Postby GameDaddy » Tue Sep 30, 2008 1:46 pm

Chalk_Dust wrote:How do you make the template understand WHERE the custom position goes? How can I connect it to a particular image?


Thats where the articles and the menu system come into play. When you publish an article or any other element for that matter, you choose the Section and Category to publish that to. The menu system combined with the modules define just where that section and category are published to.

Menus > Mainmenu > Home
For example is published to the mainmenu module, so if you go to

Extensions > Module Manager > Main Menu

You can click on it to edit it, and it will reveal that all items published to the main menu are slotted in the left position.

Your menu is going to show up on the left.

Suppose you publish a new article about a Joomla update? That would naturally be a News item, so you write your article, includes graphics, and publish it. Where does it go?

Let's take a look:

You choose to publish it in the News section in the Latest Category.

Let's have a look at the modules...

Extensions > Module Manager > Latest News

That is published in your template to the User1 position.

The menus control where the pages are located on your site. Menus define what your visitors will be able to see.
The modules control what is published, according to category and section (where they are published).
The articles are written and provided a category and section to be published to.

You can choose to publish some of the content directly to template positions. Some components are setup so you have the option to choose a category and section they are published to, this is indirect, however allows one to easily remember where to find the article based on its classification. For a small site this is not a big issue, but if you have more than 200 articles, knowing where to find the article is crucial to maintaining and updating the site in a timely manner.

Questions?

User avatar
Chalk_Dust
Joomla! Intern
Joomla! Intern
Posts: 90
Joined: Fri Aug 01, 2008 3:50 am
Location: Chicago

Re: How to add a new module position.

Postby Chalk_Dust » Tue Sep 30, 2008 3:41 pm

I wanted to create a module position that was specific to the header logo graphic... Milky Way was the only template where I could even come close to being able to put the graphic up above and assign a module to it (Simple Image Rotator). But I wanted to be able to use SIR for other templates as well, and needed to create a new position for where the header logo sits (usually top center). Is there a way to do this? I ended up getting around this by adding javascript to my particular template (intheclouds by cmstemplates.com) .. you can see the thread here: viewtopic.php?f=470&t=329810

ikt
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 137
Joined: Sat Mar 11, 2006 6:07 pm

Re: How to add a new module position.

Postby ikt » Thu Oct 16, 2008 4:08 pm

I too would like to know how to do this.

Thanks :D

GameDaddy
Joomla! Guru
Joomla! Guru
Posts: 725
Joined: Sun Aug 24, 2008 4:35 pm

Re: How to add a new module position.

Postby GameDaddy » Fri Oct 17, 2008 2:17 pm

First thing you'll want to do is go to the templateDetails.xml and add your new position. Simply insert a line about here in the code:

Code: Select all

<positions>
      <position>left</position>
      <position>right</position>
      <position>top</position>
                <position>mynewpositionhere</position>
</positions>


Next, you'll want to go to the Module Manager and map one of your modules to your new position. Just as an example, in the Rhuk Milkyway template the Newsflash module is mapped to the top position... which in that template is inserted at the top of the index.php file next to the logo which also is mapped to the Top position in the Index.php file.

Just to clear up this confusion, With the Rhuk Milkyway template, the logo and the top module is actually loaded into the template by the index.php with the following css & command:

Code: Select all

<div id="logo"></div>
    <jdoc:include type="modules" name="top" />
</div>


When you go to Extensions > Module Manager and look for the top module, you won't find it. You won't find it in the plugins either. This is because the Top module is actually part of the Joomla! core code.

The css for the div id logo loads the actual logo image from the template.css style sheet while the newsflash items are loaded by the top module, which is invisible being a part of the Joomla! core and all.

Instead of using css to load our logo, we are going to replace that Top module with a completely new module that only displays our logo graphic... ready?

First use the media manager in the control panel and upload the image you want to use for your logo. Next we are going to create a Module that holds that image.

Extensions > Module Manager > New

choose the Custom HTML option by selecting the radio button.

Title: topper
Position: mynewpositionhere

Scroll down a bit until you see Custom Output... go to the bottom of that. See your Image button? Click it. This will load the media manager and allow you to place an image in the module, in your case, choose your logo.

Insert your logo by clicking the logo file and clicking insert from the upper right of the now opened media manager. Apply and Save your changes.

Finally, we are going to add the code that serves up the logo image with your template, Open up the index.php file

Extensions > Template Manager > YourTemplate > Edit > EditHTML

and add the following code where ever you want this module (and your logo) to appear:

Code: Select all

<jdoc:include type="modules" name="topper" />


Apply and Save your changes. Preview your work!

If you are actually doing this using the Rhuk Milkyway template for example, you need to remember to disable the newsflash module and remove the Jdoc statement that loads the Top module.

Cheers! ;)

flatsilver
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 141
Joined: Wed Feb 11, 2009 3:38 am

Re: How to add a new module position.

Postby flatsilver » Thu Mar 19, 2009 4:08 am

what if inside my templateDetails.xml
there are NO positions shown?

GameDaddy
Joomla! Guru
Joomla! Guru
Posts: 725
Joined: Sun Aug 24, 2008 4:35 pm

Re: How to add a new module position.

Postby GameDaddy » Thu Mar 19, 2009 2:07 pm

Joomla!, by default has the following positions coded into the core:

Code: Select all

<positions>
        <position>top</position>
        <position>left</position>
        <position>right</position>         
        <position>bottom</position>
        <position>banner</position>
        <position>syndicate</position>
        <position>footer</position>
        <position>user1</position>
        <position>user2</position>
        <position>user3</position>
        <position>user4</position> 
</positions>


You can use any of these in any template design and once you select where the module will be placed in your new template, it will show up there.

For more info checkout the Joomla! docs here:
http://docs.joomla.org/Module_positions

and...

http://docs.joomla.org/Jdoc_statements

flatsilver
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 141
Joined: Wed Feb 11, 2009 3:38 am

Re: How to add a new module position.

Postby flatsilver » Thu Mar 19, 2009 6:19 pm

can <filename> and <positions> be mixed, i dont have any <positions> in my file

trxster
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Wed Mar 25, 2009 11:34 am

Re: How to add a new module position.

Postby trxster » Wed Mar 25, 2009 11:38 am

i've been reading the page for awhile and 'm still confused. im using a template i purchased online and they have positions that are predefined.. i need to change some of these positions and preferably add new module positions.

the question is how do i define where i want my module to appear in the page?

KThackston
Joomla! Intern
Joomla! Intern
Posts: 87
Joined: Sat Sep 06, 2008 11:31 pm

Re: How to add a new module position.

Postby KThackston » Wed Mar 25, 2009 4:11 pm

trxster wrote: the question is how do i define where i want my module to appear in the page?


If you open your index.php page and search for "user1" "user2" etc. you can see in the code lines where each position falls into place.

I'm having a similar problem where I'd like to change the position of the user1 and user2 and move it from the top of the content to the bottom. I tried to just cut and paste the code but it wasn't as easy as I thought. I don't really understand the if/endif statements and how they affect the positions or page.

trxster
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Wed Mar 25, 2009 11:34 am

Re: How to add a new module position.

Postby trxster » Wed Mar 25, 2009 4:27 pm

i looked through the index.php file in the template folder and i see this

if ($tp_user6 >= 1 ) $u6width = 1;
else $u6width = 0;

<?php if($tp_user6 || $tp_user7 ) { ?>
<div id="u67">
<div id="u6box" style="width:<?php echo $u67width; ?>px;">
<jdoc:include type="modules" name="user6" style="xhtml" />
</div>
<div id="u7box" style="width:<?php echo $u67width; ?>px;" <?php if ($tp_user6 >= 1 ) echo "class=\"vertsep\""; ?>>
<div id="u7boxinner" style="width:<?php echo $u67width - $u67extmargin; ?>px;">
<jdoc:include type="modules" name="user7" style="xhtml" />
</div>
</div>
<div class="clearfix"></div>
</div>

which do i change? i'm such a noob when it comes to php..is there no easy way to this? i'm having a tough time understanding the codes and have been searching for help on this for awhile now.

KThackston
Joomla! Intern
Joomla! Intern
Posts: 87
Joined: Sat Sep 06, 2008 11:31 pm

Re: How to add a new module position.

Postby KThackston » Thu Mar 26, 2009 1:29 am

Sorry I can't help you, but I did find this article in trying to solve my own problems, perhaps it will work for you:

http://www.dart-creations.com/joomla/jo ... tions.html

Cheers

frankiepol
Joomla! Apprentice
Joomla! Apprentice
Posts: 22
Joined: Tue Dec 11, 2007 8:56 pm

Re: How to add a new module position.

Postby frankiepol » Sun Apr 12, 2009 4:07 am

Thank you Game Daddy for a great step by step there.
The clouds parted and the sun came through and alas - I added my first module position.

Can't thank you enough! :D

fifthhouse
Joomla! Explorer
Joomla! Explorer
Posts: 292
Joined: Fri Mar 20, 2009 5:03 pm
Location: Toronto, Canada
Contact:

Re: How to add a new module position.

Postby fifthhouse » Tue Apr 14, 2009 1:36 am

GameDaddy wrote:Joomla!, by default has the following positions coded into the core:

Code: Select all

<positions>
        <position>top</position>
        <position>left</position>
        <position>right</position>         
        <position>bottom</position>
        <position>banner</position>
        <position>syndicate</position>
        <position>footer</position>
        <position>user1</position>
        <position>user2</position>
        <position>user3</position>
        <position>user4</position> 
</positions>


You can use any of these in any template design and once you select where the module will be placed in your new template, it will show up there.

For more info checkout the Joomla! docs here:
http://docs.joomla.org/Module_positions

and...

http://docs.joomla.org/Jdoc_statements


Hello all. I am confused. I just added these to the correct file, and they then show up when I add a new module or edit an existing one. But when I choose one of the new postions, the module doesn't show up there. Try as I might these new positions aren't showing up.

An article http://www.dart-creations.com/joomla/joomla-tutorials/joomla-1.5-template-positions.html also says you need to make changes to the index.php file.

Also, a way to check your module positions is to add ?tp=1 to the url of your site. When I do this, only the old module positions show up, and not the new ones I inserted into the templateDetails.xml file.


Any ideas?

nyliferocks
Joomla! Apprentice
Joomla! Apprentice
Posts: 23
Joined: Sun May 03, 2009 10:36 am

Re: How to add a new module position.

Postby nyliferocks » Tue May 12, 2009 6:28 pm

Hi, What would make my menus only come up as text and not in a box?
citizenneed.org

User avatar
Alextampa
Joomla! Guru
Joomla! Guru
Posts: 557
Joined: Fri Jan 09, 2009 3:16 pm
Location: Tampa

Re: How to add a new module position.

Postby Alextampa » Tue May 12, 2009 7:22 pm

fifthhouse wrote:
Hello all. I am confused. I just added these to the correct file, and they then show up when I add a new module or edit an existing one. But when I choose one of the new postions, the module doesn't show up there. Try as I might these new positions aren't showing up.

An article http://www.dart-creations.com/joomla/joomla-tutorials/joomla-1.5-template-positions.html also says you need to make changes to the index.php file.

Also, a way to check your module positions is to add ?tp=1 to the url of your site. When I do this, only the old module positions show up, and not the new ones I inserted into the templateDetails.xml file.


Any ideas?



You just place this code whereever you like in your index.php file in the templates folder

Just rename the DIVNAME, and POSITIONNAME
<div id="DIVNAME">
<jdoc:include type="modules" name="POSITIONNAME" />
</div>

nyliferocks
Joomla! Apprentice
Joomla! Apprentice
Posts: 23
Joined: Sun May 03, 2009 10:36 am

Re: How to add a new module position.

Postby nyliferocks » Thu May 14, 2009 4:02 pm

So I can possibly help, tell me what you did so far?


hyiperz1 wrote:i added the module position but its not showing up... can any one help me out?

porcupinetree
Joomla! Apprentice
Joomla! Apprentice
Posts: 17
Joined: Wed Jun 03, 2009 9:45 am

Re: How to add a new module position.

Postby porcupinetree » Wed Jun 03, 2009 12:15 pm

Okay so having read all these posts I can make a new module position by adding the correctly named position tag in the template.xml file and placing the jdoc tag in the correct place in the index.php so that it will display in the right place when I choose a module.

That's fine for the homepage, but all the rest of the website pages in Joomla are dynamically produced. So how do I place a jdoc tag in a page that doesn't physically exist?

nyliferocks
Joomla! Apprentice
Joomla! Apprentice
Posts: 23
Joined: Sun May 03, 2009 10:36 am

Re: How to add a new module position.

Postby nyliferocks » Wed Jun 03, 2009 2:20 pm

Check out citizenneed.org. Is this what you need?

porcupinetree
Joomla! Apprentice
Joomla! Apprentice
Posts: 17
Joined: Wed Jun 03, 2009 9:45 am

Re: How to add a new module position.

Postby porcupinetree » Wed Jun 03, 2009 8:29 pm

Actually on further research of course the index.php file lists all the positions because it uses the php if else statement.

In other words, it tells the browser that if the homepage is requested, display one set of html, else other pages then another set of html. You can of then of course make those modules custom html and assign them to different pages within your menu options ;D

cobarde
Joomla! Apprentice
Joomla! Apprentice
Posts: 9
Joined: Mon Jun 15, 2009 10:08 pm

Re: How to add a new module position.

Postby cobarde » Tue Jul 07, 2009 1:24 am

[quote="GameDaddy"]First thing you'll want to do is go to the templateDetails.xml and add your new position. Simply insert a line about here in the code:

Code: Select all

<positions>
      <position>left</position>
      <position>right</position>
      <position>top</position>
                <position>mynewpositionhere</position>
</positions>


Next, you'll want to go to the Module Manager and map one of your...


Daah, I think all the above is the answer I'm lookin 4. The thing is I was given the task of developing a website that was started by someone, I took over when it was a Joomla template in its nearly untouched state. The site is for the U.S.A equivilent of the CIA, here in this banana republic island paradise. Any way I must not make any mistakes.--I simply want to put the Panoramic Image Viewer, up at the very top to the right of the logo (the official shield), in the process I'd like to bring the WEBMAIL box down to the right side above the search (Buscar) box.
Believe me I'm ashamed to tell you how long I've been trying to figure this out.
So...I if do exactly as wrote here, will I obtain the result I need?
I've said it before and I'll say it again, I won't be offended if you give me a childlike answer.
Here's the front page I'm talking about: http://www.dintel.gov.do/

WE APPRECIATE YOUR HELP


Return to “Templates for Joomla! 1.5”

Who is online

Users browsing this forum: No registered users and 8 guests