JD T3 Framework/FAQs

From JoomlArt Wiki

(Difference between revisions)
Jump to: navigation, search
(Green Theme)
(Red Theme)
Line 1,287: Line 1,287:
&#35;ja-subnav .main { background: #ff0000; }<br />
&#35;ja-subnav .main { background: #ff0000; }<br />
<br />
<br />
-
<span style="color:green">/* Level 3 menu links ---*/<br />
+
<span style="color:green">/* Level 3 menu links ---*/</span><br />
&#35;ja-subnav ul li ul li a:hover {<br />
&#35;ja-subnav ul li ul li a:hover {<br />
color: #ff0000 !important;<br />
color: #ff0000 !important;<br />

Revision as of 10:10, 10 October 2010

{{#customtitle:JD T3 Framework 2.0 for Drupal - Customization FAQs|JD T3 Framework 2.0 for Drupal - Customization FAQs}}

Contents

image:T3_logo_light.png

This section is under construction. Please come back later.

Developing a T3 Framework Template for Drupal

Introduction

Back to top

In this section we are going to show you how to develop a T3 Framework template for Drupal, a step-by-step guide from the developer point of view. Generally we are going to cover:

  • the technical requirements;
  • creating folder structure;
  • prepare and edit files needed to make the new template work as a Drupal Theme;
  • build the default layout and layout variations;
  • build the default theme and theme variations;
  • create the default profile and profile variations;
  • customize the design of the template and themes.

Please note that this template was developed on JD T3 Blank v1.0.1 and JD Engine v1.1.2. Some of the code lines may change in time.

Preparation

Technical Requirements

Back to top

To be able to develop your own template, you will need to prepare:


Create template folder

Back to top

If you are developing on localhost, create a jd_template_name folder (use your desired name here) inside the themes folder. To do that on your livesite, you will need to use your FTP client. You can use whatever template name you want.

Copy general template files

Back to top

The new template will need the basic files to be able to work as a Drupal template. To do that please follow these steps:

  • Browse the t3_blank folder in your themes/t3_blank folder;
  • Copy the following files from this folder to your new template folder:
    • logo.png - we are going to change it later;
    • t3_blank.info
    • template.php
    • theme-settings.php
  • Rename these files according to your template name:
    • logo.png
    • jd_template_name.info (use your desired name here)
    • template.php
    • theme-settings.php

Create template file and folder structure

Back to top

To override the basic design of the base theme and to make it work as a T3 Framework Template, you will need to have a correct structure. To do that, please create a folder structure inside the jd_template_name folder as presented below, or copy the files and folders from jd_t3_blank template:
image:JD-T3_Structure_template-name-structure.jpg

Please note that you can create these blank CSS and XML files, but we recommend you to copy these files from jd_t3_blank template to ease and speed up the process.

Adjust template info file

Back to top

The new template is ready to go, it only needs to have it's own information. To do that, you have to adjust the jd_template_name.info file (use your desired name here) as follows:

  • replace "t3_blank" with "jd_template_name" (use your desired name here)
  • add a slideshow region under the mainnav region
  • replace all other information to your convenience, see our example below

; $Id: garland.info,v 1.5 2007/07/01 23:27:32 goba Exp $
name = JD Template Name
description = JD Template Name for Drupal
version = 1.0
core = 6.x
engine = joomlart

regions[top-panel]=top-panel
regions[header]=header
regions[mainnav]=mainnav
regions[slideshow]=slideshow
regions[subnav]=subnav
regions[search]=search
regions[user1]=user1
regions[user2]=user2
regions[user3]=user3
regions[user4]=user4
regions[user5]=user5
regions[top]=top
regions[user6]=user6
regions[user7]=user7
regions[user8]=user8
regions[user9]=user9
regions[user10]=user10
regions[breadcrum]=breadcrum
regions[footer]=footer
regions[left]=left
regions[left_mass_top]=left-mass-top
regions[left_mass_bottom]=left-mass-bottom
regions[right]=right
regions[right_mass_top]=right-mass-top
regions[right_mass_bottom]=right-mass-bottom
regions[footnav]=Foot Navigation

; Information added by drupal.org packaging script on 2009-12-16
version = "6.15"
project = "drupal"
datestamp = "1260996916"



Enable and set the new template as default

Back to top

To be able to customize the template, you will have to set it as default template, so to do so, please go to your site administration section - themes, and follow these steps:
image:JDT3-enable-template.jpg

  • Step 1 - find the JD Template Name template and check Enabled check box;
  • Step 2 - click the Default radio button for JD Template Name;
  • Step 3 - click the Save configuration button to save changes.


Enable Development Mode

Back to top

Now you have to make sure your customizations are applied instantly every time you change the code or images, so you have to disable the template cache by enabling the development mode. To do that, you must browse the Themes Panel - Configure, select JD_Template_Name, and then follow these steps:
image:JDT3_Template-devmode.jpg

  • Step 1 - click to open the System settings and select Yes for the Enable Development Mode option;
  • Step 2 - click the Save configuration button.

Now you can start customizing your new template as it is ready.
Please note that you have to clear the Drupal core cache and also disable it on the entire process of template development.

Building the default layout

Back to top

Core template layouts are stored in jd_template_name/core/layouts folder. If you have copied the files and folders from jd_t3_blank, you can skip this step. Else, we will build the default layout having 3 columns: Left - main - Right in main content. You must edit this file with a code editor outside the template administration - layouts panel - layouts editor.

For this design, we could use this configuration:

  • TOP:
    • header
    • mainnav
    • slideshow (we are using a sample module to fill that region)
    • top spotlight
  • MIDDLE:
    • left
    • main content body
    • right (rounded)
  • BOTTOM:
    • bottom spotlight
    • navhelper
    • footer

With these blocks, the default layout XML file (default.xml) will look like this:

<?xml version="1.0" encoding="utf-8"?>
<layout name="desktop">

   <blocks name="top" style="xhtml">
       <block name="header" type="header" main-inner="1"></block>
       <block name="mainnav" type="mainnav"  main-inner="1"></block>
       <block name="cpanel" type="usertools/cpanel"></block>
       <block name="slideshow" type="modules" style="raw">slideshow</block>
       <block name="topsl" type="spotlight">user1,user2,user3,user4,user5</block>
   </blocks>
   <blocks name="middle" colwidth="20" fixheight="1">
       <block name="left1">left</block>
       <block name="inset2" style="rounded">right</block>
   </blocks>
   <blocks name="bottom" style="xhtml">
       <block name="botsl" type="spotlight">user6,user7,user8,user9,user10</block>
       <block name="navhelper" type="navhelper" main-inner="1"></block>
       <block name="footer" type="footer"></block>
   </blocks>

</layout>


Save above XML into jd_template_name/core/layouts/default.xml, then refresh the page to test the layout change.

Building the default theme

Back to top

The default theme of the template has a higher priority than the core styling. The best thing to do is to use the default theme from the jd_t3_blank template and customize it for your needs.

For our example here, we are going to modify this theme to recreate the jd_purity template design, so in the following sections we are going to show you a step by step guide on the customization techniques.

Theme information

Back to top

Before developing the default style for our template (default theme) we have to edit the info.xml file. Use your information in this file, here an example:

<?xml version="1.0" encoding="utf-8"?>
<theme engine="joomlart">
<name>JD Template Name</name>
<description>Default theme for JD User Template</description>
<date>October 2010</date>
<version>1.0.0</version>
<author>JoomlArt</author>
<copyright>JoomlArt</copyright>
</theme>



Main style

Back to top

So we are starting customization with the default theme, layout, settings of the JD T3 Blank Template, the best & fast way to do it! We are going to recreate the JD Purity Template in a step-by-step, before & after presentation, with code changes, tips & tricks, easy do!
Now it would be a good thing for you to have an idea on how to work with Firebug extension for Mozilla Firefox. Click here to learn how to use it. In this section we are going to change the styling inside the jd_template_name/css/template.css file.
Please note that we are not going to insist on all design details, as this stands as a basic instructions set, generally applied to all JD T3 Framework Templates. You will learn what are the files you need to modify to recreate the JD Purity Template design.

If the line number don't match because the code changes, DON'T PANIC! Search for style rules!
Example: #ja-header .main

The Header

Back to top

This element will need to be higher in order to make room for a larger logo image. So please open jd_template_name/css/template.css and find line 444:

#ja-header .main { background: #fff; padding: 15px 0;}


and replace with

#ja-header .main { background: #fff; padding: 0; height: 80px;}



The Default Logo

Back to top

To use the JD Purity logo, we will replace the logo in the jd_template_name folder with the one in the jd_purity folder, and update the template.css, line 449:

h1.logo, h1.logo a { height: 30px; width: 210px; }


replace with:

h1.logo, h1.logo a { height: 66px; width: 235px; }


image:JDT3_Template-customization_header.jpg
This image show changes for the header styling also.

The Search Module

Back to top

We will customize the field of the search form for normal and hover & focus state. First let's add and the search icon, so find line 422:

#ja-search {
position: absolute;
bottom: 25px;
right: 0;
}


replace with:

#ja-search {
position: absolute;
bottom: 25px;
right: 0;
background: url(../images/search-sm.gif) no-repeat left center; /*you will need to copy this image from images folder of JD Purity */
padding-left: 20px;
}



