Blank template

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.
Locked
User avatar
Magicspon
Joomla! Explorer
Joomla! Explorer
Posts: 340
Joined: Sun Jun 11, 2006 10:47 am
Location: Bristol
Contact:

Blank template

Post by Magicspon » Fri Mar 20, 2009 10:54 pm

hello,

Does anyone know where i can get a blank joomla template which i can freely modify.

I've attached an illustration of the basic structure i need, i am confident with css so i'm not worried about styling.

I need a top menu
below a module for an image or flash banner
breadcrumb
left and right modules
footer (for a site index)

Thanks in advance.
dave
You do not have the required permissions to view the files attached to this post.

User avatar
Webdongle
Joomla! Master
Joomla! Master
Posts: 44019
Joined: Sat Apr 05, 2008 9:58 pm

Re: Blank template

Post by Webdongle » Sat Mar 21, 2009 12:15 am

Create an index.html file with a .css file to look like your diagram. Have css and images folders

When viewed locally and it looks correct then add the Joomla php calls and rename the index.html to index.php. create an xmlfile (there are extensions for that). zip up files and folders, from Joomla backend. Done.

Create a css file and add some id's. Best not assign Class as it may conflict with Joomlas predefined Class's

----------------------------------

<?php
// no direct access
defined( '_JEXEC' ) or die( 'Restricted access' );
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $this->language; ?>" lang="<?php echo $this->language; ?>" >
<head>
<jdoc:include type="head" />
<title><?php echo $mainframe->getCfg('sitename');?></title>

<link rel="stylesheet" href="templates/<?php echo $this->template ?>/style.css" type="text/css" />



</head>

<body>
<div id="">
<div id=""><jdoc:include type="modules" name="top" style="" /> Top
<div id="search">
<jdoc:include type="module" name="search" />Search
</div>
</div>

<div id=""><img src="templates/<?php echo $this->template ?>/images/image.jpg" alt="" />image</div>

<div id=""><jdoc:include type="module" name="breadcrumbs" />Breadcrums</div>

<div id="">
<div id="left"><jdoc:include type="modules" name="left" style="" />Left</div>

<div id="right"><jdoc:include type="modules" name="right" style="" />Right</div>

<div id="mainbody"><jdoc:include type="component" />main body</div>
</div>

<jdoc:include type="modules" name="footer" style="" />footer</
</body>

</html>
http://www.weblinksonline.co.uk/
https://www.weblinksonline.co.uk/updating-joomla.html
"When I'm right no one remembers but when I'm wrong no one forgets".

User avatar
Magicspon
Joomla! Explorer
Joomla! Explorer
Posts: 340
Joined: Sun Jun 11, 2006 10:47 am
Location: Bristol
Contact:

Re: Blank template

Post by Magicspon » Sat Mar 21, 2009 1:06 am

Hello,

Thanks for the reply, top stuff.

I will need to be able to disable the left/right modules so that the main content fills the screen, looking at a template at the moment, can't work out how to get the left module to collapse.

any idea?

thanks

User avatar
Steve
Joomla! Ace
Joomla! Ace
Posts: 1570
Joined: Tue Aug 23, 2005 1:02 pm
Location: Toowoomba
Contact:

Re: Blank template

Post by Steve » Sat Mar 21, 2009 1:55 am

Have you had a look here?
http://docs.joomla.org/Joomla%21_1.5_Template_Tutorial

Taken from the docs:
Module Positions
There is a new way of checking which module positions have content to display on the current page. This logic can be used for collapsible columns (e.g. collapse the left or right column if no content is present). The 1.0.x mosCountModules function has been replaced by the $this->countModules and conditions have been added: you can now use '+', '-', 'or' or 'and', e.g. if ($this->countModules('left or right') == 1).
Found here:
http://docs.joomla.org/New_features_int ... _templates :)
Regards Steve, Developer of Export Content Component:
Component Information site
http://www.bestdownloadsites.com/joomla/export-content
http://www.bestdownloadsites.com

User avatar
Webdongle
Joomla! Master
Joomla! Master
Posts: 44019
Joined: Sat Apr 05, 2008 9:58 pm

