The Joomla! Forum ™



Forum rules


Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.



Post new topic Reply to topic  [ 10 posts ] 
Author Message
 Post subject: Blank template
PostPosted: Fri Mar 20, 2009 10:54 pm 
User avatar
Joomla! Explorer
Joomla! Explorer

Joined: Sun Jun 11, 2006 10:47 am
Posts: 340
Location: Bristol
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.


Top
 Profile  
 
 Post subject: Re: Blank template
PostPosted: Sat Mar 21, 2009 12:15 am 
User avatar
Joomla! Master
Joomla! Master

Joined: Sat Apr 05, 2008 9:58 pm
Posts: 25005
Location: @Webdongle
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>

_________________
'When I'm right nobody remembers when I'm wrong nobody forgets.'

http://weblinksonline.co.uk/joomla-faq.html


Top
 Profile  
 
 Post subject: Re: Blank template
PostPosted: Sat Mar 21, 2009 1:06 am 
User avatar
Joomla! Explorer
Joomla! Explorer

Joined: Sun Jun 11, 2006 10:47 am
Posts: 340
Location: Bristol
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


Top
 Profile  
 
 Post subject: Re: Blank template
PostPosted: Sat Mar 21, 2009 1:55 am 
User avatar
Joomla! Ace
Joomla! Ace

Joined: Tue Aug 23, 2005 1:02 pm
Posts: 1570
Location: Toowoomba
Have you had a look here?
http://docs.joomla.org/Joomla%21_1.5_Template_Tutorial

Taken from the docs:
Quote:
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_introduced_in_Joomla%21_1.5_templates :)

_________________
Regards Steve, Developer of Export Content Component:
Component Information site
http://www.bestdownloadsites.com/joomla/export-content
http://www.bestdownloadsites.com


Top
 Profile  
 
 Post subject: Re: Blank template
PostPosted: Sat Mar 21, 2009 12:25 pm 
User avatar
Joomla! Master
Joomla! Master

Joined: Sat Apr 05, 2008 9:58 pm
Posts: 25005
Location: @Webdongle
<?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

_________________
'When I'm right nobody remembers when I'm wrong nobody forgets.'

http://weblinksonline.co.uk/joomla-faq.html


Top
 Profile  
 
 Post subject: Re: Blank template
PostPosted: Sat Mar 21, 2009 1:06 pm 
User avatar
Joomla! Explorer
Joomla! Explorer

Joined: Sun Jun 11, 2006 10:47 am
Posts: 340
Location: Bristol
Hello,

thanks for all your help :)

the left module looks like nice at the moment:

Code:
      <div id="left_side">
        <jdoc:include type="modules" name="left" style="xhtml" />
      </div>


I've replaced it with:

Code:
<?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


Top
 Profile  
 
 Post subject: Re: Blank template
PostPosted: Sat Mar 21, 2009 7:38 pm 
User avatar
Joomla! Master
Joomla! Master

Joined: Sat Apr 05, 2008 9:58 pm
Posts: 25005
Location: @Webdongle
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.

_________________
'When I'm right nobody remembers when I'm wrong nobody forgets.'

http://weblinksonline.co.uk/joomla-faq.html


Top
 Profile  
 
 Post subject: Re: Blank template
PostPosted: Mon Mar 23, 2009 7:48 pm 
User avatar
Joomla! Explorer
Joomla! Explorer

Joined: Sun Jun 11, 2006 10:47 am
Posts: 340
Location: Bristol
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:
#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:
<?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&amp;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


Top
 Profile  
 
 Post subject: Re: Blank template
PostPosted: Tue Mar 24, 2009 12:29 am 
User avatar
Joomla! Explorer
Joomla! Explorer

Joined: Sun Jun 11, 2006 10:47 am
Posts: 340
Location: Bristol
Done it! was staring me in the face:

Code:
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; ?>


Top
 Profile  
 
 Post subject: Re: Blank template
PostPosted: Tue Mar 24, 2009 3:22 am 
User avatar
Joomla! Master
Joomla! Master

Joined: Sat Apr 05, 2008 9:58 pm
Posts: 25005
Location: @Webdongle
Glad you succeded, i managed to find a free Template to fit one of the stites that i am building.

_________________
'When I'm right nobody remembers when I'm wrong nobody forgets.'

http://weblinksonline.co.uk/joomla-faq.html


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 10 posts ] 



Who is online

Users browsing this forum: azher75 and 18 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group