Then find line 422 to add some background-color to the search form field:

#ja-search .form-text { font-weight: bold; }


replace with:

#ja-search .form-text { font-weight: bold; background: #f6f6f6; color:#555; }
#ja-search .form-text:hover, #ja-search .form-text:focus {width:150px;} /*this will fix the width of the field on hover & focus if you want */



The form-submit of the search will also need some styling, so please add after this last line this one:

#ja-search .form-submit {
background: #0088CC;
border: 1px solid #0370a6;
color: #fff;
padding: 1px 5px;
font-weight:bold;
}


image:JDT3_Template-customization_search.jpg

Navigation bar styling

Back to top

Please find line 476 in the template.css:

#ja-mainnav .main { border-top: 1px solid #ccc; border-bottom: 1px solid #ccc; }


and replace with:

#ja-mainnav .main { background: #333; }


image:JDT3_Template-customization_mainnav.jpg

The spotlights

Back to top

TOP STOPLIGHT
First we will add a background-color and a text-color for the ja-topsl .main div, so find line 707:

#ja-topsl .main {
border-bottom: 1px solid #ccc;
padding: 15px 0;

}


replace with:

#ja-topsl .main {
border-bottom: 0;
padding: 15px 0;
background: #333;
color: #ccc;

}


image:JDT3_Template-customization_topsl.jpg