Re: Blank template

Post by Webdongle » Sat Mar 21, 2009 12:25 pm

<?php if($this->countModules('left')) : ?>
<div id="1">
<jdoc:include type="modules" name="left" style="" />
else
<?php endif; ?>
<div id="2">
</div>

-----------------
This is what it does

.IF. there are Modules activated in the left position .THEN. use div with id="1" .AND. .DISPLAY. Modules

.ELSE. use div with id="2"

.ENDIF.
close div tag
http://www.weblinksonline.co.uk/
https://www.weblinksonline.co.uk/updating-joomla.html
"When I'm right no one remembers but when I'm wrong no one forgets".

User avatar
Magicspon
Joomla! Explorer
Joomla! Explorer
Posts: 340
Joined: Sun Jun 11, 2006 10:47 am
Location: Bristol
Contact:

Re: Blank template

Post by Magicspon » Sat Mar 21, 2009 1:06 pm

Hello,

thanks for all your help :)

the left module looks like nice at the moment:

Code: Select all

      <div id="left_side">
        <jdoc:include type="modules" name="left" style="xhtml" />
      </div>
I've replaced it with:

Code: Select all

<?php if($this->countModules('left')) : ?>
<div id="1">
<jdoc:include type="modules" name="left" style="left_side" />
else*
<?php endif; ?>
<div id="left_side2">
</div>
*this word appears in the template!

The left module now disappears when no modules are enabled. goal 1 complete.

now my 'mainbody' content doesn't shift to the left.

any ideas?

thanks again
dave

User avatar
Webdongle
Joomla! Master
Joomla! Master
Posts: 44019
Joined: Sat Apr 05, 2008 9:58 pm

Re: Blank template

Post by Webdongle » Sat Mar 21, 2009 7:38 pm

My error
<?php if($this->countModules('left')) : ?>
<div id="left">
<jdoc:include type="modules" name="left" style="" />
</div>
<?php endif; ?>

<?php if($this->countModules('left')) : ?>
<div id="main1">
<jdoc:include type="component" />
</div>

<?php else: ?>
<div id="main2">
<jdoc:include type="component" />
</div>
<?php endif; ?>




-------------------

In your .css

#main1 {
/* define width position etc of main body when left Module showing */
}

#main2 {
/* define width position etc of main body when left Module showing */
}

--------

Left column collapses if no Modules.

Main column picks the div with id depending on left Modules.
-------
You know the logic and the phrasing, play around with various permutations to fit your needs.
http://www.weblinksonline.co.uk/
https://www.weblinksonline.co.uk/updating-joomla.html
"When I'm right no one remembers but when I'm wrong no one forgets".

User avatar
Magicspon
Joomla! Explorer
Joomla! Explorer
Posts: 340
Joined: Sun Jun 11, 2006 10:47 am
Location: Bristol
Contact:

Re: Blank template

Post by Magicspon » Mon Mar 23, 2009 7:48 pm

Hello,

thanks again for the help... problem i now have is that the content stays in the same position, but if you scroll down, the content is duplicated but displayed in the correct position

my css looks like:

Code: Select all

#left_side {
	float: left;
	margin-left: 10px!important;
	margin-left: 5px;
	margin-bottom: 10px;
	width: 183px;
	min-height: 344px;
	background:  url(../images/sidebg.jpg) no-repeat top center;
}

#main2 {
	float: right;
	width: 710px;
	padding-right: 35px
}
#main1 {
	float: right;
	width: 540px;
	padding-right: 10px
}
my index.php looks like this:

Code: Select all

<?php
// no direct access
defined( '_JEXEC' ) or die( 'Restricted access' );
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $this->language; ?>" lang="<?php echo $this->language; ?>" >
<head>
<jdoc:include type="head"  style="xhtml" />
<link rel="stylesheet" href="templates/_system/css/general.css" type="text/css" />
<link rel="stylesheet" href="<?php echo $this->baseurl; ?>/templates/<?php echo $this->template?>/css/template_css.css" type="text/css" />

