SlideShare una empresa de Scribd logo
1 de 130
TEMPLATING THE RIGHT WAY


                   by Jonathan Shroyer
                           Twitter: @learncss
              Email: jonathan@corephp.com
               by Jonathan Shroyer
TEMPLATE
 BASICS
DID YOU KNOW?
DID YOU KNOW?




Tables are for tabular
data... not for layouts
PROPER HEADINGS
PROPER HEADINGS

• H tags are possibly most important for SEOs
PROPER HEADINGS

• H tags are possibly most important for SEOs

• One H1 per page
PROPER HEADINGS

• H tags are possibly most important for SEOs

• One H1 per page

• Opening page H1 should be company name
  and tagline/short description.
PROPER HEADINGS

• H tags are possibly most important for SEOs

• One H1 per page

• Opening page H1 should be company name
  and tagline/short description.

• H1 tags on all inner pages should be article
  title.
PROPER HEADINGS

• H tags are possibly most important for SEOs

• One H1 per page

• Opening page H1 should be company name
  and tagline/short description.

• H1 tags on all inner pages should be article
  title.

• NEVER skip a tag! (ie. H2 to H4)
LOGO CODE FOR YOUR
     TEMPLATE
LOGO CODE FOR YOUR
         TEMPLATE

if( JURI::current() == JURI::base() ) { ?>
  <h1 id="company-logo">
    <a href="<?php echo JURI::base(); ?>">
      Company Name
    </a>
  </h1>
LOGO CODE FOR YOUR
     TEMPLATE
LOGO CODE FOR YOUR
          TEMPLATE

} else {
    <p id="company-logo">
     <a href="<?php echo JURI::base(); ?>">
       Company Name
     </a>
    </p>
}
HEADINGS INSIDE OF YOUR
      TEMPLATE
HEADINGS INSIDE OF YOUR
       TEMPLATE

• In your overrides you should use the same logic:
  if( JURI::current() == JURI::base() ) {
      $h = 2;
  } else {
      $h = 1;
  }
  <h<?php echo $h; ?>>Title</h<?php echo $h; ?>}
HEADINGS INSIDE OF YOUR
       TEMPLATE

• In your overrides you should use the same logic:
  if( JURI::current() == JURI::base() ) {
      $h = 2;
  } else {
      $h = 1;
  }
  <h<?php echo $h; ?>>Title</h<?php echo $h; ?>}

• Module titles are virtually always H2
IMAGES
IMAGES


• Use alt tags on images which you want people to
  know what it is. (ie. If image wasn't there, would
  the description add to the content?)
IMAGES


• Use alt tags on images which you want people to
  know what it is. (ie. If image wasn't there, would
  the description add to the content?)

• Learn how to size images properly and how to
  compress them. Extra size slows down site and
  can lower SEO value.
WHAT ABOUT HTML5?
WHAT ABOUT HTML5?

• No SEO advantage at this time
WHAT ABOUT HTML5?

• No SEO advantage at this time

• Personally don’t recommend it as support is
  less than HTML4.
WHAT ABOUT HTML5?

• No SEO advantage at this time

• Personally don’t recommend it as support is
  less than HTML4.

• Only use if you have a specific market that you
  know has the capability to properly display it.
WHAT ABOUT HTML5?

• No SEO advantage at this time

• Personally don’t recommend it as support is
  less than HTML4.

• Only use if you have a specific market that you
  know has the capability to properly display it.

• It’s a great movement, but it’s really still the
  Wild Wild West.
NOT-SO-BASIC
TEMPLATE BASICS
LEARN THE JOOMLA LANGUAGE
LEARN THE JOOMLA LANGUAGE




• Why should you learn the Joomla! library for
  template development?
LEARN THE JOOMLA LANGUAGE




• Why should you learn the Joomla! library for
  template development?

  • Allows you to do advanced logic with your
    template.
LEARN THE JOOMLA LANGUAGE




• Why should you learn the Joomla! library for
  template development?

  • Allows you to do advanced logic with your
    template.

  • Gives you options you never had before
LEARN THE JOOMLA LANGUAGE
LEARN THE JOOMLA LANGUAGE


• JHTML
LEARN THE JOOMLA LANGUAGE


• JHTML

 • link, image, iframe, date, tooltip, calendar, etc.
LEARN THE JOOMLA LANGUAGE


• JHTML

 • link, image, iframe, date, tooltip, calendar, etc.

 • Example:
   $link = JHTML::_('image', 'images/stories/clock.jpg',
   null);
   echo $link;
LEARN THE JOOMLA LANGUAGE


• JHTML

  • link, image, iframe, date, tooltip, calendar, etc.

  • Example:
    $link = JHTML::_('image', 'images/stories/clock.jpg',
    null);
    echo $link;

• http://api.joomla.org/__filesource/fsource_Joomla-
  Framework_HTML_joomlahtmlhtml.php.html#a191
ADDING EXTERNAL
CSS STYLESHEETS (JOOMLA 1.6+)
ADDING EXTERNAL
CSS STYLESHEETS (JOOMLA 1.6+)

• $doc = JFactory::getDocument();
  $path = 'templates/' .
    $this->template . '/css/mystylesheet.css';

  $doc->addStyleSheet( $path,
    , ‘text/css’, “screen, projection” );
ADDING EXTERNAL
CSS STYLESHEETS (JOOMLA 1.6+)

• $doc = JFactory::getDocument();
  $path = 'templates/' .
    $this->template . '/css/mystylesheet.css';

  $doc->addStyleSheet( $path,
    , ‘text/css’, “screen, projection” );
• You can also use:
  JHTML::stylesheet( $path,
  array('media'=>'screen, projection' ) );
ADDING CSS STYLES
   FOR ONLY IE
ADDING CSS STYLES
         FOR ONLY IE


$stylelink = '<!--[if lte IE 6]>' ."n";
$stylelink .= '<link rel="stylesheet"
   href="../css/IEonly.css" />' ."n";
$stylelink .= '<![endif]-->' ."n";

$doc =& JFactory::getDocument();
$doc->addCustomTag($stylelink);
MAKE YOUR TEMPLATE
    UPGRADABLE
In templateDetails.xml the opening is:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE install PUBLIC "-//Joomla! 1.6//
DTD template 1.0//EN" "http://
www.joomla.org/xml/dtd/1.6/template-
install.dtd">
<extension version="1.7" type="template"
client="site" method=”upgrade”>
BUILDING BLOCKS
   USING CSS
SIZE BOX
SIZE BOX


grid_size boxes are used for width, height and overall
positioning of box.
SIZE BOX


grid_size boxes are used for width, height and overall
positioning of box.
SIZE BOX


grid_size boxes are used for width, height and overall
positioning of box.

.grid_size {
  width: 100%;
  height: auto;
  float: left;
  display: inline;
  position: relative; }
SIZE BOX


grid_size boxes are used for width, height and overall
positioning of box.

.grid_size {
  width: 100%;
  height: auto;
  float: left;
  display: inline;
  position: relative; }
STYLE BOX
STYLE BOX

grid_style boxes are used for padding, borders and
positioning of content within box.
STYLE BOX

grid_style boxes are used for padding, borders and
positioning of content within box.
STYLE BOX

grid_style boxes are used for padding, borders and
positioning of content within box.

.grid_style {
  width: auto;
  height: auto;
  display: block;
  top: 0;
  left: 0;
  clear: both; }
