Customizing your Theme

Slides:



Advertisements
Similar presentations
WordPress Themes.
Advertisements

Chapter 3 – Web Design Tables & Page Layout
Creating and Editing a Web Page Using Inline Styles
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
Seattle Drupal Clinic Introduction to Drupal and Web Content Management.
Government Web Template (GWT) for WordPress Updated 03/20/2015.
Customizing your Theme Information Systems 337 Prof. Harry Plantinga.
Intermediate Level Course. Text Format The text styles, bold, italics, underlining, superscript and subscript, can be easily added to selected text. Text.
Macromedia Dreamweaver 4 Foundation Level Course.
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 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.
Search Engine Optimization March 23, 2011 Google Search Engine Optimization Starter Guide.
Wordpress Tutorial 22 – 24 April Table of Contents Introduction Designing blog Writing and Publishing blog Pages Posts Categories Tags Links Comments.
CREATING CUSTOM LAYOUTS IN PANELS. What are panels? Contrib module: Main function Implement.
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.
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
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.
Objective To create a professional, affordable, and easy to use website Create a user friendly interface with accessibility and effortless navigation.
Drupal Jumpstart Information Systems 337 Prof. Harry Plantinga.
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.
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.
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.
INTRODUCTORY Tutorial 5 Using CSS for Layout and Printing.
CSCI 6962: Server-side Design and Programming Facelets and User Interface Design.
Advanced Web 2012 Lecture 11 Sean Costain 2012.
HTML Forms. A form is simply an area that can contain form fields. Form fields are objects that allow the visitor to enter information - for example text.
Adxstudio Portals Training
QUICK START (cont.) How to change the template color theme You can easily change the color theme of your poster by going to the DESIGN menu, click on COLORS,
How to Make a Power Point Go to Slide 2. (You can get there by clicking on slide 2 in Normal VIEW.)
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.
Practice for Chapter 3: Assume that you are a freelance web designer and need to create a website to promote your freelance company.
Creating Web Pages with Links, Images, and Embedded Style Sheets
EKTRON QUICK START GUIDEEKTRON QUICK START GUIDE Version 1.0 Copyright 2013 WebSolutions Technology, Inc. Fuller June 7, 2013.
COMP 143 Web Development with Adobe Dreamweaver CC.
How to use Drupal Awdhesh Kumar (Team Leader) Presentation Topic.
Chapter 8 Using Document Collaboration, Integration, and Charting Tools Microsoft Word 2013.
Creating a Theme From Scratch in Drupal
Objective % Select and utilize tools to design and develop websites.
Weebly Elements, Continued
Your Name Proposal Creation Module 5 Your Name
Template Instructions
CSS Layouts: Positioning and Navbars
2 At the top of the zone in which you want to add the Web Part, click Add a Web Part. In the Add Web Parts to [zone] dialog box, select the check box of.
Drupal Training Series
2 At the top of the zone in which you want to add the Web Part, click Add a Web Part. In the Add Web Parts to [zone] dialog box, select the check box of.
Content Management Systems
Objective % Select and utilize tools to design and develop websites.
Content Management System
© Paradigm Publishing, Inc.
Oracle Sales Cloud Sales campaign
What’s a _resource and What Does It Do?
Customizing Editable Regions and Building Templates
Video Player BIS1523 – Lecture 22.
PowerPoint Lesson 2 Creating and Enhancing PowerPoint Presentations
So you were told to make a website
New Semantic Elements (Part 2)
Rational Publishing Engine RQM Multi Level Report Tutorial
5.00 Apply procedures to organize content by using Dreamweaver. (22%)
Presentation transcript:

Customizing your Theme Information Systems 337 Prof. Harry Plantinga Customizing your Theme

Customizing Themes Beginner options: Changing title slogan Changing logo Changing color schemes Basically, anything you can do through administration interface or Sweaver In marinelli, enable it. Then edit the primary menu. You may want to clear the theme cache (site configuration -> performance)

Customizing Themes Intermediate options Make a copy of a theme and modify it (or create a subtheme) Replace images Edit Styles.css and other CSS files In marinelli, enable it. Then edit the primary menu. You may want to clear the theme cache (site configuration -> performance)

Customizing Themes Advanced options Make a copy of a theme and modify it (or create a subtheme) Edit template files (foo.tpl.php) Create new template files (node--game.tpl.php) Override PHP functions In marinelli, enable it. Then edit the primary menu. You may want to clear the theme cache (site configuration -> performance)

How can I… Change the style of an element on a page? Make a custom copy of your base theme Find the relevant stylesheet entry with Chrome Turn off CSS file optimization so you can see changes (Site Configuration -> Performance) Edit the appropriate stylesheet Example: I want to move the title "Prepsoccer.org" down a nudge. How? Fire up chrome. Look at the stylesheets used. Edit typography stylesheet. Cool!

How can I… Change the HTML of an element on a page? Customize the appropriate template file (tpl.php)… Suppose I want to make the banner image less tall or move the menus lower on the page. How? This will take a bit more understanding of the theme system.

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

How do themes get applied? http://site.org/node/1 Node Module Currently Enabled Theme Basic HTML Final HTML E.g. node/1 would be handled by the node module, admin/build/themes would be handled by the System module, and a path like "Albums" might be handled by the Views module. Theme Engine

Theme basics .info files Other attributes: screenshot base theme features stylesheets 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: Header (header) Footer (footer) Left sidebar (left) Right Sidebar (right) Content (content) You can define as a custom set in the .info file regions[header] = Header regions[content] = Content regions[ads] = Ads

Features Default features comment_user_pictures Logo (logo) Site name (name) Site slogan (slogan) Mission stmt (mission) node_user_pictures comment_user_pictures Search box Shortcut icon Primary 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" If you want other files, customize: stylesheets[all][] = styles/reset.css stylesheets[all][] = styles/typography.css stylesheets[all][] = styles/forms.css stylesheets[all][] = styles.css Similarly for JavaScript; default is script.js

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

More customization? Options so far allow images and CSS What if you want to move the picture from the top of a post to the bottom? Template files (*.tpl.php) comment.tpl.php –controls comment output page.tpl.php – controls page output node.tpl.php – guess Theme Developer module is extremely helpful See e.g. prepsoccer home page. frame = page.tpl.php, main content=node.tpl.php, blocks = block.tpl.php Look at page source and compare those files to see how blocks are generated

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

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

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

Example: adding a region Edit theme.info to add the region you want 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? Copy node.tpl.php into your theme directory Copy node.tpl.php to node-game.tpl.php Edit node-game.tpl.php to your heart's content! 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 we hack the $content of the node?

template.php file .tpl.php files are cool… can modify HTML output… …but you can't change what you are given in the variables template.php: override just about anything 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.) (Documentation: see Drupal 6 theming guide)

template.php example from Foundation module <?php /** * override or insert PHPTemplate * variables into the node templates */ function foundation_preprocess_node(&$vars) { // Set author info line separately from the full $submitted variable $vars['authored'] = t('Submitted by') . ' ' . $vars['name']; } note starting <?php with no corresponding closing tag. Considered good form. * when you override something in a theme, you have to clear caches to see any changes.

Adding theme variables 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: <?php function prepsoccer_preprocess_node(&$vars) { $vars['random_number'] = rand(1,100); } ----- in a .tpl.php file ----- <?php print $random_number; ?> note no closing ?> in template.php file – considered good style