BOTTOM SPOTLIGHT
Next we will do same thing for ja-botsl .main div, so find line 727:

#ja-botsl .main {
border-top: 1px solid #ccc;
padding: 15px 0;
}


and replace with:

#ja-botsl .main {
border-top: 1px solid #ccc;
padding: 15px 0;
background: #333;
color: #ccc;
}


image:JDT3_Template-customization_botsl.jpg


The Container

Back to top

This div class is defined in the middle.php macro block for main content body, left block and right block. This element will need a border so find line 445:

#ja-container .main { min-height: 300px;}


replace with:

#ja-container .main { min-height: 300px; border:1px solid #CDCDCD; padding:0;}



The Content Body

Back to top

This is where the inset2 (main body + right) blocks are displayed, so in right below the code we have updated above (line 445), let's add this code:

/* MAIN COLUMN */
#ja-main .inner {
padding-left: 10px;
padding-right: 10px;
}

.ja-content-main {
padding:20px 15px;
}



The Pathway

Back to top

This block will need some background-color and some border-left & border-right, so please find line 535:

#ja-navhelper .main { padding-top: 7px; border-top: 1px solid #ccc; }


and replace with:

#ja-navhelper .main {
padding-top: 7px;
border-top: 0;
background: #f6f7f8;
border-right: 1px solid #cdcdcd;
border-left: 1px solid #cdcdcd;
}


image:JDT3_Template-customization_pathway.jpg

The Content Links

Back to top

To customize the general styling for links, we will edit line 22:

a { color: #069; text-decoration: none; }


replace with:

a { color: #0088CC; text-decoration: none; }




The Middle Block

Back to top

We will customize all blocks of the middle.php block, so we will start with the left.php. To match the styling of the original JD Purity Template, we will edit the HEADING 2 of the XTML modules, so find line 390:

div.ja-block h2, div.block h2 {
font-family: Helvetica, Arial, sans-serif;
color: #333;
font-size: 100%;
margin: 0;
padding: 0 0 5px;
overflow: hidden;
text-transform: uppercase;
border-bottom: 1px solid #ccc;

}

and replace with:

div.ja-block h2, div.block h2 {
font-family: Helvetica, Arial, sans-serif;
color: #333;
font-size: 100%;
margin: 0;
padding: 8px 15px; documentation edit
overflow: hidden;
text-transform: uppercase;
border-bottom: 1px solid #ccc;
background:#e6e6e6;

}


Next we are going to add some general styling for block modules (changing margin, adding a border and some padding) so find line 402:

div.ja-block, div.block { margin-bottom: 20px; }


replace with:

div.ja-block .block-content, div.block .block-content { margin: 0; border-bottom: 1px solid #cdcdcd; padding:15px;}



We will continue adding additional styling to the left.php block (still editing XHTML style), so after line 402, paste this code:

/* Left Block additional styling */
#ja-left, #ja-left1 { background: url(../images/dot-1.gif) repeat-y right; } /* adding 1px border image */
#ja-left .ja-block, #ja-left .block {margin:0 1px 0 0;}/* matching the margin */



Next we will add the corresponding XHTML styling for right.php block, so below the styling we have pasted for left.php XHTML styling, paste this code:

/* Right Block additional styling */
#ja-right, #ja-right2 { background: url(../images/dot-1.gif) repeat-y left; }/* adding 1px border image */
#ja-right .ja-block, #ja-right .block { margin:0 0 0 1px;}/* matching the margin */



Next we will need to adjust the menu styling in XHTML styling blocks, so find line 502:

.ja-colswrap ul.menu { /* minus the padding for menu in column area */
margin-top: -5px;

}

replace with:

.ja-colswrap ul.menu { /* minus the padding for menu in column area */
margin: -15px;

}

Still for the menus, we will need to adjust the text-indentation so please find line 519:

ul.menu li a {
display: block;
outline: none;
padding: 6px 0;
text-decoration: none;
text-indent: 8px;
white-space: nowrap; width: 100%;

}

replace with:

ul.menu li a {
display: block;
outline: none;
padding: 6px 0;
text-decoration: none;
text-indent: 15px;
white-space: nowrap;
width: 100%;

}


Next we will style the default rounded block modules so copy these images from JD Purity Template into the jd_template_name/images:

  • b-tl.gif, b-tr.gif, b-bl.gif, b-br.gif
  • paste this code into template.css right after the /* Right Block additional styling */ coding style (around line 424):

/* Default Rounded Block */
/* rounded module heading */
div.ja-block-rounded h2, div.block-rounded h2 {
border-bottom: 1px solid #cdcdcd;
color: #333;
font-size: 100%;
font-weight: bold;
margin: 0 -15px 10px;
padding: 8px 15px;
text-transform: uppercase;
}

/* rounded module margin adjustments */
div.ja-block-rounded, div.block-rounded {
margin: 20px 10px !important;
position: relative;
overflow: hidden;
}

/* bottom-right corner image*/
.ja-box-br {
background: url(../images/b-br.gif) no-repeat bottom right #fff;
}

/* bottom-left corner image */
.ja-box-bl {
background: url(../images/b-bl.gif) no-repeat bottom left;
}

/* top-right corner image */
.ja-box-tr {
background: url(../images/b-tr.gif) no-repeat top right;
}

/* top-left corner image */
.ja-box-tl {
background: url(../images/b-tl.gif) no-repeat top left;
padding: 0 15px 10px;

}


Let's preview changes for the middle.php block styling:

image:JDT3_Template-customization_middle.jpg


Bottom Navigation

Back to top

First let's customize the active menu items, so find line 666:

ul.menu li.leaf a.active {
background: #333;
}


and replace with:

ul.menu li.leaf a.active {
background: none;
color:#333;
}



Next we will customize the ja-footnav div, so find line 846:

/* Foot Links ---*/



and add above it:

#ja-footer .ja-footnav {
border:1px solid #CDCDCD; /*we need a border */
background:#F6F6F6; /*some background-color */
margin:0 0 10px; /* and change the margin */

}


Finally, let's change the menu styling so find lines 846-853:

/* Foot Links ---*/
.ja-footnav ul.menu { text-align: center;}

.ja-footnav ul.menu li { border: none; display: inline; }

.ja-footnav ul.menu li.first {}

.ja-footnav ul.menu li a { padding: 0 5px; line-height: 1; text-decoration: none; border: none; }


and replace with

/* Foot Links ---*/
.ja-footnav ul.menu { /* no styling */}

.ja-footnav ul.menu li { border-left:1px solid #999; border-bottom:0; display: inline; }

.ja-footnav ul.menu li.first {border:0;}

.ja-footnav ul.menu li a { padding: 0 10px; line-height: 1; text-decoration: none; border: none;}


Let's preview changes:
image:JDT3_Template-customization_footnav.jpg


Customizing the menu systems

Mega Menu

Back to top

First we will customize the level0 (root) menu items: normal, hover and active menu items, so please open jd_template_name/css/menu/mega.css find line 15:

.ja-megamenu a.over, .ja-megamenu a.active { color: #333 !important; }


replace with :

/* general styling for active items */
.ja-megamenu a.over, .ja-megamenu a.active { color: #fff !important; }

/* level0 normal items
-----------------------------------*/
.ja-megamenu ul.level0 li.mega a.mega {
color: #cdcdcd;
border-right: 1px solid #666;
}

/* level0 hovered items */
.ja-megamenu ul.level0 li.over, ul.level0 li.haschild-over {
background-color: #4f4f4f;
}

.ja-megamenu ul.level0 li.over a.mega, ul.level0 li.haschild-over a.mega {
color: #fff;
}

/* level0 active items */
.ja-megamenu ul.level0 li.active {
background-color: #08c;
}



Next, let's go ahead and customize the level1 and above menu items styling, so find lines 36-45:

/* lv - 1 and below
-----------------------------------*/
/* Styling ---*/
.ja-megamenu ul.level1 li.mega { border-top: 1px dotted #ccc; }

.ja-megamenu ul.level1 li.first { border-top: 0; }

.ja-megamenu ul.level1 li.mega a.mega {
border: 0;

}

replace with:

/* lv - 1 and below
-----------------------------------*/
/* Styling ---*/
/* fixing border ---*/
.ja-megamenu ul.level1 li.mega { border-top: 1px dotted #666; }

.ja-megamenu ul.level1 li.first { border-top: 0; }

.ja-megamenu ul.level1 li.mega a.mega {
border: 0;
}

/* hovered menu items */
.ja-megamenu ul.level1 li.over, ul.level1 li.haschild-over {
background: #333;

}


Finally we are going to style the child content, so find lines 47-79:

/* CHILD CONTENT
-----------------------------------*/
.ja-megamenu .childcontent-inner {
background: #fff;
border: 1px solid #ccc;
border-top: 0;
color: #333;
}

.ja-megamenu .level1 .childcontent-inner { border-top: 1px solid #ccc; }

.ja-megamenu .childcontent .ja-moduletable { color: #333; }

.ja-megamenu .childcontent .ja-moduletable h3 {
background: none;
border-bottom: 1px dotted #ccc;
text-transform: uppercase;
}

/* Grouped --- */
.ja-megamenu .group-title { border-bottom: 1px solid #ccc; }

.ja-megamenu .group-title .menu-title {
color: #333;
text-transform: uppercase;
font-weight: bold;
font-size: 115%;
}

.ja-megamenu .group-title .menu-desc {
color: #999;
padding-left: 0 !important;
}


and replace with:

/* CHILD CONTENT
-----------------------------------*/
.ja-megamenu .childcontent-inner {
background: #4f4f4f;
border: 1px solid #333;
border-top: 0;
color: #fff;
}

.ja-megamenu .level1 .childcontent-inner { border-top: 1px solid #333; }

.ja-megamenu .childcontent .ja-moduletable { color: #fff; }

.ja-megamenu .childcontent .ja-moduletable a {
color: #fff;
border-bottom: 1px dotted #fff;
}

.ja-megamenu .childcontent .ja-moduletable h3 {
background: none;
border-bottom: 1px dotted #666;
text-transform: uppercase;
}

.ja-megamenu .childcontent .ja-block .block-content {
border-bottom:1px solid #666666;
}

/* content links */
.ja-megamenu .childcontent a {color:#08c;}
.ja-megamenu .childcontent a:hover {color:#ccc;}

/* Grouped --- */
.ja-megamenu .group-title { border-bottom: 1px solid #666; }

.ja-megamenu .group-title .menu-title,
.ja-megamenu .over .group-title a {
color: #fff;
text-transform: uppercase;
font-weight: bold;
background: none;
}

.ja-megamenu .group-title .menu-desc {
color: #fff;
padding-left: 0 !important;
}



Let's preview the changes:

image:JDT3_Template-customization_mega.jpg

Split Menu

Back to top

First we will customize the common styling of ja-subnav div for both Split Menu and Dropline Menu, so please open jd_template_name/css/template.css and find line 538:

#ja-subnav .main { background: #ccc; border-bottom: 1px solid #ccc; }

#ja-subnav ul li a { color: #333; text-decoration: none; }


replace with

#ja-subnav .main { background: #08c; border-bottom: 0; }

#ja-subnav ul li a { color: #fff !important; text-decoration: none; }



Next we will customize the level0 (root) active menu items, so please open jd_template_name/css/menu/split.css find line 15:

#ja-splitmenu li.active a,
#ja-splitmenu li.active a:hover,
#ja-splitmenu li.active a:active,
#ja-splitmenu li.active a:focus {
background: #ccc;
color: #333;
}


replace with:

#ja-splitmenu li.active a,
#ja-splitmenu li.active a:hover,
#ja-splitmenu li.active a:active,
#ja-splitmenu li.active a:focus {
background: #08c;
color: #fff;
}



At the end of the file please paste this code:

/* normal menu items */
#ja-splitmenu a {
border-right: 1px solid #666;
color: #cdcdcd;
}

/* hovered menu items */
#ja-splitmenu a:hover,
#ja-splitmenu a:active,
#ja-splitmenu a:focus {
color: #fff;
background: #555;

}


Let's preview the changes:

image:JDT3_Template-customization_split.jpg

Dropline Menu

Back to top

In the previous chapter we have edited some common styling for both Split Menu and Dropline Menu, now we can edit the specific styling for the second one. So let's open jd_template_name/css/menu/dropline.css, line 15:

#jasdl-mainnav li.active a,
#jasdl-mainnav li.active a:hover,
#jasdl-mainnav li.active a:active,
#jasdl-mainnav li.active a:focus {
background: #ccc;
color: #333;
}


replace with:

/* normal menu items*/
#jasdl-mainnav a {
border-right: 1px solid #666;
color: #cdcdcd;
}

/* all hovered menu items*/
#jasdl-mainnav a:hover,
#jasdl-mainnav ul li.hover a {
background: #555;
color: #fff;
}

/* hovered, active and focused menu items*/
#jasdl-mainnav li.active a,
#jasdl-mainnav li.active a:hover,
#jasdl-mainnav li.active a:active,
#jasdl-mainnav li.active a:focus {
background: #08c;
color: #fff;
}


This menu system looks the same as the previous so please check the preview here.

CSS Menu

Back to top

First we will customize the style for root items, so open the jd_template_name/css/menu/css.css find lines 26-32:

/* 1st level */
#ja-cssmenu li a.active,
#ja-cssmenu li a.active:hover,
#ja-cssmenu li a.active:active,
#ja-cssmenu li a.active:focus {
color: #333;

}

replace with:

/* 1st level */
/* normal menu items */
#ja-cssmenu li a {
color: #cdcdcd;
border-right: 1px solid #666;
}

/* general styling for active, hovered and focused menu items */
#ja-cssmenu li a:hover,
#ja-cssmenu li a:active,
#ja-cssmenu li a:focus,
#ja-cssmenu li a.sfhover {
color: #fff;
}

/* hovered menu items */
#ja-cssmenu li:hover,
#ja-cssmenu li.sfhover,
#ja-cssmenu li.havechildsfhover,
#ja-cssmenu li.havechild-activesfhover {
background-color: #555;
}

/* general styling for .active class menu items */
#ja-cssmenu li a.active,
#ja-cssmenu li a.active:hover,
#ja-cssmenu li a.active:active,
#ja-cssmenu li a.active:focus {
background-color: #08c;
color: #fff;

}


Next we will customize all other levels menu items, so find lines 54-68:

/* 2nd level and above */
#ja-cssmenu li ul {
border: 1px solid #ccc;
border-top: 0;
background: #fff;
}

#ja-cssmenu li ul ul {
border-top: 1px solid #ccc;
}