<link rel="alternate" title="<?php echo $mainframe->getCfg('sitename');?>" href="index2.php?option=com_rss&no_html=1" type="application/rss+xml" />
<link rel="shortcut icon" href="<?php echo $this->baseurl; ?>/templates/<?php echo $this->template?>/favicon.ico" />
</head>
<body>
<div id="top">
  <div class="rights">
    <div id="search">
      <jdoc:include type="modules" name="user4" style="xhtml" />
    </div>
  </div>
  <div class="lefts">
    <div class="padding">
      <h1><?php echo $mainframe->getCfg('sitename');?></h1>
      <h2>site</h2>
    </div>
  </div>
</div>
<div class="content">
<div id="main">
  <div id="topmenu">
    <jdoc:include type="modules" name="user3" style="xhtml" />
  </div>
  <div id="newsflash">
    <div class="left">
      <div class="padding">
        <jdoc:include type="modules" name="top" style="xhtml" />
      </div>
    </div>
  </div>
  <div class="padding">
    <?php if($this->countModules('right')) { ?>
    <div id="mosright">
      <jdoc:include type="modules" name="right" style="xhtml" />
    </div>
    <div id="right_side2">
      <jdoc:include type="component" style="xhtml" />
      <?php } else { ?>
      <div id="right_side_wide">
        <jdoc:include type="component" style="xhtml" />
        <?php } ?>
      </div>
	<?php if($this->countModules('left')) : ?>
			<div id="left_side">
				<jdoc:include type="modules" name="left" style="xhtml" />
					</div>
						<?php endif; ?>
	<?php if($this->countModules('left')) : ?>
			<div id="main1">
				<jdoc:include type="component" />
					</div>
						<?php else: ?>
	<div id="main2">
		<jdoc:include type="component" />
			</div>
				<?php endif; ?>
      <?php if($this->countModules('user5 or user6 or user7')) : ?>
      <div id="modules">
        <div class="mod_user7">
          <jdoc:include type="modules" name="user7" style="table" />
        </div>
        <div class="mod_user5">
          <jdoc:include type="modules" name="user5" style="table" />
        </div>
        <div class="mod_user6">
          <jdoc:include type="modules" name="user6" style="table" />
        </div>
      </div>
      <?php endif; ?>
    </div>
  </div>
  <div id="footer">
    <div class="padding"> Copyright &copy;</div>
  </div>
</div>
<jdoc:include type="modules" name="debug" style="xhtml" />
</body>
</html>
argh!

thanks again
dave

User avatar
Magicspon
Joomla! Explorer
Joomla! Explorer
Posts: 340
Joined: Sun Jun 11, 2006 10:47 am
Location: Bristol
Contact:

Re: Blank template

Post by Magicspon » Tue Mar 24, 2009 12:29 am

Done it! was staring me in the face:

Code: Select all

div class="padding">
    <?php if($this->countModules('right')) { ?>
    <div id="mosright">
      <jdoc:include type="modules" name="right" style="xhtml" />
    </div>
    <div id="right_side2">
      <?php } else { ?>
      <div id="right_side_wide">
        <?php } ?>
      </div>
	  
  <?php if($this->countModules('left')) : ?>
<div id="left_side">
<jdoc:include type="modules" name="left" />
</div>
<?php endif; ?>

<?php if($this->countModules('left')) : ?>
<div id="main1">
<jdoc:include type="component" />
</div>
<?php else: ?>
<div id="main2">
<jdoc:include type="component" />
</div>
<?php endif; ?>

User avatar
Webdongle
Joomla! Master
Joomla! Master
Posts: 44019
Joined: Sat Apr 05, 2008 9:58 pm

Re: Blank template

Post by Webdongle » Tue Mar 24, 2009 3:22 am

Glad you succeded, i managed to find a free Template to fit one of the stites that i am building.
http://www.weblinksonline.co.uk/
https://www.weblinksonline.co.uk/updating-joomla.html
"When I'm right no one remembers but when I'm wrong no one forgets".


Locked

Return to “Templates for Joomla! 1.5”