Customizing your Theme Information Systems 337 Prof. Harry Plantinga.

Slides:



Advertisements
Similar presentations
Bending Zen Intro Using Zen Themes functionality, but bending it into your own theme.
Advertisements

WordPress Themes.
Chapter 3 – Web Design Tables & Page Layout
WEB DESIGN TABLES, PAGE LAYOUT AND FORMS. Page Layout Page Layout is an important part of web design Why do you think your page layout is important?
RESEARCH POSTER PRESENTATION DESIGN © (—THIS SIDEBAR DOES NOT PRINT—) DESIGN GUIDE This PowerPoint 2007 template produces.
From a HTML5 Template Kaloyan Petrov Drupal Themer Telerik Web Design Course
Project Implementation for COSC 5050 Distributed Database Applications Lab4.
Seattle Drupal Clinic Introduction to Drupal and Web Content Management.
Government Web Template (GWT) for WordPress Updated 03/20/2015.
Intermediate Level Course. Text Format The text styles, bold, italics, underlining, superscript and subscript, can be easily added to selected text. Text.
By Alex Loescher Robert Partch and Robert Pimentel 1.
Macromedia Dreamweaver 4 Foundation Level Course.
Final Presentation WordPress 3.0+ Leonard Bogdonoff 12/6/11 T. DEDONNO CIM225.
Content Management, Working with WordPress Svetlin Nakov Telerik Corporation
Web Page Behavior IS 373—Web Standards Todd Will.
1 of 6 This document is for informational purposes only. MICROSOFT MAKES NO WARRANTIES, EXPRESS OR IMPLIED, IN THIS DOCUMENT. © 2007 Microsoft Corporation.
1 of 5 This document is for informational purposes only. MICROSOFT MAKES NO WARRANTIES, EXPRESS OR IMPLIED, IN THIS DOCUMENT. © 2007 Microsoft Corporation.
Wordpress Tutorial 22 – 24 April Table of Contents Introduction Designing blog Writing and Publishing blog Pages Posts Categories Tags Links Comments.
Review of last session The Weebly Dashboard The Weebly Dashboard Controls your account and your sites Controls your account and your sites From here you.
CREATING CUSTOM LAYOUTS IN PANELS. What are panels? Contrib module: Main function Implement.
Bones – HTML5 Wordpress Theme Development
The Dr ü G Book: An Intro to Drupal The Dr ü G Book: An Intro to Drupal (Dr ü G: Drupal User ’ s Group - users, not developers) This is an introduction.
Drupal Workshop Introduction to Drupal Part 1: Web Content Management, Advantages/Disadvantages of Drupal, Drupal terminology, Drupal technology, directories.
Basics of Drupal: Part 3 Rochelle Terman
Basics of Administration & Theming - Smarajit Dasgupta.
Website Administration Information Systems 337 Prof. Harry Plantinga.
TOP 20 MISTAKES YOU WILL MAKE IN YOUR 1ST DRUPAL PROJECT IZTOK SMOLIČ, ZAGREB.
WDV 331 Dreamweaver Applications Templates Dreamweaver CS6 Chapter 19.
Adapting a Site Template Using Drupal Themes and SASS/LESS.
Dreamweaver -- CSS. Dreamweaver -- MX New icons are added in MX Most of the features commonly used in web design, and are same as FrontPage. New feature.
Drupal Training Syllabus Chaitanya Lakshmi
Ch6:creating consistent looking web sites. Master pages Master page defines a combination of fixed content and content place holder to hold the web page(.aspx)
Creating Effective School and PTA Websites Sam Farnsworth Utah PTA Technology Specialist
XP New Perspectives on Microsoft Office FrontPage 2003 Tutorial 4 1 Microsoft Office FrontPage 2003 Tutorial 4 – Using Shared Borders and Themes.
Copyright © 2008 Pearson Prentice Hall. All rights reserved. 1 Exploring Microsoft Office Word 2007 Chapter 8 Word and the Internet Robert Grauer, Keith.
Title, meta, link, script.  The title looks like:  The tag defines the title of the document in the browser toolbar.  It also: ◦ Provides a title for.
Drupal Jumpstart Information Systems 337 Prof. Harry Plantinga.
WordPress Architecture ► Core files – PHP ► MySQL database  Configured by the installation script ► wp-content directory  themes subdirectory: layout.
Static HTML to Drupal Theme By Ivan Zugec. Static HTML to Drupal Theme. Setting up a theme. Overriding tpl files. Using the devel module. Q and A.
Drupal 6 Theme System Architecture –Theme Templates –Theme Engines –Theme Hooks What’s New –Theme registry –Theme Inheritance –Modules & Themes speak!
Drupal Themes The Survival Guide Drupal Camp | Managua 2009.
What you don’t know you don’t know about Drupal 6 Dan Harris daneesia on drupal.org.
Drupal Overview Prepared by : Agustin D. Gumogda Jr. Instructor.
>> HTML: Structure Elements. Elements in HTML are either Inline or Block. Block-level Elements – Begins on a new line – Occupy the whole width – Stacks.
Seattle Drupal Clinic Introduction to Drupal Part 1: Web Content Management, Advantages/Disadvantages of Drupal, Drupal terminology.
The Care and Maintenance of J5 MAC New Look. Naming Conventions  Each graphic and include item is named by function_contract area_secondary identifier.
Tour Overview Introduction Collage Basics Collage Basics (Templates and Tools) Computer Configuration Bookmark Collage Getting Started Tour Collage Terminology.
Introduction to Views Stanford Drupal Camp April 6, 2013.
Creating a Web Site Review of Concepts. Templates Templates are special HTML files that are used to quickly create pages on a web site. They contain the.
Working with Themes, Quick Parts, Page Backgrounds, and Headers and Footers Lesson 7.
USING WORDPRESS TO CREATE A WEBSITE (RATHER THAN A BLOG) STEP-BY-STEP INSTRUCTIONS.
Drupal Theming Chris Neglia and Lisa Forgan Copyright 2009, Page 1 Solutions.
CSCI 6962: Server-side Design and Programming Facelets and User Interface Design.
Content Administration 08/19/13 & 08/20/13.
Advanced Web 2012 Lecture 11 Sean Costain 2012.
Today’s Lesson….. 1.Formative Assessment Given Back – Go through Answers. 2.Webpage Design.
Adxstudio Portals Training
Positioning Objects with CSS and Tables
WHY DO YOU NEED IT? What is a wireframe?. A wireframe is… A wireframe is a simple visual guide to show you what a Web page would look like. Wireframes.
Configuring Drupal Information Systems 337 Prof. Harry Plantinga.
Before We Begin Please download the files from as we will be using them in our walkthroughs.
EKTRON QUICK START GUIDEEKTRON QUICK START GUIDE Version 1.0 Copyright 2013 WebSolutions Technology, Inc. Fuller June 7, 2013.
DYNAMIC FAQ AND DOCUMENTATION PAGES IN SHAREPOINT A modern, reusable, and easy-to-use model.
COMP 143 Web Development with Adobe Dreamweaver CC.
HTML LAYOUTS. CONTENTS Layouts Example Layout Using Element Example Using Table Example Output Summary Exercise.
Creating a Theme From Scratch in Drupal
CSS Layouts: Positioning and Navbars
Customizing your Theme
Content Management System
5.00 Apply procedures to organize content by using Dreamweaver. (22%)
Presentation transcript:

Customizing your Theme Information Systems 337 Prof. Harry Plantinga

Customizing Themes Beginner options: Beginner options: Changing title slogan Changing title slogan Changing logo Changing logo Changing color schemes Changing color schemes Basically, anything you can do through administration interface Basically, anything you can do through administration interface

Customizing Themes Intermediate options Intermediate options Make a copy of a theme and modify it (or create a subtheme) Make a copy of a theme and modify it (or create a subtheme) Replace images Replace images Edit Styles.css and other CSS files Edit Styles.css and other CSS files

Customizing Themes Advanced options Advanced options Make a copy of a theme and modify it (or create a subtheme) Make a copy of a theme and modify it (or create a subtheme) Edit template files (foo.tpl.php) Edit template files (foo.tpl.php) Create new template files (node-game.tpl.php) Create new template files (node-game.tpl.php) Override PHP functions Override PHP functions

How can I… Change the style of an element on a page? Change the style of an element on a page? Make a custom copy of your base theme Make a custom copy of your base theme Find the relevant stylesheet entry with firebug Find the relevant stylesheet entry with firebug Turn off CSS file optimization so you can see changes (Site Configuration -> Performance) Turn off CSS file optimization so you can see changes (Site Configuration -> Performance) Edit the appropriate stylesheet Edit the appropriate stylesheet