#ja-cssmenu li ul li {
border-bottom: 1px solid #ccc;
background: none;

}


replace with:

/* 2nd level and above */
/* list items styling */
#ja-cssmenu li ul {
border: 1px solid #333;
border-top: 0;
background: #4f4f4f;
}

#ja-cssmenu li ul ul {
border-top: 1px solid #333;
}

#ja-cssmenu li ul li {
border-bottom: 1px solid #666;
background: none;
}

/* general styling for active and hovered menu items */
#ja-cssmenu li ul a:hover,
#ja-cssmenu li ul a:active,
#ja-cssmenu li ul a:focus,
#ja-cssmenu ul li:hover,
#ja-cssmenu ul li.sfhover,
#ja-cssmenu ul li.havesubchildsfhover,
#ja-cssmenu ul li.havesubchild-activesfhover,
#ja-cssmenu ul ul li:hover,
#ja-cssmenu ul ul li.sfhover,
#ja-cssmenu ul ul li.havesubchildsfhover,
#ja-cssmenu ul ul li.havesubchild-activesfhover {
background: #333;

}


Let's preview the changes!

image:JDT3_Template-customization_css.jpg


Create your own blocks

Back to top

For the purpose of this documentation, we have created the slideshow block in the default layout (click here to view the complete code):