STYLE BOX

grid_style boxes are used for padding, borders and
positioning of content within box.

.grid_style {
  width: auto;
  height: auto;
  display: block;
  top: 0;
  left: 0;
  clear: both; }
EXAMPLE BOX
EXAMPLE BOX


<div class=”grid_size”>
EXAMPLE BOX


<div class=”grid_size”>
  <div class=”grid_style”>
EXAMPLE BOX


<div class=”grid_size”>
  <div class=”grid_style”>
     CSS Box
EXAMPLE BOX


<div class=”grid_size”>
  <div class=”grid_style”>
     CSS Box
  </div>
EXAMPLE BOX


<div class=”grid_size”>
   <div class=”grid_style”>
     CSS Box
   </div>
 </div>
EXAMPLE BOX


<div class=”grid_size”>
   <div class=”grid_style”>
     CSS Box
   </div>
 </div>
GETTING CONTROL
OF YOUR TEMPLATE
ADD AS MANY VARIABLES AS
POSSIBLE TO BODY TAG CLASS
ADD AS MANY VARIABLES AS
POSSIBLE TO BODY TAG CLASS
 <?php
 $body = '';
 if( JRequest::getInt( 'Itemid' ) ) {
       $body .= 'itemid-'.JRequest::getInt( 'Itemid' );
 }
 if( JRequest::getInt( 'id' ) ) {
       $body .= ' id-'.JRequest::getInt( 'id' );
 }
 if( JRequest::getVar( 'task' ) ) {
       $body .= ' task-'.JRequest::getVar( 'task' );
 }
ADD AS MANY VARIABLES AS
POSSIBLE TO BODY TAG CLASS
ADD AS MANY VARIABLES AS
POSSIBLE TO BODY TAG CLASS
if( JRequest::getVar( 'view' ) ) {
     $body .= ' view-'.JRequest::getVar( 'view' );
}
if( JRequest::getVar( 'layout' ) ) {
     $body .= ' layout-'.JRequest::getVar( 'layout' );
}
if( JRequest::getVar( 'option' ) ) {
     $body .= ' option-'.JRequest::getVar( 'option' );
}
ADD AS MANY VARIABLES AS
POSSIBLE TO BODY TAG CLASS
ADD AS MANY VARIABLES AS
POSSIBLE TO BODY TAG CLASS



$body .= ' lang-' . $this->language;
$body .= ' direction-' . $this->direction;
if( JURI::current() == JURI::base() ) {
     $body .= ' frontpage’;
}
global $mainframe;
$menu = @$mainframe->getMenu();
$active = @$menu->getActive();
while ( $active->parent > 0 ) {
    $parent = $menu->getItem(
    $active->parent );
    if ( 0 == $parent->parent ) {
        $top_level = $parent;
       break;
    } else {
       $active = $parent;
    }
}
$body .= ' menu_parent-' . $active->id;
$user =& JFactory::getUser();
$userGroups = $user->groups;
foreach($userGroups as $key => $value){
    $replace = array(".", " ");
    $body .= ' group-' .
strtolower( str_replace( $replace, '_', $key ) );
}
HOW THE VARIABLES OUTPUT
HOW THE VARIABLES OUTPUT



<body class=”<?php echo $body; ?>”>

Outputs:
<body class=”itemid-257 id-6 view-article option-
com_content lang-en-gb direction-ltr frontpage
menu_parent-1 group-super_users”>
HOW WOULD YOU USE THE
  MENU_PARENT CODE?
HOW WOULD YOU USE THE
        MENU_PARENT CODE?

In the CSS you could use it to change the
sidebar color for each parent menu and inherit
into each child.

.menu_parent-1 #sidebar {
    background: #ccc;
}

You can stack body classes safely:
.view-article.menu_parent-1 #sidebar
DOING DYNAMIC
 THE RIGHT WAY
LOAD DYNAMIC CSS
  INTO THE HEAD
LOAD DYNAMIC CSS
        INTO THE HEAD

Don’t create external php css files. Instead
do this...
LOAD DYNAMIC CSS
        INTO THE HEAD

Don’t create external php css files. Instead
do this...
$doc =& JFactory::getDocument();
$style = 'BODY {'
   . 'background: #00ff00;'
   . 'color: rgb(0,0,255);'
   . '}';
$doc->addStyleDeclaration( $style );
A FEW NOTES ABOUT
CREATING JOOMLA!
   1.7+ TEMPLATES
CREATING A NEW TEMPLATE
CREATING A NEW TEMPLATE



• Templates will not show up in Template
  Manager without being installed
CREATING A NEW TEMPLATE



• Templates will not show up in Template
  Manager without being installed
• Clicking Discover in Extension Manager
  will make templates show in Templates tab
  in Template Manager, but not in Styles
SETTING/REMOVING SCRIPTS
SETTING/REMOVING SCRIPTS

Add this above your DOCTYPE
SETTING/REMOVING SCRIPTS

  Add this above your DOCTYPE
• JHtml::_('behavior.framework', false);
SETTING/REMOVING SCRIPTS

  Add this above your DOCTYPE
• JHtml::_('behavior.framework', false);
    • FALSE = just mootools core (89KB)
SETTING/REMOVING SCRIPTS

  Add this above your DOCTYPE
• JHtml::_('behavior.framework', false);
    • FALSE = just mootools core (89KB)
    • TRUE = mootools-core + mootools-more (89KB +
      238KB = 327KB!)
SETTING/REMOVING SCRIPTS

  Add this above your DOCTYPE
• JHtml::_('behavior.framework', false);
    • FALSE = just mootools core (89KB)
    • TRUE = mootools-core + mootools-more (89KB +
      238KB = 327KB!)
  To remove all scripts:
SETTING/REMOVING SCRIPTS

  Add this above your DOCTYPE
• JHtml::_('behavior.framework', false);
    • FALSE = just mootools core (89KB)
    • TRUE = mootools-core + mootools-more (89KB +
      238KB = 327KB!)
  To remove all scripts:
• $doc =& JFactory::getDocument();
  $doc->_scripts = array();
SETTING/REMOVING SCRIPTS

  Add this above your DOCTYPE
• JHtml::_('behavior.framework', false);
    • FALSE = just mootools core (89KB)
    • TRUE = mootools-core + mootools-more (89KB +
      238KB = 327KB!)
  To remove all scripts:
• $doc =& JFactory::getDocument();
  $doc->_scripts = array();
  This is not recommended!
REMOVING MOOTOOLS IN 1.7
REMOVING MOOTOOLS IN 1.7

$user =& JFactory::getUser();
if ( $user->get( 'guest' ) == 1 ) {
      $document =& JFactory::getDocument();
      $headerstuff = $document->getHeadData();
      reset($headerstuff['scripts']);
      foreach ($headerstuff['scripts'] as $key=>$value){
        if (substr_count($key, 'mootools') > 0)
           unset($headerstuff['scripts'][$key]);
      }
      $document->setHeadData( $headerstuff );
}
MAKE IT SMALLER...
  AND FASTER!
KEY POINTS FOR SPEEDING
   UP YOUR TEMPLATE
KEY POINTS FOR SPEEDING
     UP YOUR TEMPLATE
• Optimize your images
KEY POINTS FOR SPEEDING
     UP YOUR TEMPLATE
• Optimize your images

• Make sprites with your images
KEY POINTS FOR SPEEDING
     UP YOUR TEMPLATE