How can I… Change the HTML of an element on a page? Change the HTML of an element on a page? Customize the appropriate template file (tpl.php)… Customize the appropriate template file (tpl.php)…

What is a theme? Provides the opportunity to modify a page before it is displayed Provides the opportunity to modify a page before it is displayed Every element on a page is run through the theme system Every element on a page is run through the theme system Theme engine, e.g. PHPTemplate [default], Smarty, PHPTAL Theme engine, e.g. PHPTemplate [default], Smarty, PHPTAL Theme, e.g. Garland Theme, e.g. Garland

How do themes get applied? Node Module Theme Engine Currently Enabled Theme Final HTML Basic HTML

Theme basics.info files.info files Other attributes: Other attributes: screenshot screenshot base theme base theme features features stylesheets stylesheets scripts scripts name = NewsFlash description = A Drupal 6 Theme by RoopleTheme version = VERSION core = 6.x engine = phptemplate regions[sidebar_left] = Left Sidebar regions[sidebar_right] = Right Sidebar regions[header] = Header regions[suckerfish] = Suckerfish Menu regions[user1] = User 1 regions[user2] = User 2 regions[user3] = User 3 regions[content_top] = Content Top regions[content_bottom] = Content Bottom regions[user4] = User 4 regions[user5] = User 5 regions[user6] = User 6 regions[footer_region] = Footer

Regions By default there are five: By default there are five: Header (header) Header (header) Footer (footer) Footer (footer) Left sidebar (left) Left sidebar (left) Right Sidebar (right) Right Sidebar (right) Content (content) Content (content) You can define as a custom set in the.info file You can define as a custom set in the.info file regions[header] = Header regions[header] = Header regions[content] = Content regions[content] = Content regions[ads] = Ad s regions[ads] = Ad s

Features Default features Default features Logo (logo) Logo (logo) Site name (name) Site name (name) Site slogan (slogan) Site slogan (slogan) Mission stmt (mission) Mission stmt (mission) node_user_pictures node_user_pictures comment_user_pictures comment_user_pictures Search box Search box Shortcut icon Shortcut icon Primary links Primary links Secondary links Secondary links Or define custom features: features[] = name features[] = slogan features[] = mission features[] = blurb features[] = contact

CSS, JavaScript By default, Drupal will include the CSS file "styles.css" By default, Drupal will include the CSS file "styles.css" If you want other files, customize: If you want other files, customize: stylesheets[all][] = styles/reset.css stylesheets[all][] = styles/reset.css stylesheets[all][] = styles/typography.css stylesheets[all][] = styles/typography.css stylesheets[all][] = styles/forms.css stylesheets[all][] = styles/forms.css stylesheets[all][] = styles.css stylesheets[all][] = styles.css Similarly for JavaScript; default is script.js Similarly for JavaScript; default is script.js

Hint: stylesheet optimization How many stylesheets are included in a page on your website? How many stylesheets are included in a page on your website? Configuration -> Performance Configuration -> Performance Optimize CSS Optimize CSS Optimize JavaScript Optimize JavaScript Enable page cache Enable page cache Enable block cache Enable block cache [these options make development harder] [these options make development harder]