<block name="slideshow" type="modules" style="raw">slideshow</block>



Now, the jd_template_name.info file defines the new slideshow region (same thing with layout position), click here to see entire code, so this will be recognized as ja-slideshow div, so this way we can style it, so go ahead and open jd_template_name/css/template.css and add the following styling just at the bottom of the file:

#ja-slideshow { overflow: hidden; }

#ja-slideshow .main {
border-top: 1px solid #fff;
border-bottom: 1px solid #fff;
}



We have created a sample block module and we assigned it to the slideshow region, and let's see what we have done! image:JDT3_Template-customization_slideshow.jpg

DIY Example

  • Go to the Layouts panel;
  • Clone the default layout (use your own layout name)
  • Create a new block (sample code below)
    <block name="your-block-name" type="modules" style="see_info_below">your-block-name</block>

    • your-block-name - really use what ever name you want
    • the block will be rendered according to the order within the other blocks
    • the style is set into the blocks/tpl folder, read more here
  • Edit the jd_template_name.info file and add the new region (see sample code below)
    regions[your-block-name]=your-block-name

    • use the same region name as for your-block-name
    • the order of this new region within all others does not affect layout in any way, it just reflects the order within the region select box for configuring block modules
  • add proper styling to the block using the #ja-your-block-name {} class rule
  • Have fun!



Create your own block style

Back to top