• Optimize your images

• Make sprites with your images

• Combine CSS and JavaScript into one file for
  each
KEY POINTS FOR SPEEDING
     UP YOUR TEMPLATE
• Optimize your images

• Make sprites with your images

• Combine CSS and JavaScript into one file for
  each

• Don't use "on the fly" compression plugins
KEY POINTS FOR SPEEDING
     UP YOUR TEMPLATE
• Optimize your images

• Make sprites with your images

• Combine CSS and JavaScript into one file for
  each

• Don't use "on the fly" compression plugins

• If you use a CSS and/or JavaScript compression
  plugin then make sure it stores it somehow
  instead of compressing on each load.
KEY POINTS FOR SPEEDING
   UP YOUR TEMPLATE
KEY POINTS FOR SPEEDING
     UP YOUR TEMPLATE



• Use a CDN for your template resources
KEY POINTS FOR SPEEDING
     UP YOUR TEMPLATE



• Use a CDN for your template resources

• If possible, remove calls in component or
  modules for library’s if they are already used so
  you don’t have them loading twice.
A FEW EXTENSIONS
     TO HELP
EXTENSIONS WE USE FOR
    DEVELOPMENT
EXTENSIONS WE USE FOR
       DEVELOPMENT


• Advanced Module Manager (www.nonumber.nl)
EXTENSIONS WE USE FOR
       DEVELOPMENT


• Advanced Module Manager (www.nonumber.nl)

• CSS3 Automated Generator (www.corephp.com)
EXTENSIONS WE USE FOR
       DEVELOPMENT


• Advanced Module Manager (www.nonumber.nl)

• CSS3 Automated Generator (www.corephp.com)

• JCE (www.joomlacontenteditor.net/)
EXTENSIONS WE USE FOR
       DEVELOPMENT


• Advanced Module Manager (www.nonumber.nl)

• CSS3 Automated Generator (www.corephp.com)

• JCE (www.joomlacontenteditor.net/)

• Mass Content (www.baticore.com)
ADVANCED MODULE
 MANAGER CODE
ADVANCED MODULE
       MANAGER CODE

How to assign to only articles:
ADVANCED MODULE
         MANAGER CODE

  How to assign to only articles:

• $view = 'article';
  /* --- DO NOT EDIT BELOW --- */
  if ( JRequest::getCmd( 'view' ) == $view ) {
        $pass = 1;
  } else {
       $pass = 0;
  }
  return $pass;
ADVANCED MODULE
 MANAGER CODE
ADVANCED MODULE
      MANAGER CODE


How to assign to Wordpress homepage:
ADVANCED MODULE
         MANAGER CODE


  How to assign to Wordpress homepage:

• if ( defined( 'ABSPATH' ) && is_home() ) {
       $pass = 1;
  } else {
       $pass = 0;
  }
  return $pass;
ADVANCED MODULE
 MANAGER CODE
ADVANCED MODULE
      MANAGER CODE


How to assign to Wordpress single blog:
ADVANCED MODULE
          MANAGER CODE


  How to assign to Wordpress single blog:

• if ( is_single() ) {
        $pass = 1;
  } else {
        $pass = 0;
  }
  return $pass;
AUTOMATED CSS3
  GENERATOR
AUTOMATED CSS3
         GENERATOR

Automatically creates many cross-browser CSS3
styles for you.
AUTOMATED CSS3
           GENERATOR

  Automatically creates many cross-browser CSS3
  styles for you.

• Dropshadow, Text Shadow, Rounded Corners,
  Opacity, Gradient, RGBA, Rotate, Border Image
AUTOMATED CSS3
            GENERATOR

  Automatically creates many cross-browser CSS3
  styles for you.

• Dropshadow, Text Shadow, Rounded Corners,
  Opacity, Gradient, RGBA, Rotate, Border Image

• Rounded Corner Example:
  .rounded {topleft_radius:8, topright_radius:8,
  bottomright_radius:8, bottomleft_radius:8,
  support_ie:yes};
MASS CONTENT
MASS CONTENT




Mass Content allows you to enter several
articles, categories, tags, etc. at once, including
assigning to menu item.
Q&A
“If we would have new
knowledge, we must get a
whole world of new
questions.”
           - Susanne K. Langer

Más contenido relacionado

La actualidad más candente

Be nice to your designers
Be nice to your designersBe nice to your designers
Be nice to your designersPai-Cheng Tao
 
Modular HTML & CSS Workshop
Modular HTML & CSS WorkshopModular HTML & CSS Workshop
Modular HTML & CSS WorkshopShay Howe
 
Modular HTML & CSS Turbo Workshop
Modular HTML & CSS Turbo WorkshopModular HTML & CSS Turbo Workshop
Modular HTML & CSS Turbo WorkshopShay Howe
 
Grok Drupal (7) Theming - 2011 Feb update
Grok Drupal (7) Theming - 2011 Feb updateGrok Drupal (7) Theming - 2011 Feb update
Grok Drupal (7) Theming - 2011 Feb updateLaura Scott
 
WordPress Theme Development: Part 2
WordPress Theme Development: Part 2WordPress Theme Development: Part 2
WordPress Theme Development: Part 2Josh Lee
 
The Way to Theme Enlightenment 2017
The Way to Theme Enlightenment 2017The Way to Theme Enlightenment 2017
The Way to Theme Enlightenment 2017Amanda Giles
 
Crash Course in Theme Surgery
Crash Course in Theme SurgeryCrash Course in Theme Surgery
Crash Course in Theme SurgeryRational Frank
 
jQuery For Beginners - jQuery Conference 2009
jQuery For Beginners - jQuery Conference 2009jQuery For Beginners - jQuery Conference 2009
jQuery For Beginners - jQuery Conference 2009Ralph Whitbeck
 
TOSSUG HTML5 讀書會 新標籤與表單
TOSSUG HTML5 讀書會 新標籤與表單TOSSUG HTML5 讀書會 新標籤與表單
TOSSUG HTML5 讀書會 新標籤與表單偉格 高
 
Future-proof styling in Drupal (8)
Future-proof styling in Drupal (8)Future-proof styling in Drupal (8)
Future-proof styling in Drupal (8)Hajas Tamás
 
Grok Drupal (7) Theming (presented at DrupalCon San Francisco)
Grok Drupal (7) Theming (presented at DrupalCon San Francisco)Grok Drupal (7) Theming (presented at DrupalCon San Francisco)
Grok Drupal (7) Theming (presented at DrupalCon San Francisco)Laura Scott
 
How does get template part works in twenty ten theme
How does get template part works in twenty ten themeHow does get template part works in twenty ten theme
How does get template part works in twenty ten thememohd rozani abd ghani
 
Theming Search Results - How to Make Your Search Results Rock
Theming Search Results - How to Make Your Search Results RockTheming Search Results - How to Make Your Search Results Rock
Theming Search Results - How to Make Your Search Results RockAubrey Sambor
 
iPhone Web Applications: HTML5, CSS3 & dev tips for iPhone development
iPhone Web Applications: HTML5, CSS3 & dev tips for iPhone developmentiPhone Web Applications: HTML5, CSS3 & dev tips for iPhone development
iPhone Web Applications: HTML5, CSS3 & dev tips for iPhone developmentEstelle Weyl
 