More customization? Options so far allow images and CSS Options so far allow images and CSS What if you want to move the picture from the top of a post to the bottom? What if you want to move the picture from the top of a post to the bottom? Template files (*.tpl.php) Template files (*.tpl.php) comment.tpl.php –controls comment output comment.tpl.php –controls comment output page.tpl.php – controls page output page.tpl.php – controls page output node.tpl.php – guess node.tpl.php – guess Theme Developer module is extremely helpful Theme Developer module is extremely helpful

Templates and defaults Templates control behavior Templates control behavior comment: modules/comment/comment.tpl.php comment: modules/comment/comment.tpl.php override: sites/all/marinelli/comment.tpl.php override: sites/all/marinelli/comment.tpl.php Theme engine handles overriding Theme engine handles overriding

Example: Add a div Example: you want to add a around the comment's title. Example: you want to add a around the comment's title. Copy modules/comment/comment.tpl.php to sites/all/modules/ yourmod Copy modules/comment/comment.tpl.php to sites/all/modules/ yourmod Edit it to your heart's content Edit it to your heart's content

Example: move breadcrumbs up How to move breadcrumbs into the header region? How to move breadcrumbs into the header region? If necessary, copy page.tpl.php into the theme If necessary, copy page.tpl.php into the theme Edit to move breadcrumb variable Edit to move breadcrumb variable Add.breadcrumb,.breadcrumb a styles to stylesheet as needed Add.breadcrumb,.breadcrumb a styles to stylesheet as needed

Example: adding a region Edit theme.info to add the region you want Edit theme.info to add the region you want Edit page.tpl.php to display the region Edit page.tpl.php to display the region

Theming specific content types Suppose you've created a new content type, 'game'. How to theme it? Suppose you've created a new content type, 'game'. How to theme it? Copy node.tpl.php into your theme directory Copy node.tpl.php into your theme directory Copy node.tpl.php to node-game.tpl.php Copy node.tpl.php to node-game.tpl.php Edit node-game.tpl.php to your heart's content! Edit node-game.tpl.php to your heart's content! But how to you get at the fields? But how to you get at the fields? Can get at individual fields in the template file content-field.tpl.php—but only one at a time Can get at individual fields in the template file content-field.tpl.php—but only one at a time Can we hack the $content of the node? Can we hack the $content of the node?

template.php file.tpl.php files are cool….tpl.php files are cool… can modify HTML output… can modify HTML output… …but you can't change what you are given in the variables …but you can't change what you are given in the variables template.php: override just about anything template.php: override just about anything Want a new variable called $authored that can be used in node.tpl.php? Want a new variable called $authored that can be used in node.tpl.php? This requires PHP. (Only PHP can get at the deepest layers of Drupal.) This requires PHP. (Only PHP can get at the deepest layers of Drupal.) (Documentation: see Drupal 6 theming guide) (Documentation: see Drupal 6 theming guide)Drupal 6 theming guideDrupal 6 theming guide

template.php example from Foundation module <?php/** * override or insert PHPTemplate * override or insert PHPTemplate * variables into the node templates * variables into the node templates */ */ function foundation_preprocess_node(&$vars) { // Set author info line separately from the full $submitted variable // Set author info line separately from the full $submitted variable $vars['authored'] = t('Submitted by'). ' '. $vars['name']; $vars['authored'] = t('Submitted by'). ' '. $vars['name'];}

Adding theme variables All variables that go out to a theme are sent through a preprocess function All variables that go out to a theme are sent through a preprocess function You can create your own variables, or change existing ones, in the template.php file: You can create your own variables, or change existing ones, in the template.php file:<?php function prepsoccer_preprocess_node(&$vars) { $vars['random_number'] = rand(1,100); $vars['random_number'] = rand(1,100);} in a.tpl.php file -----