For more satisfactory block module styling, T3 Framework for Drupal allows you to create your own block style very easy. Here is an example on how to create your own:

  • in the jd_template_name/blocks/tpl folder (create this folder structure if you don't already have it) create a new file called block-your_style_name.tpl.php
  • open it with your favorite code editor and paste inside this code, and update accordingly:

<div id="block-<?php print $block->module .'-'. $block->delta; ?>" class="your_class block-<?php print $block->module ?> <?php if ($block->class_sfx) print "block-your_style_name".$block->class_sfx; ?> clearfix">
<!-- add your div structure here -->
<?php if (!empty($block->subject)): ?>
<h2><?php print $block->subject ?></h2>
<?php endif;?>
<div class="block-content clearfix"><?php print $block->content ?></div>
<!-- end your div structure here -->
</div>


  • next, you can configure your layouts to use this new style for any of the blocks.
    Example:
    <block name="top" style="your_style_name">top</block>



Styling block style suffixes

Back to top

Let's fill the Who's online module with some color, and for that we are going to set a -blue (minus-blue) class suffix in the template administration panel, so click here to find out how.
To style this class suffix, please follow this quick guide:

  • copy the files bb-tl.gif (block-blue-top-left), bb-tr.gif (block-blue-top-right), bb-bl.gif (block-blue-bottom-left), bb-br.gif (block-blue-bottom-right) image files from jd_purity/images folder into jd_template_name/images folder;
  • open jd_template_name/css/template.css, and paste this code at the end of the file:

/* Block Rounded Blue */
.block-rounded-blue .ja-box-bl h2 {
border-bottom: 1px solid #48aada;
color: #fff;
}

.block-rounded-blue {
background: url(../images/bb-br.gif) no-repeat bottom right #0088cc;
}

.block-rounded-blue .ja-box-bl {
background: url(../images/bb-bl.gif) no-repeat bottom left;
}

.block-rounded-blue .ja-box-tr {
background: url(../images/bb-tr.gif) no-repeat top right;
}

.block-rounded-blue .ja-box-tl {
background: url(../images/bb-tl.gif) no-repeat top left;
padding: 0 15px 10px;
}

.block-rounded-blue .ja-box-tl a {color:#fff;}

.block-rounded-blue .item-list ul li {
background:url(../images/bullet2.gif) no-repeat scroll left 6px transparent;

}


Let's have a look now!
image:JDT3_Template-customization_blue-module.jpg
Please note that this class suffix only works for modules within rounded styled blocks.



Extra layouts

Main-Left-Right Layout

Back to top

To create a new core layout, please follow these steps:

  • Step 1 - Browse the your_site/sites/all/themes/joomlart/jd_template_name/core/layouts folder.
  • Step 2 - Create an empty file called main-left-right.xml.
  • Step 3 - Edit it with your favorite code editor and paste this code inside

<?xml version="1.0" encoding="utf-8"?>
<layout name="desktop">
<blocks name="middle" colwidth="20">
<block name="right1">left</block>
<block name="right2">right</block>
</blocks>
</layout>


As you can see, this layout only needs to override the layout positions for left and right blocks, no need to duplicate the rest of the layout code.

Left-Right-Main Layout

Back to top

To create this type of layout, please follow these steps:

  • Step 1 - Inside the your_site/sites/all/themes/joomlart/jd_template_name/core/layouts folder.
  • Step 2 - Create an empty file called left-right-main.xml.
  • Step 3 - Edit it with your favorite code editor and paste this code inside

<?xml version="1.0" encoding="utf-8"?>
<layout name="desktop">
<blocks name="middle" colwidth="20">
<block name="left1">left</block>
<block name="left2">right</block>
</blocks>
</layout>





Left-Right-Main-All-Rounded Layout

Back to top

To create this type of layout, please follow these steps:

  • Step 1 - Inside the your_site/sites/all/themes/joomlart/jd_template_name/core/layouts folder.
  • Step 2 - Create an empty file called left-right-main-all-rounded.xml.
  • Step 3 - Edit it with your favorite code editor and paste this code inside

<?xml version="1.0" encoding="utf-8"?>
<layout name="desktop">
<blocks name="middle" colwidth="20" style="rounded">
<block name="inset1">left</block>
<block name="inset2">right</block>
</blocks>
</layout>




Extra themes

Green Theme

Back to top

Let's create the basic file & folder structure for a new core theme first. In the jd_template_name/core/themes folder, create a new folder green. Inside this new folder, you will need this file & folder structure:

  • css
    • menus
      • css.css - empty file
      • dropline.css - empty file
      • mega.css - empty file
      • split.css - empty file
  • info.xml - empty file
  • logo.png - edit this image according to the theme color


Now let's edit the info.xml file

<?xml version="1.0" encoding="utf-8"?>
<theme engine="joomlart">
<name>Green</name>
<description>Green Theme for JD Template Name</description>
<date>October 2010</date>
<version>1.0.0</version>
<author>JoomlArt</author>
<copyright>JoomlArt</copyright>
</theme>



Now we will override some styling of the default theme, so open the jd_template_name/core/themes/green/css/template.css file with your favorite code editor and paste this code inside:

/* Normal links ---*/
a { color: #10a600; }

/* Search button ---*/
#ja-search .form-submit {background: #10a600; border: 1px solid #0d8f00; }

/* Subnav ---*/
#ja-subnav .main { background: #10a600; }

/* Level 3 menu links ---*/
#ja-subnav ul li ul li a:hover {
color: #10a600 !important;
}



Next we will edit the jd_template_name/core/themes/green/css/menus/mega.css file to customize the Mega Menu system, and paste this code inside:

.ja-megamenu ul.level0 li.active {
background-color: #10a600;
}

.ja-megamenu .childcontent .ja-block a {
color: #10a600;

}


Next we will edit the jd_template_name/core/themes/green/css/menus/dropline.css file to customize the Dropline Menu system, and paste this code inside:

#jasdl-mainnav li.active a,
#jasdl-mainnav li.active a:hover,
#jasdl-mainnav li.active a:active,
#jasdl-mainnav li.active a:focus {
background: #10a600;
color: #fff;
}



Next we will edit the jd_template_name/core/themes/green/css/menus/css.css file to customize the CSS Menu system, and paste this code inside:

#ja-cssmenu li a.active,
#ja-cssmenu li a.active:hover,
#ja-cssmenu li a.active:active,
#ja-cssmenu li a.active:focus {
background-color: #10a600;
color: #fff;
}