CSS - OOCSS, SMACSS and more
CSS - OOCSS, SMACSS and moreCSS - OOCSS, SMACSS and more
CSS - OOCSS, SMACSS and moreRuss Weakley
 

La actualidad más candente (20)

Be nice to your designers
Be nice to your designersBe nice to your designers
Be nice to your designers
 
Modular HTML & CSS Workshop
Modular HTML & CSS WorkshopModular HTML & CSS Workshop
Modular HTML & CSS Workshop
 
Modular HTML & CSS Turbo Workshop
Modular HTML & CSS Turbo WorkshopModular HTML & CSS Turbo Workshop
Modular HTML & CSS Turbo Workshop
 
Grok Drupal (7) Theming - 2011 Feb update
Grok Drupal (7) Theming - 2011 Feb updateGrok Drupal (7) Theming - 2011 Feb update
Grok Drupal (7) Theming - 2011 Feb update
 
WordPress Theme Development: Part 2
WordPress Theme Development: Part 2WordPress Theme Development: Part 2
WordPress Theme Development: Part 2
 
HTML News Packages Lesson
HTML News Packages LessonHTML News Packages Lesson
HTML News Packages Lesson
 
The Way to Theme Enlightenment 2017
The Way to Theme Enlightenment 2017The Way to Theme Enlightenment 2017
The Way to Theme Enlightenment 2017
 
Crash Course in Theme Surgery
Crash Course in Theme SurgeryCrash Course in Theme Surgery
Crash Course in Theme Surgery
 
jQuery For Beginners - jQuery Conference 2009
jQuery For Beginners - jQuery Conference 2009jQuery For Beginners - jQuery Conference 2009
jQuery For Beginners - jQuery Conference 2009
 
Introduction to HTML
Introduction to HTMLIntroduction to HTML
Introduction to HTML
 
jQuery UI and Plugins
jQuery UI and PluginsjQuery UI and Plugins
jQuery UI and Plugins
 
TOSSUG HTML5 讀書會 新標籤與表單
TOSSUG HTML5 讀書會 新標籤與表單TOSSUG HTML5 讀書會 新標籤與表單
TOSSUG HTML5 讀書會 新標籤與表單
 
Future-proof styling in Drupal (8)
Future-proof styling in Drupal (8)Future-proof styling in Drupal (8)
Future-proof styling in Drupal (8)
 
Grok Drupal (7) Theming (presented at DrupalCon San Francisco)
Grok Drupal (7) Theming (presented at DrupalCon San Francisco)Grok Drupal (7) Theming (presented at DrupalCon San Francisco)
Grok Drupal (7) Theming (presented at DrupalCon San Francisco)
 
How does get template part works in twenty ten theme
How does get template part works in twenty ten themeHow does get template part works in twenty ten theme
How does get template part works in twenty ten theme
 
jQuery
jQueryjQuery
jQuery
 
Mobile themes, QR codes, and shortURLs
Mobile themes, QR codes, and shortURLsMobile themes, QR codes, and shortURLs
Mobile themes, QR codes, and shortURLs
 
Theming Search Results - How to Make Your Search Results Rock
Theming Search Results - How to Make Your Search Results RockTheming Search Results - How to Make Your Search Results Rock
Theming Search Results - How to Make Your Search Results Rock
 
iPhone Web Applications: HTML5, CSS3 & dev tips for iPhone development
iPhone Web Applications: HTML5, CSS3 & dev tips for iPhone developmentiPhone Web Applications: HTML5, CSS3 & dev tips for iPhone development
iPhone Web Applications: HTML5, CSS3 & dev tips for iPhone development
 
CSS - OOCSS, SMACSS and more
CSS - OOCSS, SMACSS and moreCSS - OOCSS, SMACSS and more
CSS - OOCSS, SMACSS and more
 

Destacado

Electrons and Chemical Bonding 2012 Day 1
Electrons and Chemical Bonding 2012 Day 1 Electrons and Chemical Bonding 2012 Day 1
Electrons and Chemical Bonding 2012 Day 1 jmori1
 
Studies in application of Augmented Reality in E-Learning Courses
Studies in application of Augmented Reality in E-Learning CoursesStudies in application of Augmented Reality in E-Learning Courses
Studies in application of Augmented Reality in E-Learning CoursesHimanshu Bansal
 
Our scavenger hunt
Our scavenger huntOur scavenger hunt
Our scavenger huntLes Davy
 
Summary for rough edit two idiots and a lady
Summary for rough edit two idiots and a ladySummary for rough edit two idiots and a lady
Summary for rough edit two idiots and a ladyFirstClassProductions
 
Kiilakoski: Kasvatus teknologisessa maailmassa
Kiilakoski: Kasvatus teknologisessa maailmassaKiilakoski: Kasvatus teknologisessa maailmassa
Kiilakoski: Kasvatus teknologisessa maailmassaKouluterveyskysely
 
Power Notes Atomic Structure
Power Notes   Atomic StructurePower Notes   Atomic Structure
Power Notes Atomic Structurejmori1
 
Introduction to Density
Introduction to Density  Introduction to Density
Introduction to Density jmori1
 
Lesson2
Lesson2Lesson2
Lesson2hstryk
 
Future Agricultures Consortium overview (Jan 13)
Future Agricultures Consortium overview (Jan 13)Future Agricultures Consortium overview (Jan 13)
Future Agricultures Consortium overview (Jan 13)futureagricultures
 
Training for Teachers
Training for TeachersTraining for Teachers
Training for TeachersDebjani Roy
 
Keunggulan kepimpinan rasulullah saw
Keunggulan kepimpinan rasulullah sawKeunggulan kepimpinan rasulullah saw
Keunggulan kepimpinan rasulullah sawmohamad fairuz
 
Networking
NetworkingNetworking
NetworkingTuan Ngo
 
User manual hl_wp_clone_feature
User manual hl_wp_clone_featureUser manual hl_wp_clone_feature
User manual hl_wp_clone_featureDebjani Roy
 
Nuppola: Opiskelijoiden kasvun ja itsenäistymisen tukeminen ammatillisessa op...
Nuppola: Opiskelijoiden kasvun ja itsenäistymisen tukeminen ammatillisessa op...Nuppola: Opiskelijoiden kasvun ja itsenäistymisen tukeminen ammatillisessa op...
Nuppola: Opiskelijoiden kasvun ja itsenäistymisen tukeminen ammatillisessa op...Kouluterveyskysely
 
Time for a more nuanced debate on child labour
Time for a more nuanced debate on child labourTime for a more nuanced debate on child labour
Time for a more nuanced debate on child labourWayne Dunn
 

Destacado (20)

Electrons and Chemical Bonding 2012 Day 1
Electrons and Chemical Bonding 2012 Day 1 Electrons and Chemical Bonding 2012 Day 1
Electrons and Chemical Bonding 2012 Day 1
 
Studies in application of Augmented Reality in E-Learning Courses
Studies in application of Augmented Reality in E-Learning CoursesStudies in application of Augmented Reality in E-Learning Courses
Studies in application of Augmented Reality in E-Learning Courses
 
Our scavenger hunt
Our scavenger huntOur scavenger hunt
Our scavenger hunt
 
Summary for rough edit two idiots and a lady
Summary for rough edit two idiots and a ladySummary for rough edit two idiots and a lady
Summary for rough edit two idiots and a lady
 
