drupal theming Úvod do šablonování převod webu do drupalu
DESCRIPTION
Drupal theming Úvod do šablonování Převod webu do Drupalu. Martin Sladeček. Jak vytvořím vlastní vzhled?. http://drupal.org/project/Themes Starter themes - http://drupal.org/project/zen - http://drupal.org/project/basic Tvorba vlastního tématu - design - html/css - drupal theme. Drupal Theme. - PowerPoint PPT PresentationTRANSCRIPT
![Page 1: Drupal theming Úvod do šablonování Převod webu do Drupalu](https://reader034.vdocuments.mx/reader034/viewer/2022051401/56814290550346895daebbe8/html5/thumbnails/1.jpg)
Drupal themingÚvod do šablonování
Převod webu do Drupalu
Martin Sladeček
![Page 2: Drupal theming Úvod do šablonování Převod webu do Drupalu](https://reader034.vdocuments.mx/reader034/viewer/2022051401/56814290550346895daebbe8/html5/thumbnails/2.jpg)
© Sladeček Martin Další informace: http://drupal.org/node/323993
Jak vytvořím vlastní vzhled?1. http://drupal.org/project/Themes
2. Starter themes- http://drupal.org/project/zen- http://drupal.org/project/basic
3. Tvorba vlastního tématu- design- html/css- drupal theme
![Page 3: Drupal theming Úvod do šablonování Převod webu do Drupalu](https://reader034.vdocuments.mx/reader034/viewer/2022051401/56814290550346895daebbe8/html5/thumbnails/3.jpg)
© Sladeček Martin Další informace: http://drupal.org/node/171194
Složka_root_/themes_root_/sites/all/themes/jmenosablony_root_/sites/default/themes/
jmenosablonyNázev tématu musí začínat
písmenem(ne číslice ani znak)
Drupal Theme
jmenosablony
![Page 4: Drupal theming Úvod do šablonování Převod webu do Drupalu](https://reader034.vdocuments.mx/reader034/viewer/2022051401/56814290550346895daebbe8/html5/thumbnails/4.jpg)
© Sladeček Martin Další informace: http://drupal.org/node/171194
Co je to theme?
jmenosablony
jmenosablony.info
![Page 5: Drupal theming Úvod do šablonování Převod webu do Drupalu](https://reader034.vdocuments.mx/reader034/viewer/2022051401/56814290550346895daebbe8/html5/thumbnails/5.jpg)
© Sladeček Martin Další informace: http://drupal.org/node/171194
Co je to theme?
jmenosablony
jmenosablony.info
tpl.php
![Page 6: Drupal theming Úvod do šablonování Převod webu do Drupalu](https://reader034.vdocuments.mx/reader034/viewer/2022051401/56814290550346895daebbe8/html5/thumbnails/6.jpg)
© Sladeček Martin Další informace: http://drupal.org/node/171194
Co je to theme?
jmenosablony
jmenosablony.info
tpl.php
css
js
style.css
print.css
xxx.js
xxx.js
![Page 7: Drupal theming Úvod do šablonování Převod webu do Drupalu](https://reader034.vdocuments.mx/reader034/viewer/2022051401/56814290550346895daebbe8/html5/thumbnails/7.jpg)
© Sladeček Martin Další informace: http://drupal.org/node/171194
Co je to theme?
jmenosablony
jmenosablony.info
tpl.php
css
js
style.css
print.css
xxx.js
xxx.js
template.php
![Page 8: Drupal theming Úvod do šablonování Převod webu do Drupalu](https://reader034.vdocuments.mx/reader034/viewer/2022051401/56814290550346895daebbe8/html5/thumbnails/8.jpg)
© Sladeček Martin Další informace: http://drupal.org/node/171194
Co je to theme?
jmenosablony
jmenosablony.info
tpl.php
css
js
style.css
print.css
xxx.js
xxx.js
template.phpfavicon.ico, screenshot.png, logo.png
![Page 9: Drupal theming Úvod do šablonování Převod webu do Drupalu](https://reader034.vdocuments.mx/reader034/viewer/2022051401/56814290550346895daebbe8/html5/thumbnails/9.jpg)
© Sladeček Martin Další informace: http://drupal.org/node/171205
.info soubor 1/3; $Id: garland.info,v 1.5 2007/07/01 23:27:32 goba Exp $
name = Jméno šablony
description = Popis šablony...
core = 6.x
engine = phptemplate
version = 6.1-dev
screenshot = screenshot.png
base theme = zen
![Page 10: Drupal theming Úvod do šablonování Převod webu do Drupalu](https://reader034.vdocuments.mx/reader034/viewer/2022051401/56814290550346895daebbe8/html5/thumbnails/10.jpg)
© Sladeček Martin Další informace: http://drupal.org/node/171205
.info soubor 2/3stylesheets[all][] = css/style.cssstylesheets[print][] = css/print.css
scripts[] = js/javascript.jsscripts[] = js/javascript2.js
regions[left] = Levýregions[right] = Pravýregions[content_top] = Horní panel
![Page 11: Drupal theming Úvod do šablonování Převod webu do Drupalu](https://reader034.vdocuments.mx/reader034/viewer/2022051401/56814290550346895daebbe8/html5/thumbnails/11.jpg)
© Sladeček Martin Další informace: http://drupal.org/node/171205
.info soubor 3/3features[] = logo
features[] = name
features[] = slogan
features[] = search
features[] = favicon
features[] = primary_links
features[] = secondary_links
; features[] = mission
; features[] = node_user_picture
; features[] = comment_user_picture
![Page 12: Drupal theming Úvod do šablonování Převod webu do Drupalu](https://reader034.vdocuments.mx/reader034/viewer/2022051401/56814290550346895daebbe8/html5/thumbnails/12.jpg)
© Sladeček Martin Další informace: http://drupal.org/node/190815
.tpl.phpvzhled jednotlivých prvkůXhtml + PHP proměnnéPokud chybí, nahradí defaultním vzhledemDefaultní šablony = vzor
_root_/modules/jmenomodulu/
page.tpl.phpblock.tpl.phpnode.tpl.phpcomment.tpl.php
![Page 13: Drupal theming Úvod do šablonování Převod webu do Drupalu](https://reader034.vdocuments.mx/reader034/viewer/2022051401/56814290550346895daebbe8/html5/thumbnails/13.jpg)
© Sladeček Martin
page.tpl.php
![Page 14: Drupal theming Úvod do šablonování Převod webu do Drupalu](https://reader034.vdocuments.mx/reader034/viewer/2022051401/56814290550346895daebbe8/html5/thumbnails/14.jpg)
© Sladeček Martin
block.tpl.php
![Page 15: Drupal theming Úvod do šablonování Převod webu do Drupalu](https://reader034.vdocuments.mx/reader034/viewer/2022051401/56814290550346895daebbe8/html5/thumbnails/15.jpg)
© Sladeček Martin
node.tpl.php
![Page 16: Drupal theming Úvod do šablonování Převod webu do Drupalu](https://reader034.vdocuments.mx/reader034/viewer/2022051401/56814290550346895daebbe8/html5/thumbnails/16.jpg)
© Sladeček Martin
comment.tpl.php
![Page 17: Drupal theming Úvod do šablonování Převod webu do Drupalu](https://reader034.vdocuments.mx/reader034/viewer/2022051401/56814290550346895daebbe8/html5/thumbnails/17.jpg)
© Sladeček Martin Další informace: http://drupal.org/node/190815
Alternate templatesAlternate template přepíše původní
template
node-[type].tpl.phppř.: node-blog.tpl.php
page-front.tpl.php
Další informace:http://drupal.org/node/190815
http://www.example.com/node/1/edit
![Page 18: Drupal theming Úvod do šablonování Převod webu do Drupalu](https://reader034.vdocuments.mx/reader034/viewer/2022051401/56814290550346895daebbe8/html5/thumbnails/18.jpg)
Případová studie
![Page 19: Drupal theming Úvod do šablonování Převod webu do Drupalu](https://reader034.vdocuments.mx/reader034/viewer/2022051401/56814290550346895daebbe8/html5/thumbnails/19.jpg)
© Sladeček Martin
![Page 20: Drupal theming Úvod do šablonování Převod webu do Drupalu](https://reader034.vdocuments.mx/reader034/viewer/2022051401/56814290550346895daebbe8/html5/thumbnails/20.jpg)
© Sladeček Martin
![Page 21: Drupal theming Úvod do šablonování Převod webu do Drupalu](https://reader034.vdocuments.mx/reader034/viewer/2022051401/56814290550346895daebbe8/html5/thumbnails/21.jpg)
© Sladeček Martin
![Page 22: Drupal theming Úvod do šablonování Převod webu do Drupalu](https://reader034.vdocuments.mx/reader034/viewer/2022051401/56814290550346895daebbe8/html5/thumbnails/22.jpg)
© Sladeček Martin
Začneme… theme.infoname = Drupal Themedescription = Drupal Brno 21.7.2010core = 6.xengine = phptemplate
stylesheets[all][] = css/style.cssstylesheets[print][] = css/print.css
features[] = logofeatures[] = namefeatures[] = searchfeatures[] = faviconfeatures[] = primary_links
regions[content_top] = Content topregions[right] = Right sidebarregions[bottom_left] = Bottom leftregions[bottom_middle] = Bottom middleregions[bottom_right] = Bottom right
![Page 23: Drupal theming Úvod do šablonování Převod webu do Drupalu](https://reader034.vdocuments.mx/reader034/viewer/2022051401/56814290550346895daebbe8/html5/thumbnails/23.jpg)
© Sladeček Martin
page.tpl.php (modules/system)<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php print $language-
>language ?>" lang="<?php print $language->language ?>" dir="<?php print $language->dir ?>">
<head><?php print $head; ?><title><?php print $head_title; ?></title><?php print $styles; ?><?php print $scripts; ?>
</head><body class="<?php print $body_classes; ?>">….….<?php print $closure; ?></body></html>
![Page 24: Drupal theming Úvod do šablonování Převod webu do Drupalu](https://reader034.vdocuments.mx/reader034/viewer/2022051401/56814290550346895daebbe8/html5/thumbnails/24.jpg)
© Sladeček Martin
![Page 25: Drupal theming Úvod do šablonování Převod webu do Drupalu](https://reader034.vdocuments.mx/reader034/viewer/2022051401/56814290550346895daebbe8/html5/thumbnails/25.jpg)
© Sladeček Martin
page.tpl.php (modules/system)<a href="#" title="Domů" id="logo"><img src="logo.png" alt="Domů"
/></a>
<?php if (!empty($logo)): ?> <a href="<?php print $front_page; ?>" title="<?php print t('Home'); ?>"
rel="home” id=“logo” > <img src="<?php print $logo; ?>" alt="<?php print t('Home'); ?>" /> </a><?php endif; ?>
<?php if (!empty($site_name)): ?><h1 id="site-name"> <a href="<?php print $front_page ?>" title="<?php print t('Home'); ?>"> <?php print $site_name; ?> </a></h1><?php endif; ?>
<?php if (!empty($search_box)): ?> <div id="search-box"><?php print $search_box; ?></div><?php endif; ?>
![Page 26: Drupal theming Úvod do šablonování Převod webu do Drupalu](https://reader034.vdocuments.mx/reader034/viewer/2022051401/56814290550346895daebbe8/html5/thumbnails/26.jpg)
© Sladeček Martin
page.tpl.php (modules/system)<?php if (!empty($primary_links)): ?>
<div id="primary" class="clear-block"><?php print theme('links', $primary_links, array('class' => 'links primary-links')); ?></div>
<?php endif; ?>
<?php if (!empty($content_top)): ?><div id="content-top" class=“sidebar">
<?php print $content_top; ?></div>
<?php endif; ?>
![Page 27: Drupal theming Úvod do šablonování Převod webu do Drupalu](https://reader034.vdocuments.mx/reader034/viewer/2022051401/56814290550346895daebbe8/html5/thumbnails/27.jpg)
© Sladeček Martin
page.tpl.php (modules/system)<div id="content"><?php if (!empty($title)): ?><h1 class="title"><?php print $title; ?></h1><?php endif; ?><?php if (!empty($tabs)): ?><div class="tabs"><?php print $tabs; ?></div><?php endif; ?><?php if (!empty($messages)): print $messages; endif; ?><?php if (!empty($help)): print $help; endif; ?> <div id="content-content" class="clear-block"> <?php print $content; ?> </div></div>
<?php print $footer_message; ?><?php print $feed_icons; ?>
![Page 28: Drupal theming Úvod do šablonování Převod webu do Drupalu](https://reader034.vdocuments.mx/reader034/viewer/2022051401/56814290550346895daebbe8/html5/thumbnails/28.jpg)
Děkuji za pozornostDotazy?