Finally we will edit the jd_template_name/core/themes/green/css/menus/split.css file to customize the Split Menu system, and paste this code inside:

#ja-splitmenu li.active a,
#ja-splitmenu li.active a:hover,
#ja-splitmenu li.active a:active,
#ja-splitmenu li.active a:focus {
background: #10a600;
color: #fff;
}



Next you can assign this theme to a new profile, click here to continue now.



Red Theme

Back to top

Similarly we will create the basic file & folder structure for the Red core theme first. In the jd_template_name/core/themes folder, create a new folder red. Inside this new folder, you will need same file & folder structure:

  • css
    • menus
      • css.css - empty file
      • dropline.css - empty file
      • mega.css - empty file
      • split.css - empty file
  • info.xml - empty file
  • logo.png - edit this image according to the theme color


Now let's edit the info.xml file

<?xml version="1.0" encoding="utf-8"?>
<theme engine="joomlart">
<name>Red</name>
<description>Red Theme for JD Template Name</description>
<date>October 2010</date>
<version>1.0.0</version>
<author>JoomlArt</author>
<copyright>JoomlArt</copyright>
</theme>



Now we will override some styling of the default theme, so open the jd_template_name/core/themes/red/css/template.css file with your favorite code editor and paste this code inside:

/* Normal links ---*/
a { color: #ff0000; }

/* Search button ---*/
#ja-search .form-submit {background: #ff0000; border: 1px solid #d70606; }

/* Subnav ---*/
#ja-subnav .main { background: #ff0000; }

/* Level 3 menu links ---*/
#ja-subnav ul li ul li a:hover {
color: #ff0000 !important;
}



Next we will edit the jd_template_name/core/themes/red/css/menus/mega.css file to customize the Mega Menu system, and paste this code inside:

.ja-megamenu ul.level0 li.active {
background-color: #ff0000;
}

.ja-megamenu .childcontent .ja-block a {
color: #ff0000;

}


Next we will edit the jd_template_name/core/themes/red/css/menus/dropline.css file to customize the Dropline Menu system, and paste this code inside:

#jasdl-mainnav li.active a,
#jasdl-mainnav li.active a:hover,
#jasdl-mainnav li.active a:active,
#jasdl-mainnav li.active a:focus {
background: #ff0000;
color: #fff;
}



Next we will edit the jd_template_name/core/themes/red/css/menus/css.css file to customize the CSS Menu system, and paste this code inside:

#ja-cssmenu li a.active,
#ja-cssmenu li a.active:hover,
#ja-cssmenu li a.active:active,
#ja-cssmenu li a.active:focus {
background-color: #ff0000;
color: #fff;
}



Finally we will edit the jd_template_name/core/themes/red/css/menus/split.css file to customize the Split Menu system, and paste this code inside:

#ja-splitmenu li.active a,
#ja-splitmenu li.active a:hover,
#ja-splitmenu li.active a:active,
#ja-splitmenu li.active a:focus {
background: #ff0000;
color: #fff;
}



Similarly you can assign this theme to a new profile, click here to continue now.



Building the default profile

Back to top

If you have copied files from jd_t3_blank, please edit the default.xml accordingly:

menu_style = mega
menu = menu-jd-links
option_font = 1
option_layouts = 1
option_menu = 1
option_profiles = 1
option_screen = 1
option_t3logo = 1
setting_font = 3
setting_screen = fixed
layout_handheld = handheld
layout_iphone = iphone
layout_desktop = default
setting_specialwidth = 950px
block[428] = -blue


The last setting is required for the suffix class we have styled in this section.

Building profile variations

Back to top



End User Customization

This section explores the template end-user customization procedures. Generally here you will learn how to customize the logo, modules styling, user created layouts, user created themes and user custom settings.
All user created themes and uploaded via the administration panel, and all user created custom layouts and blocks must use the local folder, so users can easily update the core plugin and template, without losing any customizations.

Customizing the logo

Back to top



Customizing the search module

Back to top



Customizing the content links

Back to top



Customizing the Read-more link

Back to top



Using custom width for LEFT or RIGHT blocks

Back to top

In some cases you may want to use a custom width for left or right column. To do that you have to edit your desired layout, or all layouts in case you want to apply this change for all layouts.
For instance let's override the width of the right column to be 25% wide. With the internal editor, open this layout and change the code like this:

<block name="left1">left</block> <block name="right1" width="25">right</block>


This will increase the width of the right column and decrease the width of the content body and left column. To find out more about this block attribute, click here. To learn how to edit layouts in back-end, click here.

Styling custom block styles

Back to top



Customizing block class suffixes

Back to top





image:Drupal-128.png

JD T3 Framework 2.0 for Drupal Resources
Overview | Developer Guides | Customization FAQs | Navigation | Copyright


image:Joomla-128.png

JA T3 Framework 2.0 for Joomla! Resources
Overview | Developer Guides | Customization FAQs | Navigation | Copyright

Personal tools