Kiilakoski: Kasvatus teknologisessa maailmassa
Kiilakoski: Kasvatus teknologisessa maailmassaKiilakoski: Kasvatus teknologisessa maailmassa
Kiilakoski: Kasvatus teknologisessa maailmassa
 
Radioisotopos
RadioisotoposRadioisotopos
Radioisotopos
 
Crise nos eua
Crise nos euaCrise nos eua
Crise nos eua
 
Power Notes Atomic Structure
Power Notes   Atomic StructurePower Notes   Atomic Structure
Power Notes Atomic Structure
 
Introduction to Density
Introduction to Density  Introduction to Density
Introduction to Density
 
Lesson2
Lesson2Lesson2
Lesson2
 
Php
PhpPhp
Php
 
Cartilla de p
Cartilla de pCartilla de p
Cartilla de p
 
Future Agricultures Consortium overview (Jan 13)
Future Agricultures Consortium overview (Jan 13)Future Agricultures Consortium overview (Jan 13)
Future Agricultures Consortium overview (Jan 13)
 
Training for Teachers
Training for TeachersTraining for Teachers
Training for Teachers
 
Keunggulan kepimpinan rasulullah saw
Keunggulan kepimpinan rasulullah sawKeunggulan kepimpinan rasulullah saw
Keunggulan kepimpinan rasulullah saw
 
Networking
NetworkingNetworking
Networking
 
User manual hl_wp_clone_feature
User manual hl_wp_clone_featureUser manual hl_wp_clone_feature
User manual hl_wp_clone_feature
 
Nuppola: Opiskelijoiden kasvun ja itsenäistymisen tukeminen ammatillisessa op...
Nuppola: Opiskelijoiden kasvun ja itsenäistymisen tukeminen ammatillisessa op...Nuppola: Opiskelijoiden kasvun ja itsenäistymisen tukeminen ammatillisessa op...
Nuppola: Opiskelijoiden kasvun ja itsenäistymisen tukeminen ammatillisessa op...
 
Time for a more nuanced debate on child labour
Time for a more nuanced debate on child labourTime for a more nuanced debate on child labour
Time for a more nuanced debate on child labour
 
Interview1 lyan
Interview1 lyanInterview1 lyan
Interview1 lyan
 

Similar a Joomla! Day Chicago 2011 - Templating the right way - Jonathan Shroyer

Introduction to HTML5
Introduction to HTML5Introduction to HTML5
Introduction to HTML5Terry Ryan
 
The Way to Theme Enlightenment
The Way to Theme EnlightenmentThe Way to Theme Enlightenment
The Way to Theme EnlightenmentAmanda Giles
 
WordPress Development Confoo 2010
WordPress Development Confoo 2010WordPress Development Confoo 2010
WordPress Development Confoo 2010Brendan Sera-Shriar
 
JavaScript Introduction and Implementation
JavaScript Introduction and ImplementationJavaScript Introduction and Implementation
JavaScript Introduction and ImplementationMaher Hossain
 
Practical HTML5: Using It Today
Practical HTML5: Using It TodayPractical HTML5: Using It Today
Practical HTML5: Using It TodayDoris Chen
 
Building the basics (WordPress Ottawa 2014)
Building the basics (WordPress Ottawa 2014)Building the basics (WordPress Ottawa 2014)
Building the basics (WordPress Ottawa 2014)christopherfross
 
Jquery presentation
Jquery presentationJquery presentation
Jquery presentationguest5d87aa6
 
Writing extensible Word press-plugins
Writing extensible Word press-pluginsWriting extensible Word press-plugins
Writing extensible Word press-pluginsAllenSnook
 
SINATRA + HAML + TWITTER
SINATRA + HAML + TWITTERSINATRA + HAML + TWITTER
SINATRA + HAML + TWITTERElber Ribeiro
 
How to Prepare a WordPress Theme for Public Release
How to Prepare a WordPress Theme for Public ReleaseHow to Prepare a WordPress Theme for Public Release
How to Prepare a WordPress Theme for Public ReleaseDavid Yeiser
 
Source Ordered Templates - - Joomla!Days NL 2009 #jd09nl
Source Ordered Templates - - Joomla!Days NL 2009 #jd09nlSource Ordered Templates - - Joomla!Days NL 2009 #jd09nl
Source Ordered Templates - - Joomla!Days NL 2009 #jd09nlJoomla!Days Netherlands
 
Implementing Awesome: An HTML5/CSS3 Workshop
Implementing Awesome: An HTML5/CSS3 WorkshopImplementing Awesome: An HTML5/CSS3 Workshop
Implementing Awesome: An HTML5/CSS3 WorkshopShoshi Roberts
 
Web Design Bootcamp - Day1
Web Design Bootcamp - Day1Web Design Bootcamp - Day1
Web Design Bootcamp - Day1Aslam Najeebdeen
 
JavaScript for Flex Devs
JavaScript for Flex DevsJavaScript for Flex Devs
JavaScript for Flex DevsAaronius
 
Slow kinda sucks
Slow kinda sucksSlow kinda sucks
Slow kinda sucksTim Wright
 

Similar a Joomla! Day Chicago 2011 - Templating the right way - Jonathan Shroyer (20)

Seven deadly theming sins
Seven deadly theming sinsSeven deadly theming sins
Seven deadly theming sins
 
Introduction to HTML5
Introduction to HTML5Introduction to HTML5
Introduction to HTML5
 
HTML5 & CSS3 Flag
HTML5 & CSS3 FlagHTML5 & CSS3 Flag
HTML5 & CSS3 Flag
 
The Way to Theme Enlightenment
The Way to Theme EnlightenmentThe Way to Theme Enlightenment
The Way to Theme Enlightenment
 
Using Core Themes in Drupal 8
Using Core Themes in Drupal 8Using Core Themes in Drupal 8
Using Core Themes in Drupal 8
 
WordPress Development Confoo 2010
WordPress Development Confoo 2010WordPress Development Confoo 2010
WordPress Development Confoo 2010
 
JavaScript Introduction and Implementation
JavaScript Introduction and ImplementationJavaScript Introduction and Implementation
JavaScript Introduction and Implementation
 
Practical HTML5: Using It Today
Practical HTML5: Using It TodayPractical HTML5: Using It Today
Practical HTML5: Using It Today
 
Building the basics (WordPress Ottawa 2014)
Building the basics (WordPress Ottawa 2014)Building the basics (WordPress Ottawa 2014)
Building the basics (WordPress Ottawa 2014)
 
Artdm171 Week4 Tags
Artdm171 Week4 TagsArtdm171 Week4 Tags
Artdm171 Week4 Tags
 
Jquery presentation
Jquery presentationJquery presentation
Jquery presentation
 
Writing extensible Word press-plugins
Writing extensible Word press-pluginsWriting extensible Word press-plugins
Writing extensible Word press-plugins
 
Html intro
Html introHtml intro
Html intro
 
SINATRA + HAML + TWITTER
SINATRA + HAML + TWITTERSINATRA + HAML + TWITTER
SINATRA + HAML + TWITTER
 
How to Prepare a WordPress Theme for Public Release
How to Prepare a WordPress Theme for Public ReleaseHow to Prepare a WordPress Theme for Public Release
How to Prepare a WordPress Theme for Public Release
 
Source Ordered Templates - - Joomla!Days NL 2009 #jd09nl
Source Ordered Templates - - Joomla!Days NL 2009 #jd09nlSource Ordered Templates - - Joomla!Days NL 2009 #jd09nl
Source Ordered Templates - - Joomla!Days NL 2009 #jd09nl
 
Implementing Awesome: An HTML5/CSS3 Workshop
Implementing Awesome: An HTML5/CSS3 WorkshopImplementing Awesome: An HTML5/CSS3 Workshop
Implementing Awesome: An HTML5/CSS3 Workshop
 
Web Design Bootcamp - Day1
Web Design Bootcamp - Day1Web Design Bootcamp - Day1
Web Design Bootcamp - Day1
 
JavaScript for Flex Devs
JavaScript for Flex DevsJavaScript for Flex Devs
JavaScript for Flex Devs
 
Slow kinda sucks
Slow kinda sucksSlow kinda sucks
Slow kinda sucks
 

Último

BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...Sapna Thakur
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3JemimahLaneBuaron
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDThiyagu K
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpinRaunakKeshri1
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingTeacherCyreneCayanan
 

Último (20)

INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writing
 

Joomla! Day Chicago 2011 - Templating the right way - Jonathan Shroyer

  • 1. TEMPLATING THE RIGHT WAY by Jonathan Shroyer Twitter: @learncss Email: jonathan@corephp.com by Jonathan Shroyer
  • 4. DID YOU KNOW? Tables are for tabular data... not for layouts
  • 6. PROPER HEADINGS • H tags are possibly most important for SEOs
  • 7. PROPER HEADINGS • H tags are possibly most important for SEOs • One H1 per page
  • 8. PROPER HEADINGS • H tags are possibly most important for SEOs • One H1 per page • Opening page H1 should be company name and tagline/short description.
  • 9. PROPER HEADINGS • H tags are possibly most important for SEOs • One H1 per page • Opening page H1 should be company name and tagline/short description. • H1 tags on all inner pages should be article title.
  • 10. PROPER HEADINGS • H tags are possibly most important for SEOs • One H1 per page • Opening page H1 should be company name and tagline/short description. • H1 tags on all inner pages should be article title. • NEVER skip a tag! (ie. H2 to H4)
  • 11. LOGO CODE FOR YOUR TEMPLATE
  • 12. LOGO CODE FOR YOUR TEMPLATE if( JURI::current() == JURI::base() ) { ?> <h1 id="company-logo"> <a href="<?php echo JURI::base(); ?>"> Company Name </a> </h1>
  • 13. LOGO CODE FOR YOUR TEMPLATE
  • 14. LOGO CODE FOR YOUR TEMPLATE } else { <p id="company-logo"> <a href="<?php echo JURI::base(); ?>"> Company Name </a> </p> }
  • 15. HEADINGS INSIDE OF YOUR TEMPLATE
  • 16. HEADINGS INSIDE OF YOUR TEMPLATE • In your overrides you should use the same logic: if( JURI::current() == JURI::base() ) { $h = 2; } else { $h = 1; } <h<?php echo $h; ?>>Title</h<?php echo $h; ?>}
  • 17. HEADINGS INSIDE OF YOUR TEMPLATE • In your overrides you should use the same logic: if( JURI::current() == JURI::base() ) { $h = 2; } else { $h = 1; } <h<?php echo $h; ?>>Title</h<?php echo $h; ?>} • Module titles are virtually always H2
  • 19. IMAGES • Use alt tags on images which you want people to know what it is. (ie. If image wasn't there, would the description add to the content?)
  • 20. IMAGES • Use alt tags on images which you want people to know what it is. (ie. If image wasn't there, would the description add to the content?) • Learn how to size images properly and how to compress them. Extra size slows down site and can lower SEO value.
  • 22. WHAT ABOUT HTML5? • No SEO advantage at this time
  • 23. WHAT ABOUT HTML5? • No SEO advantage at this time • Personally don’t recommend it as support is less than HTML4.
  • 24. WHAT ABOUT HTML5? • No SEO advantage at this time • Personally don’t recommend it as support is less than HTML4. • Only use if you have a specific market that you know has the capability to properly display it.
  • 25. WHAT ABOUT HTML5? • No SEO advantage at this time • Personally don’t recommend it as support is less than HTML4. • Only use if you have a specific market that you know has the capability to properly display it. • It’s a great movement, but it’s really still the Wild Wild West.
  • 27. LEARN THE JOOMLA LANGUAGE
  • 28. LEARN THE JOOMLA LANGUAGE • Why should you learn the Joomla! library for template development?
  • 29. LEARN THE JOOMLA LANGUAGE • Why should you learn the Joomla! library for template development? • Allows you to do advanced logic with your template.
  • 30. LEARN THE JOOMLA LANGUAGE • Why should you learn the Joomla! library for template development? • Allows you to do advanced logic with your template. • Gives you options you never had before
  • 31. LEARN THE JOOMLA LANGUAGE
  • 32. LEARN THE JOOMLA LANGUAGE • JHTML
  • 33. LEARN THE JOOMLA LANGUAGE • JHTML • link, image, iframe, date, tooltip, calendar, etc.
  • 34. LEARN THE JOOMLA LANGUAGE • JHTML • link, image, iframe, date, tooltip, calendar, etc. • Example: $link = JHTML::_('image', 'images/stories/clock.jpg', null); echo $link;
  • 35. LEARN THE JOOMLA LANGUAGE • JHTML • link, image, iframe, date, tooltip, calendar, etc. • Example: $link = JHTML::_('image', 'images/stories/clock.jpg', null); echo $link; • http://api.joomla.org/__filesource/fsource_Joomla- Framework_HTML_joomlahtmlhtml.php.html#a191
  • 37. ADDING EXTERNAL CSS STYLESHEETS (JOOMLA 1.6+) • $doc = JFactory::getDocument(); $path = 'templates/' . $this->template . '/css/mystylesheet.css'; $doc->addStyleSheet( $path, , ‘text/css’, “screen, projection” );
  • 38. ADDING EXTERNAL CSS STYLESHEETS (JOOMLA 1.6+) • $doc = JFactory::getDocument(); $path = 'templates/' . $this->template . '/css/mystylesheet.css'; $doc->addStyleSheet( $path, , ‘text/css’, “screen, projection” ); • You can also use: JHTML::stylesheet( $path, array('media'=>'screen, projection' ) );
  • 39. ADDING CSS STYLES FOR ONLY IE
  • 40. ADDING CSS STYLES FOR ONLY IE $stylelink = '<!--[if lte IE 6]>' ."n"; $stylelink .= '<link rel="stylesheet" href="../css/IEonly.css" />' ."n"; $stylelink .= '<![endif]-->' ."n"; $doc =& JFactory::getDocument(); $doc->addCustomTag($stylelink);
  • 41. MAKE YOUR TEMPLATE UPGRADABLE In templateDetails.xml the opening is: <?xml version="1.0" encoding="utf-8"?> <!DOCTYPE install PUBLIC "-//Joomla! 1.6// DTD template 1.0//EN" "http:// www.joomla.org/xml/dtd/1.6/template- install.dtd"> <extension version="1.7" type="template" client="site" method=”upgrade”>
  • 42. BUILDING BLOCKS USING CSS
  • 44. SIZE BOX grid_size boxes are used for width, height and overall positioning of box.
  • 45. SIZE BOX grid_size boxes are used for width, height and overall positioning of box.
  • 46. SIZE BOX grid_size boxes are used for width, height and overall positioning of box. .grid_size { width: 100%; height: auto; float: left; display: inline; position: relative; }
  • 47. SIZE BOX grid_size boxes are used for width, height and overall positioning of box. .grid_size { width: 100%; height: auto; float: left; display: inline; position: relative; }
  • 49. STYLE BOX grid_style boxes are used for padding, borders and positioning of content within box.
  • 50. STYLE BOX grid_style boxes are used for padding, borders and positioning of content within box.
  • 51. STYLE BOX grid_style boxes are used for padding, borders and positioning of content within box. .grid_style { width: auto; height: auto; display: block; top: 0; left: 0; clear: both; }
  • 52. STYLE BOX grid_style boxes are used for padding, borders and positioning of content within box. .grid_style { width: auto; height: auto; display: block; top: 0; left: 0; clear: both; }
  • 55. EXAMPLE BOX <div class=”grid_size”> <div class=”grid_style”>
  • 56. EXAMPLE BOX <div class=”grid_size”> <div class=”grid_style”> CSS Box
  • 57. EXAMPLE BOX <div class=”grid_size”> <div class=”grid_style”> CSS Box </div>
  • 58. EXAMPLE BOX <div class=”grid_size”> <div class=”grid_style”> CSS Box </div> </div>
  • 59. EXAMPLE BOX <div class=”grid_size”> <div class=”grid_style”> CSS Box </div> </div>
  • 61. ADD AS MANY VARIABLES AS POSSIBLE TO BODY TAG CLASS
  • 62. ADD AS MANY VARIABLES AS POSSIBLE TO BODY TAG CLASS <?php $body = ''; if( JRequest::getInt( 'Itemid' ) ) { $body .= 'itemid-'.JRequest::getInt( 'Itemid' ); } if( JRequest::getInt( 'id' ) ) { $body .= ' id-'.JRequest::getInt( 'id' ); } if( JRequest::getVar( 'task' ) ) { $body .= ' task-'.JRequest::getVar( 'task' ); }
  • 63. ADD AS MANY VARIABLES AS POSSIBLE TO BODY TAG CLASS
  • 64. ADD AS MANY VARIABLES AS POSSIBLE TO BODY TAG CLASS if( JRequest::getVar( 'view' ) ) { $body .= ' view-'.JRequest::getVar( 'view' ); } if( JRequest::getVar( 'layout' ) ) { $body .= ' layout-'.JRequest::getVar( 'layout' ); } if( JRequest::getVar( 'option' ) ) { $body .= ' option-'.JRequest::getVar( 'option' ); }
  • 65. ADD AS MANY VARIABLES AS POSSIBLE TO BODY TAG CLASS
  • 66. ADD AS MANY VARIABLES AS POSSIBLE TO BODY TAG CLASS $body .= ' lang-' . $this->language; $body .= ' direction-' . $this->direction; if( JURI::current() == JURI::base() ) { $body .= ' frontpage’; }
  • 67.
  • 68. global $mainframe; $menu = @$mainframe->getMenu(); $active = @$menu->getActive(); while ( $active->parent > 0 ) { $parent = $menu->getItem( $active->parent ); if ( 0 == $parent->parent ) { $top_level = $parent; break; } else { $active = $parent; } } $body .= ' menu_parent-' . $active->id;
  • 69.
  • 70. $user =& JFactory::getUser(); $userGroups = $user->groups; foreach($userGroups as $key => $value){ $replace = array(".", " "); $body .= ' group-' . strtolower( str_replace( $replace, '_', $key ) ); }
  • 72. HOW THE VARIABLES OUTPUT <body class=”<?php echo $body; ?>”> Outputs: <body class=”itemid-257 id-6 view-article option- com_content lang-en-gb direction-ltr frontpage menu_parent-1 group-super_users”>
  • 73. HOW WOULD YOU USE THE MENU_PARENT CODE?
  • 74. HOW WOULD YOU USE THE MENU_PARENT CODE? In the CSS you could use it to change the sidebar color for each parent menu and inherit into each child. .menu_parent-1 #sidebar { background: #ccc; } You can stack body classes safely: .view-article.menu_parent-1 #sidebar
  • 75. DOING DYNAMIC THE RIGHT WAY
  • 76. LOAD DYNAMIC CSS INTO THE HEAD
  • 77. LOAD DYNAMIC CSS INTO THE HEAD Don’t create external php css files. Instead do this...
  • 78. LOAD DYNAMIC CSS INTO THE HEAD Don’t create external php css files. Instead do this... $doc =& JFactory::getDocument(); $style = 'BODY {' . 'background: #00ff00;' . 'color: rgb(0,0,255);' . '}'; $doc->addStyleDeclaration( $style );
  • 79. A FEW NOTES ABOUT CREATING JOOMLA! 1.7+ TEMPLATES
  • 80. CREATING A NEW TEMPLATE
  • 81. CREATING A NEW TEMPLATE • Templates will not show up in Template Manager without being installed
  • 82. CREATING A NEW TEMPLATE • Templates will not show up in Template Manager without being installed • Clicking Discover in Extension Manager will make templates show in Templates tab in Template Manager, but not in Styles
  • 83.
  • 85. SETTING/REMOVING SCRIPTS Add this above your DOCTYPE
  • 86. SETTING/REMOVING SCRIPTS Add this above your DOCTYPE • JHtml::_('behavior.framework', false);
  • 87. SETTING/REMOVING SCRIPTS Add this above your DOCTYPE • JHtml::_('behavior.framework', false); • FALSE = just mootools core (89KB)
  • 88. SETTING/REMOVING SCRIPTS Add this above your DOCTYPE • JHtml::_('behavior.framework', false); • FALSE = just mootools core (89KB) • TRUE = mootools-core + mootools-more (89KB + 238KB = 327KB!)
  • 89. SETTING/REMOVING SCRIPTS Add this above your DOCTYPE • JHtml::_('behavior.framework', false); • FALSE = just mootools core (89KB) • TRUE = mootools-core + mootools-more (89KB + 238KB = 327KB!) To remove all scripts:
  • 90. SETTING/REMOVING SCRIPTS Add this above your DOCTYPE • JHtml::_('behavior.framework', false); • FALSE = just mootools core (89KB) • TRUE = mootools-core + mootools-more (89KB + 238KB = 327KB!) To remove all scripts: • $doc =& JFactory::getDocument(); $doc->_scripts = array();
  • 91. SETTING/REMOVING SCRIPTS Add this above your DOCTYPE • JHtml::_('behavior.framework', false); • FALSE = just mootools core (89KB) • TRUE = mootools-core + mootools-more (89KB + 238KB = 327KB!) To remove all scripts: • $doc =& JFactory::getDocument(); $doc->_scripts = array(); This is not recommended!
  • 93. REMOVING MOOTOOLS IN 1.7 $user =& JFactory::getUser(); if ( $user->get( 'guest' ) == 1 ) { $document =& JFactory::getDocument(); $headerstuff = $document->getHeadData(); reset($headerstuff['scripts']); foreach ($headerstuff['scripts'] as $key=>$value){ if (substr_count($key, 'mootools') > 0) unset($headerstuff['scripts'][$key]); } $document->setHeadData( $headerstuff ); }
  • 94. MAKE IT SMALLER... AND FASTER!
  • 95. KEY POINTS FOR SPEEDING UP YOUR TEMPLATE
  • 96. KEY POINTS FOR SPEEDING UP YOUR TEMPLATE • Optimize your images
  • 97. KEY POINTS FOR SPEEDING UP YOUR TEMPLATE • Optimize your images • Make sprites with your images
  • 98. KEY POINTS FOR SPEEDING UP YOUR TEMPLATE • Optimize your images • Make sprites with your images • Combine CSS and JavaScript into one file for each
  • 99. KEY POINTS FOR SPEEDING UP YOUR TEMPLATE • Optimize your images • Make sprites with your images • Combine CSS and JavaScript into one file for each • Don't use "on the fly" compression plugins
  • 100. KEY POINTS FOR SPEEDING UP YOUR TEMPLATE • Optimize your images • Make sprites with your images • Combine CSS and JavaScript into one file for each • Don't use "on the fly" compression plugins • If you use a CSS and/or JavaScript compression plugin then make sure it stores it somehow instead of compressing on each load.
  • 101. KEY POINTS FOR SPEEDING UP YOUR TEMPLATE
  • 102. KEY POINTS FOR SPEEDING UP YOUR TEMPLATE • Use a CDN for your template resources
  • 103. KEY POINTS FOR SPEEDING UP YOUR TEMPLATE • Use a CDN for your template resources • If possible, remove calls in component or modules for library’s if they are already used so you don’t have them loading twice.
  • 104. A FEW EXTENSIONS TO HELP
  • 105. EXTENSIONS WE USE FOR DEVELOPMENT
  • 106. EXTENSIONS WE USE FOR DEVELOPMENT • Advanced Module Manager (www.nonumber.nl)
  • 107. EXTENSIONS WE USE FOR DEVELOPMENT • Advanced Module Manager (www.nonumber.nl) • CSS3 Automated Generator (www.corephp.com)
  • 108. EXTENSIONS WE USE FOR DEVELOPMENT • Advanced Module Manager (www.nonumber.nl) • CSS3 Automated Generator (www.corephp.com) • JCE (www.joomlacontenteditor.net/)
  • 109. EXTENSIONS WE USE FOR DEVELOPMENT • Advanced Module Manager (www.nonumber.nl) • CSS3 Automated Generator (www.corephp.com) • JCE (www.joomlacontenteditor.net/) • Mass Content (www.baticore.com)
  • 110.
  • 111.
  • 112.
  • 114. ADVANCED MODULE MANAGER CODE How to assign to only articles:
  • 115. ADVANCED MODULE MANAGER CODE How to assign to only articles: • $view = 'article'; /* --- DO NOT EDIT BELOW --- */ if ( JRequest::getCmd( 'view' ) == $view ) { $pass = 1; } else { $pass = 0; } return $pass;
  • 117. ADVANCED MODULE MANAGER CODE How to assign to Wordpress homepage:
  • 118. ADVANCED MODULE MANAGER CODE How to assign to Wordpress homepage: • if ( defined( 'ABSPATH' ) && is_home() ) { $pass = 1; } else { $pass = 0; } return $pass;
  • 120. ADVANCED MODULE MANAGER CODE How to assign to Wordpress single blog:
  • 121. ADVANCED MODULE MANAGER CODE How to assign to Wordpress single blog: • if ( is_single() ) { $pass = 1; } else { $pass = 0; } return $pass;
  • 122. AUTOMATED CSS3 GENERATOR
  • 123. AUTOMATED CSS3 GENERATOR Automatically creates many cross-browser CSS3 styles for you.
  • 124. AUTOMATED CSS3 GENERATOR Automatically creates many cross-browser CSS3 styles for you. • Dropshadow, Text Shadow, Rounded Corners, Opacity, Gradient, RGBA, Rotate, Border Image
  • 125. AUTOMATED CSS3 GENERATOR Automatically creates many cross-browser CSS3 styles for you. • Dropshadow, Text Shadow, Rounded Corners, Opacity, Gradient, RGBA, Rotate, Border Image • Rounded Corner Example: .rounded {topleft_radius:8, topright_radius:8, bottomright_radius:8, bottomleft_radius:8, support_ie:yes};
  • 126.
  • 128. MASS CONTENT Mass Content allows you to enter several articles, categories, tags, etc. at once, including assigning to menu item.
  • 129.
  • 130. Q&A “If we would have new knowledge, we must get a whole world of new questions.” - Susanne K. Langer

Notas del editor

  1. \n
  2. \n
  3. Style is the LAST thing you should think about when choosing tags. Base it on semantics.\n
  4. Style is the LAST thing you should think about when choosing tags. Base it on semantics.\nIf you want to style according to H tags then make classes called .H1, .H2, etc.\n
  5. Style is the LAST thing you should think about when choosing tags. Base it on semantics.\nIf you want to style according to H tags then make classes called .H1, .H2, etc.\n
  6. Style is the LAST thing you should think about when choosing tags. Base it on semantics.\nIf you want to style according to H tags then make classes called .H1, .H2, etc.\n
  7. Style is the LAST thing you should think about when choosing tags. Base it on semantics.\nIf you want to style according to H tags then make classes called .H1, .H2, etc.\n
  8. Style is the LAST thing you should think about when choosing tags. Base it on semantics.\nIf you want to style according to H tags then make classes called .H1, .H2, etc.\n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n
  16. \n
  17. \n
  18. \n
  19. \n
  20. Example: change module positions according to category, section or even inherit through to all child items in a menu.\n
  21. Example: change module positions according to category, section or even inherit through to all child items in a menu.\n
  22. Example: change module positions according to category, section or even inherit through to all child items in a menu.\n
  23. \n
  24. \n
  25. \n
  26. \n
  27. \n
  28. \n
  29. \n
  30. \n
  31. \n
  32. \n
  33. \n
  34. \n
  35. \n
  36. \n
  37. \n
  38. \n
  39. \n
  40. \n
  41. \n
  42. \n
  43. \n
  44. \n
  45. \n
  46. \n
  47. \n
  48. \n
  49. \n
  50. Here we are grabbing info from the menu to determine the parent item and inheriting through to all children. This was originally created for a library site that wanted unique colors for each menu area.\n
  51. Here we are grabbing info from the menu to determine the parent item and inheriting through to all children. This was originally created for a library site that wanted unique colors for each menu area.\n
  52. \n
  53. \n
  54. \n
  55. \n
  56. \n
  57. \n
  58. \n
  59. \n
  60. \n
  61. \n
  62. \n
  63. \n
  64. \n
  65. \n
  66. \n
  67. \n
  68. \n
  69. \n
  70. \n
  71. \n
  72. \n
  73. \n
  74. \n
  75. CDN: Content Delivery Network\n
  76. CDN: Content Delivery Network\n
  77. \n
  78. \n
  79. \n
  80. \n
  81. \n
  82. CDN: Content Delivery Network\n
  83. CDN: Content Delivery Network\n
  84. CDN: Content Delivery Network\n
  85. CDN: Content Delivery Network\n
  86. CDN: Content Delivery Network\n
  87. CDN: Content Delivery Network\n
  88. CDN: Content Delivery Network\n
  89. CDN: Content Delivery Network\n
  90. CDN: Content Delivery Network\n
  91. CDN: Content Delivery Network\n
  92. CDN: Content Delivery Network\n
  93. CDN: Content Delivery Network\n
  94. CDN: Content Delivery Network\n
  95. CDN: Content Delivery Network\n
  96. CDN: Content Delivery Network\n
  97. \n