ºÝºÝߣ

ºÝºÝߣShare a Scribd company logo
Themes & Layout Tutorial
Copyright ? 2000-2006 Liferay, Inc.
All Rights Reserved.
No material may be reproduced electronically or in print without written
permission from Liferay, Inc.
Objectives
1. Customize your own Liferay Theme
a. Introduction to Liferay Themes
b. Deploy a Liferay Theme
c. Modify example theme
2. Customize your own Liferay Layout
a. Create a custom 2-3 layout
- (2-3 = 2 column row on top of a 3 column row)
a. Select different layout templates
Introduction to Liferay Themes
With themes, you can quickly & completely
redesign a website layout with a single war file.
Lets see some examples:
- Themes from Liferay Website:
- Liferay.com -> downloads -> community themes
Themes and layouts
Themes and layouts
Themes and layouts
Themes and layouts
Exercise 1
Change the Liferay Theme
a. Startup Tomcat
b. On the Liferay website
¡°Page Settings¡± -> ¡°Look and Feel¡± -> Select Theme
Portal
? Creating a theme can be a very time consuming
process, depending on what exactly needs to be done.
? Step 1: Identify the major components
Most themes contain the following elements:
? Banner
? Navigation
? Portlet area
? Some themes that are more graphically intensive also have a top,
bottom, and left and right sides.
Identify the major components
Identify the major components
Identify the major components
Portlets
? Step 2: Identify the portlet areas
¨C The next step is to identify your portlet areas.
All portlets are composed of 12 pieces.
? Look for all 12 pieces /
images of the portlet
? Notice that some
portlets have wide
borders and some
have thin, it all
depends on how your
portlet is supposed to
look
? If there are shadows
you need to
incorporate the entire
shadow in your image.
Exercise 2
Deploy your own ¡°example.war¡± theme
and change Liferay¡¯s homepage to
use that theme.
This theme will help distinguish each of
the pieces of the theme to give you
practice in editing themes.
Deploying your theme:
1. Startup Tomcat (if not already)
2. Copy ¡°example.war¡± to your themes
folder:
C:ProjectsTrainingextthemesexample.war
3. ¡°ant deploy¡± from your themes folder
4. Reload the page and select this theme
Step 3: Putting it all together
Portlet Area
You will need to cut your portlets up into 12 images like shown above, then populate the 12 portlet areas based on the
images you cut up (set the height, width, and file name of each images)
Hint: look for these lines
css_cached.vm:
extthemesexample.warhtmlthemesexampletemplatescss_cached.vm
¨C .portlet-header-bar-middle
¨C .portlet-header-bar-right
¨C .portlet-header-bar-left
¨C .portlet-corner-ul
¨C .portlet-corner-ur
¨C .portlet-corner-br
¨C .portlet-corner-bl
¨C .portlet-border-top
¨C .portlet-border-left
¨C .portlet-border-right
¨C .portlet-border-bottom
Banner
To build the banner you need to edit:
css_cached.vm:
extthemesexample.warhtmlthemesexampletemplatescss_cached.vm
? .layout-banner-left
? .layout-banner-middle
? .layout-banner-right
Usually only the middle is required, but if the theme needs to stretch along the x
axis you will need left and right as well.
Top, Bottom, Left, Right
Top and Bottom Decorations
css_cached.vm:
extthemesexample.warhtmlthemesexampletemplatescss_cached.vm
¨C #layout-top-decoration
¨C #layout-corner-ul
¨C #layout-corner-ur
¨C #layout-bottom-decoration
¨C #layout-corner-bl
¨C #layout-corner-br
Use these to build your top and bottom decorations
Left and Right Sides
css_cached.vm:
extthemesexample.warhtmlthemesexampletemplatescss_cached.vm
¨C #layout-box-left
¨C #layout-box-right
Look for these to edit the sides
Exercise 3
Modify the example.war theme to look like the one below
? Helpful Notes:
¨C border-left: 1px dotted black;
¨C In Firefox¡¯s web developer extensions press (CTRL-SHFT-F) for helpful HTML info
? Files to modify:
¨C extthemesexample.warhtmlthemesexampletemplates
? css_cached.vm (css)
? portal_normal.vm (layout)
¨C extthemesexample.warWEB-INF
? liferay-look-and-feel.xml ($colorScheme)
Content and Layout
? Why new layouts?
¨C Variety is good
¨C Not all sites are the same
¨C Sometimes the defaults just don¡¯t work for
your needs
? How do we do it?
¨C Layouttpl (Layout Template)
? 4.0.0 makes this process so much easier!
Prepare the layouts folder
? In the EXT directory navigate to the layouttpl folder
? Create a folder called sample.war here
> extlayouttplsample.war
? In sample.war, create two folders: WEB-INF and html
> extlayouttplsample.warWEB-INF
> extlayouttplsample.warhtml
? We have now setup the basic folder structure for layouts.
This is the process that must always be followed for new
layouts
Preparing supporting files
? Inside the WEB-INF folder that was just created, create a
file and name it liferay-layout-templates.xml
> extlayouttplsample.warWEB-INF
liferay-layout-templates.xml
? Now create one more file here, and call it web.xml
> extlayouttplsample.warWEB-INF
web.xml
liferay-layout-templates.xml
liferay-layout-templates.xml
extlayouttplsample.warWEB-INFliferay-layout-templates.xml
<?xml version="1.0"?>
<!DOCTYPE layout-templates PUBLIC "-//Liferay//DTD Layout Templates 4.0.0//EN"
"http://www.liferay.com/dtd/liferay-layout-templates_4_0_0.dtd">
<layout-templates>
<custom>
<layout-template id="training" name="training">
<template-path>/html/layouttpl/custom/training.tpl</template-path>
</layout-template>
</custom>
</layout-templates>
What did that do?
? Layout-templates is our root element, it tells Liferay that
we are defining new layouts
? Custom tells Liferay that this is not a built in template,
but something new
? Layout-template-id and name let Liferay know what to
¨C Display in add content
¨C Set as the unique id for this template
? Template-path tells Liferay where to find the template
structure (tpl) file
web.xml
web.xml
extlayouttplsample.warWEB-INFweb.xml
<?xml version="1.0"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application
2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<display-name>sample</display-name>
<listener>
<listener-
class>com.liferay.portal.kernel.servlet.LayoutTemplateContextListener</listener
-class>
</listener>
</web-app>
Preparing the tpl file
? In extlayouttplsample.warhtml,
¨C create a ¡°layouttpl¡± folder:
? Inside layouttpl,
¨C create a ¡°custom¡± folder:
? Inside custom,
¨C create the file ¡°training.tpl¡±
? extlayouttplsample.warhtmllayouttplcustomtraining.tpl
2-3 column layout code
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td valign="top" width="45%">$processor.processColumn("column-1")</td>
<td width="10%">&nbsp;</td>
<td valign="top" width="45%">$processor.processColumn("column-2")</td>
</tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td valign="top" width="30%">$processor.processColumn("column-3")</td>
<td width="5%">&nbsp;</td>
<td valign="top" width="30%">$processor.processColumn("column-4")</td>
<td width="5%">&nbsp;</td>
<td valign="top" width="30%">$processor.processColumn("column-5")</td>
</tr>
</table>
Deploy Layouts
? Navigate to ext/layouttpl
? Run ant deploy
? Open a web browser to http://localhost
? Login
? For this example, let¡¯s create a new page
Let¡¯s add content!
? Click Add Content
? Select your Layout Template
? Click test and add (portlets with small width):
? Hello Laszlo
? Hello Velocity
? Hello World
? Your sample portlet
Finish it
? Refresh your page
? Drag all the portlets around to fill the five
columns
Summary
? You should now know:
¨C How to create a basic theme
¨C How to create custom layouts
¨C How to add new content pages
¨C How to use change the layout template
? Things to practice
¨C The more CSS and HTML you know, the
better off you will be
¨C Getting a theme just right takes time. Don¡¯t
lose faith, it is possible!
Congratulations!
Congratulations! You¡¯ve just modified your own theme!
Login: test@liferay.com
Password: test
To hot deploy JSR-168 compliant portlets, Liferay layout templates, or
Liferay themes just drop your *.war files in C:/home/liferay/deploy
Sample portlets can be found here:
http://www.liferay.com/web/guest/downloads/samples
For more information on hot deploy, click here:
http://content.liferay.com/4.0.0/docs/developers/ch06s01.html
Revision History
Scott Lee 11/2/2006
- Created & Updated slides from Brett¡¯s Theme Docs & Layout Ppt
Scott Lee 11/10/2006
- Fixed typos (Liferay-layout-templates.xml, tpl filepath)
- added ¡°helpful notes¡± for excercise

More Related Content

Viewers also liked (20)

Principles Of Power Point Design- Working With Layout Grids
Principles Of Power Point Design- Working With Layout GridsPrinciples Of Power Point Design- Working With Layout Grids
Principles Of Power Point Design- Working With Layout Grids
John Fallon
?
Principles Of Power Point Design- ºÝºÝߣ Layout Do's And Don'ts
Principles Of Power Point Design- ºÝºÝߣ Layout Do's And Don'tsPrinciples Of Power Point Design- ºÝºÝߣ Layout Do's And Don'ts
Principles Of Power Point Design- ºÝºÝߣ Layout Do's And Don'ts
John Fallon
?
Modern Visual Design
Modern Visual DesignModern Visual Design
Modern Visual Design
Barry Nadler
?
Liferay Configuration and Customization
Liferay Configuration and CustomizationLiferay Configuration and Customization
Liferay Configuration and Customization
Th¨¤nh Nguy?n
?
Struktur und Modell medienbezogener St?rungen durch Social Media-Partizipatio...Struktur und Modell medienbezogener St?rungen durch Social Media-Partizipatio...
Struktur und Modell medienbezogener St?rungen durch Social Media-Partizipatio...
Anja Lorenz
?
EclipseCon Europe 2015 - liferay modularity patterns using OSGi -Rafik Harabi
EclipseCon Europe 2015 - liferay modularity patterns using OSGi -Rafik HarabiEclipseCon Europe 2015 - liferay modularity patterns using OSGi -Rafik Harabi
EclipseCon Europe 2015 - liferay modularity patterns using OSGi -Rafik Harabi
Rafik HARABI
?
Using mySQL in PHP
Using mySQL in PHPUsing mySQL in PHP
Using mySQL in PHP
Mike Crabb
?
Presentation & Pitching tips
Presentation & Pitching tipsPresentation & Pitching tips
Presentation & Pitching tips
ABrandNewYou
?
JQuery-Tutorial
 JQuery-Tutorial JQuery-Tutorial
JQuery-Tutorial
tutorialsruby
?
Fcp lecture 01
Fcp lecture 01Fcp lecture 01
Fcp lecture 01
educationfront
?
Financial intelligent for start ups
Financial intelligent for start upsFinancial intelligent for start ups
Financial intelligent for start ups
jubril
?
Microsoft excel beginner
Microsoft excel beginnerMicrosoft excel beginner
Microsoft excel beginner
denstar ricardo silalahi
?
Intro to php
Intro to phpIntro to php
Intro to php
Sp Singh
?
How to Use Publicity to Grow Your Startup
How to Use Publicity to Grow Your StartupHow to Use Publicity to Grow Your Startup
How to Use Publicity to Grow Your Startup
Joy Schoffler
?
Why Learn PHP Programming?
Why Learn PHP Programming?Why Learn PHP Programming?
Why Learn PHP Programming?
XtreemHeights
?
Intro to PHP for Beginners
Intro to PHP for BeginnersIntro to PHP for Beginners
Intro to PHP for Beginners
mtlgirlgeeks
?
Computer Programming- Lecture 10
Computer Programming- Lecture 10Computer Programming- Lecture 10
Computer Programming- Lecture 10
Dr. Md. Shohel Sayeed
?
Excel training for beginners
Excel training for beginnersExcel training for beginners
Excel training for beginners
Parul Sharan
?
phpTutorial1
phpTutorial1phpTutorial1
phpTutorial1
tutorialsruby
?
Beating the decline of the Facebook Organic Reach - KRDS singapore
Beating the decline of the Facebook Organic Reach - KRDS singapore Beating the decline of the Facebook Organic Reach - KRDS singapore
Beating the decline of the Facebook Organic Reach - KRDS singapore
KRDS
?
Principles Of Power Point Design- Working With Layout Grids
Principles Of Power Point Design- Working With Layout GridsPrinciples Of Power Point Design- Working With Layout Grids
Principles Of Power Point Design- Working With Layout Grids
John Fallon
?
Principles Of Power Point Design- ºÝºÝߣ Layout Do's And Don'ts
Principles Of Power Point Design- ºÝºÝߣ Layout Do's And Don'tsPrinciples Of Power Point Design- ºÝºÝߣ Layout Do's And Don'ts
Principles Of Power Point Design- ºÝºÝߣ Layout Do's And Don'ts
John Fallon
?
Liferay Configuration and Customization
Liferay Configuration and CustomizationLiferay Configuration and Customization
Liferay Configuration and Customization
Th¨¤nh Nguy?n
?
Struktur und Modell medienbezogener St?rungen durch Social Media-Partizipatio...Struktur und Modell medienbezogener St?rungen durch Social Media-Partizipatio...
Struktur und Modell medienbezogener St?rungen durch Social Media-Partizipatio...
Anja Lorenz
?
EclipseCon Europe 2015 - liferay modularity patterns using OSGi -Rafik Harabi
EclipseCon Europe 2015 - liferay modularity patterns using OSGi -Rafik HarabiEclipseCon Europe 2015 - liferay modularity patterns using OSGi -Rafik Harabi
EclipseCon Europe 2015 - liferay modularity patterns using OSGi -Rafik Harabi
Rafik HARABI
?
Using mySQL in PHP
Using mySQL in PHPUsing mySQL in PHP
Using mySQL in PHP
Mike Crabb
?
Presentation & Pitching tips
Presentation & Pitching tipsPresentation & Pitching tips
Presentation & Pitching tips
ABrandNewYou
?
Financial intelligent for start ups
Financial intelligent for start upsFinancial intelligent for start ups
Financial intelligent for start ups
jubril
?
How to Use Publicity to Grow Your Startup
How to Use Publicity to Grow Your StartupHow to Use Publicity to Grow Your Startup
How to Use Publicity to Grow Your Startup
Joy Schoffler
?
Why Learn PHP Programming?
Why Learn PHP Programming?Why Learn PHP Programming?
Why Learn PHP Programming?
XtreemHeights
?
Intro to PHP for Beginners
Intro to PHP for BeginnersIntro to PHP for Beginners
Intro to PHP for Beginners
mtlgirlgeeks
?
Excel training for beginners
Excel training for beginnersExcel training for beginners
Excel training for beginners
Parul Sharan
?
Beating the decline of the Facebook Organic Reach - KRDS singapore
Beating the decline of the Facebook Organic Reach - KRDS singapore Beating the decline of the Facebook Organic Reach - KRDS singapore
Beating the decline of the Facebook Organic Reach - KRDS singapore
KRDS
?

Similar to Themes and layouts (20)

Joomla! Day UK 2009 Basic Templates
Joomla! Day UK 2009 Basic TemplatesJoomla! Day UK 2009 Basic Templates
Joomla! Day UK 2009 Basic Templates
Andy Wallace
?
Joomla Day UK 2009 Basic Templates
Joomla Day UK 2009 Basic TemplatesJoomla Day UK 2009 Basic Templates
Joomla Day UK 2009 Basic Templates
Chris Davenport
?
Drupal 8: frontend development
Drupal 8: frontend developmentDrupal 8: frontend development
Drupal 8: frontend development
sparkfabrik
?
Drupal theming
Drupal themingDrupal theming
Drupal theming
Philip Norton
?
Creating Custom Templates for Joomla! 2.5
Creating Custom Templates for Joomla! 2.5Creating Custom Templates for Joomla! 2.5
Creating Custom Templates for Joomla! 2.5
Don Cranford
?
Drupal theming - a practical approach (European Drupal Days 2015)
Drupal theming - a practical approach (European Drupal Days 2015)Drupal theming - a practical approach (European Drupal Days 2015)
Drupal theming - a practical approach (European Drupal Days 2015)
Eugenio Minardi
?
Drupal Themes
Drupal ThemesDrupal Themes
Drupal Themes
akosh
?
Module 3 - Intro to Bootstrap
Module 3 - Intro to BootstrapModule 3 - Intro to Bootstrap
Module 3 - Intro to Bootstrap
Katherine McCurdy-Lapierre, R.G.D.
?
Adopt or hack - how to hack a theme in a Drupal way
Adopt or hack - how to hack a theme in a Drupal wayAdopt or hack - how to hack a theme in a Drupal way
Adopt or hack - how to hack a theme in a Drupal way
Marek Sotak
?
Joomla Templates101
Joomla Templates101Joomla Templates101
Joomla Templates101
Barb Ackemann
?
Drupal 8 theming deep dive
Drupal 8 theming deep diveDrupal 8 theming deep dive
Drupal 8 theming deep dive
Romain Jarraud
?
Keycloak theme customization
Keycloak theme customizationKeycloak theme customization
Keycloak theme customization
Ravi Yasas
?
Design to Theme @ CMSExpo
Design to Theme @ CMSExpoDesign to Theme @ CMSExpo
Design to Theme @ CMSExpo
Emma Jane Hogbin Westby
?
Designing for magento
Designing for magentoDesigning for magento
Designing for magento
hainutemicute
?
Creating a basic joomla
Creating a basic joomlaCreating a basic joomla
Creating a basic joomla
shailendra vishwakarma
?
Intro to Theming Drupal, FOSSLC Summer Camp 2010
Intro to Theming Drupal, FOSSLC Summer Camp 2010Intro to Theming Drupal, FOSSLC Summer Camp 2010
Intro to Theming Drupal, FOSSLC Summer Camp 2010
Emma Jane Hogbin Westby
?
7 Theming in Drupal
7 Theming in Drupal7 Theming in Drupal
7 Theming in Drupal
Wingston
?
ExtBase workshop
ExtBase workshop ExtBase workshop
ExtBase workshop
schmutt
?
Creating custom themes in AtoM
Creating custom themes in AtoMCreating custom themes in AtoM
Creating custom themes in AtoM
Artefactual Systems - AtoM
?
Melody Designer Training
Melody Designer TrainingMelody Designer Training
Melody Designer Training
Byrne Reese
?
Joomla! Day UK 2009 Basic Templates
Joomla! Day UK 2009 Basic TemplatesJoomla! Day UK 2009 Basic Templates
Joomla! Day UK 2009 Basic Templates
Andy Wallace
?
Joomla Day UK 2009 Basic Templates
Joomla Day UK 2009 Basic TemplatesJoomla Day UK 2009 Basic Templates
Joomla Day UK 2009 Basic Templates
Chris Davenport
?
Drupal 8: frontend development
Drupal 8: frontend developmentDrupal 8: frontend development
Drupal 8: frontend development
sparkfabrik
?
Creating Custom Templates for Joomla! 2.5
Creating Custom Templates for Joomla! 2.5Creating Custom Templates for Joomla! 2.5
Creating Custom Templates for Joomla! 2.5
Don Cranford
?
Drupal theming - a practical approach (European Drupal Days 2015)
Drupal theming - a practical approach (European Drupal Days 2015)Drupal theming - a practical approach (European Drupal Days 2015)
Drupal theming - a practical approach (European Drupal Days 2015)
Eugenio Minardi
?
Drupal Themes
Drupal ThemesDrupal Themes
Drupal Themes
akosh
?
Adopt or hack - how to hack a theme in a Drupal way
Adopt or hack - how to hack a theme in a Drupal wayAdopt or hack - how to hack a theme in a Drupal way
Adopt or hack - how to hack a theme in a Drupal way
Marek Sotak
?
Drupal 8 theming deep dive
Drupal 8 theming deep diveDrupal 8 theming deep dive
Drupal 8 theming deep dive
Romain Jarraud
?
Keycloak theme customization
Keycloak theme customizationKeycloak theme customization
Keycloak theme customization
Ravi Yasas
?
Intro to Theming Drupal, FOSSLC Summer Camp 2010
Intro to Theming Drupal, FOSSLC Summer Camp 2010Intro to Theming Drupal, FOSSLC Summer Camp 2010
Intro to Theming Drupal, FOSSLC Summer Camp 2010
Emma Jane Hogbin Westby
?
7 Theming in Drupal
7 Theming in Drupal7 Theming in Drupal
7 Theming in Drupal
Wingston
?
ExtBase workshop
ExtBase workshop ExtBase workshop
ExtBase workshop
schmutt
?
Melody Designer Training
Melody Designer TrainingMelody Designer Training
Melody Designer Training
Byrne Reese
?

Recently uploaded (20)

English - The Art of Ruling (Political Governance) - Republic of Botswana.pdf
English - The Art of Ruling (Political Governance) - Republic of Botswana.pdfEnglish - The Art of Ruling (Political Governance) - Republic of Botswana.pdf
English - The Art of Ruling (Political Governance) - Republic of Botswana.pdf
Filipino Tracts and Literature Society Inc.
?
30744_27672740459_POWERFULBLACKMAGICINSTANTDEATHSPELLCASTERINUSA_NETHERLANDS_...
30744_27672740459_POWERFULBLACKMAGICINSTANTDEATHSPELLCASTERINUSA_NETHERLANDS_...30744_27672740459_POWERFULBLACKMAGICINSTANTDEATHSPELLCASTERINUSA_NETHERLANDS_...
30744_27672740459_POWERFULBLACKMAGICINSTANTDEATHSPELLCASTERINUSA_NETHERLANDS_...
sheikhmuhusinbadawi
?
Sabbath School Lesson 10, 1st Quarter 2025.pptx
Sabbath School Lesson 10, 1st Quarter 2025.pptxSabbath School Lesson 10, 1st Quarter 2025.pptx
Sabbath School Lesson 10, 1st Quarter 2025.pptx
DavidSyahputra4
?
Paras Parivaar Charitable Trust.paras bhai
Paras Parivaar Charitable Trust.paras bhaiParas Parivaar Charitable Trust.paras bhai
Paras Parivaar Charitable Trust.paras bhai
Paras Parivaar
?
Viral: Acts 2.22-36_Peter's Sermon_Part 2.pptx
Viral: Acts 2.22-36_Peter's Sermon_Part 2.pptxViral: Acts 2.22-36_Peter's Sermon_Part 2.pptx
Viral: Acts 2.22-36_Peter's Sermon_Part 2.pptx
Stephen Palm
?
NOTICE OF INFORMATION JC-DKR-03082025-01 (1).pdf
NOTICE OF INFORMATION JC-DKR-03082025-01 (1).pdfNOTICE OF INFORMATION JC-DKR-03082025-01 (1).pdf
NOTICE OF INFORMATION JC-DKR-03082025-01 (1).pdf
trungvo92
?
Sendero viviente en https://es.slideshare.net/slideshow/sendero-viviente-en-a...
Sendero viviente en https://es.slideshare.net/slideshow/sendero-viviente-en-a...Sendero viviente en https://es.slideshare.net/slideshow/sendero-viviente-en-a...
Sendero viviente en https://es.slideshare.net/slideshow/sendero-viviente-en-a...
Rafael Reverte P¨¦rez
?
How Science and Religion Can Be Besties: Part 4
How Science and Religion Can Be Besties: Part 4How Science and Religion Can Be Besties: Part 4
How Science and Religion Can Be Besties: Part 4
Vintage Church
?
The Bible - The Old Testament - The Bible - Old Testament
The Bible - The Old Testament - The Bible - Old TestamentThe Bible - The Old Testament - The Bible - Old Testament
The Bible - The Old Testament - The Bible - Old Testament
GimanBrianJay
?
Trusting God for Victory in Life's Struggles
Trusting God for Victory in Life's StrugglesTrusting God for Victory in Life's Struggles
Trusting God for Victory in Life's Struggles
TImothy leonard
?
Sendero viviente -Autobiograf¨ªa de un iluminado- en INGLES.pdf
Sendero viviente -Autobiograf¨ªa de un iluminado- en INGLES.pdfSendero viviente -Autobiograf¨ªa de un iluminado- en INGLES.pdf
Sendero viviente -Autobiograf¨ªa de un iluminado- en INGLES.pdf
Rafael Reverte P¨¦rez
?
St John's Church Parish Diary for March 25
St John's Church Parish Diary for March 25St John's Church Parish Diary for March 25
St John's Church Parish Diary for March 25
Chris Lyne
?
(January 1) Solemnidad nang Maria, Ing Virgen Indu ning Dios.pptx
(January 1) Solemnidad nang Maria, Ing Virgen Indu ning Dios.pptx(January 1) Solemnidad nang Maria, Ing Virgen Indu ning Dios.pptx
(January 1) Solemnidad nang Maria, Ing Virgen Indu ning Dios.pptx
FRANCISCORENZS
?
Kurdish Central Sorani - The Importance of Child Discipline and Honoring Your...
Kurdish Central Sorani - The Importance of Child Discipline and Honoring Your...Kurdish Central Sorani - The Importance of Child Discipline and Honoring Your...
Kurdish Central Sorani - The Importance of Child Discipline and Honoring Your...
Filipino Tracts and Literature Society Inc.
?
What are the most effective spiritual healing techniques for reducing stress_...
What are the most effective spiritual healing techniques for reducing stress_...What are the most effective spiritual healing techniques for reducing stress_...
What are the most effective spiritual healing techniques for reducing stress_...
Worldfamouspsychicreader
?
Brown Black Classic Painting Project History Presentation (1).pptx
Brown Black Classic Painting Project History Presentation (1).pptxBrown Black Classic Painting Project History Presentation (1).pptx
Brown Black Classic Painting Project History Presentation (1).pptx
AllyzzaAzotea
?
Viral Series_Acts 2.36-41_Sermon ºÝºÝߣs.pptx
Viral Series_Acts 2.36-41_Sermon ºÝºÝߣs.pptxViral Series_Acts 2.36-41_Sermon ºÝºÝߣs.pptx
Viral Series_Acts 2.36-41_Sermon ºÝºÝߣs.pptx
Stephen Palm
?
St. John's Parish Magazine - March 2025 (web)
St. John's Parish Magazine - March 2025 (web)St. John's Parish Magazine - March 2025 (web)
St. John's Parish Magazine - March 2025 (web)
Chris Lyne
?
Joshua 3.1-14 God Leads His People GPBC 03.02.25.pptx
Joshua 3.1-14 God Leads His People GPBC 03.02.25.pptxJoshua 3.1-14 God Leads His People GPBC 03.02.25.pptx
Joshua 3.1-14 God Leads His People GPBC 03.02.25.pptx
Lazarou Richard
?
tagreba.ppt????? ??? ????? ??? ????? ?????
tagreba.ppt????? ??? ????? ??? ????? ?????tagreba.ppt????? ??? ????? ??? ????? ?????
tagreba.ppt????? ??? ????? ??? ????? ?????
martinamaged7
?
30744_27672740459_POWERFULBLACKMAGICINSTANTDEATHSPELLCASTERINUSA_NETHERLANDS_...
30744_27672740459_POWERFULBLACKMAGICINSTANTDEATHSPELLCASTERINUSA_NETHERLANDS_...30744_27672740459_POWERFULBLACKMAGICINSTANTDEATHSPELLCASTERINUSA_NETHERLANDS_...
30744_27672740459_POWERFULBLACKMAGICINSTANTDEATHSPELLCASTERINUSA_NETHERLANDS_...
sheikhmuhusinbadawi
?
Sabbath School Lesson 10, 1st Quarter 2025.pptx
Sabbath School Lesson 10, 1st Quarter 2025.pptxSabbath School Lesson 10, 1st Quarter 2025.pptx
Sabbath School Lesson 10, 1st Quarter 2025.pptx
DavidSyahputra4
?
Paras Parivaar Charitable Trust.paras bhai
Paras Parivaar Charitable Trust.paras bhaiParas Parivaar Charitable Trust.paras bhai
Paras Parivaar Charitable Trust.paras bhai
Paras Parivaar
?
Viral: Acts 2.22-36_Peter's Sermon_Part 2.pptx
Viral: Acts 2.22-36_Peter's Sermon_Part 2.pptxViral: Acts 2.22-36_Peter's Sermon_Part 2.pptx
Viral: Acts 2.22-36_Peter's Sermon_Part 2.pptx
Stephen Palm
?
NOTICE OF INFORMATION JC-DKR-03082025-01 (1).pdf
NOTICE OF INFORMATION JC-DKR-03082025-01 (1).pdfNOTICE OF INFORMATION JC-DKR-03082025-01 (1).pdf
NOTICE OF INFORMATION JC-DKR-03082025-01 (1).pdf
trungvo92
?
Sendero viviente en https://es.slideshare.net/slideshow/sendero-viviente-en-a...
Sendero viviente en https://es.slideshare.net/slideshow/sendero-viviente-en-a...Sendero viviente en https://es.slideshare.net/slideshow/sendero-viviente-en-a...
Sendero viviente en https://es.slideshare.net/slideshow/sendero-viviente-en-a...
Rafael Reverte P¨¦rez
?
How Science and Religion Can Be Besties: Part 4
How Science and Religion Can Be Besties: Part 4How Science and Religion Can Be Besties: Part 4
How Science and Religion Can Be Besties: Part 4
Vintage Church
?
The Bible - The Old Testament - The Bible - Old Testament
The Bible - The Old Testament - The Bible - Old TestamentThe Bible - The Old Testament - The Bible - Old Testament
The Bible - The Old Testament - The Bible - Old Testament
GimanBrianJay
?
Trusting God for Victory in Life's Struggles
Trusting God for Victory in Life's StrugglesTrusting God for Victory in Life's Struggles
Trusting God for Victory in Life's Struggles
TImothy leonard
?
Sendero viviente -Autobiograf¨ªa de un iluminado- en INGLES.pdf
Sendero viviente -Autobiograf¨ªa de un iluminado- en INGLES.pdfSendero viviente -Autobiograf¨ªa de un iluminado- en INGLES.pdf
Sendero viviente -Autobiograf¨ªa de un iluminado- en INGLES.pdf
Rafael Reverte P¨¦rez
?
St John's Church Parish Diary for March 25
St John's Church Parish Diary for March 25St John's Church Parish Diary for March 25
St John's Church Parish Diary for March 25
Chris Lyne
?
(January 1) Solemnidad nang Maria, Ing Virgen Indu ning Dios.pptx
(January 1) Solemnidad nang Maria, Ing Virgen Indu ning Dios.pptx(January 1) Solemnidad nang Maria, Ing Virgen Indu ning Dios.pptx
(January 1) Solemnidad nang Maria, Ing Virgen Indu ning Dios.pptx
FRANCISCORENZS
?
What are the most effective spiritual healing techniques for reducing stress_...
What are the most effective spiritual healing techniques for reducing stress_...What are the most effective spiritual healing techniques for reducing stress_...
What are the most effective spiritual healing techniques for reducing stress_...
Worldfamouspsychicreader
?
Brown Black Classic Painting Project History Presentation (1).pptx
Brown Black Classic Painting Project History Presentation (1).pptxBrown Black Classic Painting Project History Presentation (1).pptx
Brown Black Classic Painting Project History Presentation (1).pptx
AllyzzaAzotea
?
Viral Series_Acts 2.36-41_Sermon ºÝºÝߣs.pptx
Viral Series_Acts 2.36-41_Sermon ºÝºÝߣs.pptxViral Series_Acts 2.36-41_Sermon ºÝºÝߣs.pptx
Viral Series_Acts 2.36-41_Sermon ºÝºÝߣs.pptx
Stephen Palm
?
St. John's Parish Magazine - March 2025 (web)
St. John's Parish Magazine - March 2025 (web)St. John's Parish Magazine - March 2025 (web)
St. John's Parish Magazine - March 2025 (web)
Chris Lyne
?
Joshua 3.1-14 God Leads His People GPBC 03.02.25.pptx
Joshua 3.1-14 God Leads His People GPBC 03.02.25.pptxJoshua 3.1-14 God Leads His People GPBC 03.02.25.pptx
Joshua 3.1-14 God Leads His People GPBC 03.02.25.pptx
Lazarou Richard
?
tagreba.ppt????? ??? ????? ??? ????? ?????
tagreba.ppt????? ??? ????? ??? ????? ?????tagreba.ppt????? ??? ????? ??? ????? ?????
tagreba.ppt????? ??? ????? ??? ????? ?????
martinamaged7
?

Themes and layouts

  • 1. Themes & Layout Tutorial Copyright ? 2000-2006 Liferay, Inc. All Rights Reserved. No material may be reproduced electronically or in print without written permission from Liferay, Inc.
  • 2. Objectives 1. Customize your own Liferay Theme a. Introduction to Liferay Themes b. Deploy a Liferay Theme c. Modify example theme 2. Customize your own Liferay Layout a. Create a custom 2-3 layout - (2-3 = 2 column row on top of a 3 column row) a. Select different layout templates
  • 3. Introduction to Liferay Themes With themes, you can quickly & completely redesign a website layout with a single war file. Lets see some examples: - Themes from Liferay Website: - Liferay.com -> downloads -> community themes
  • 8. Exercise 1 Change the Liferay Theme a. Startup Tomcat b. On the Liferay website ¡°Page Settings¡± -> ¡°Look and Feel¡± -> Select Theme
  • 9. Portal ? Creating a theme can be a very time consuming process, depending on what exactly needs to be done. ? Step 1: Identify the major components Most themes contain the following elements: ? Banner ? Navigation ? Portlet area ? Some themes that are more graphically intensive also have a top, bottom, and left and right sides.
  • 10. Identify the major components
  • 11. Identify the major components
  • 12. Identify the major components
  • 13. Portlets ? Step 2: Identify the portlet areas ¨C The next step is to identify your portlet areas. All portlets are composed of 12 pieces.
  • 14. ? Look for all 12 pieces / images of the portlet ? Notice that some portlets have wide borders and some have thin, it all depends on how your portlet is supposed to look ? If there are shadows you need to incorporate the entire shadow in your image.
  • 15. Exercise 2 Deploy your own ¡°example.war¡± theme and change Liferay¡¯s homepage to use that theme. This theme will help distinguish each of the pieces of the theme to give you practice in editing themes. Deploying your theme: 1. Startup Tomcat (if not already) 2. Copy ¡°example.war¡± to your themes folder: C:ProjectsTrainingextthemesexample.war 3. ¡°ant deploy¡± from your themes folder 4. Reload the page and select this theme
  • 16. Step 3: Putting it all together Portlet Area You will need to cut your portlets up into 12 images like shown above, then populate the 12 portlet areas based on the images you cut up (set the height, width, and file name of each images) Hint: look for these lines css_cached.vm: extthemesexample.warhtmlthemesexampletemplatescss_cached.vm ¨C .portlet-header-bar-middle ¨C .portlet-header-bar-right ¨C .portlet-header-bar-left ¨C .portlet-corner-ul ¨C .portlet-corner-ur ¨C .portlet-corner-br ¨C .portlet-corner-bl ¨C .portlet-border-top ¨C .portlet-border-left ¨C .portlet-border-right ¨C .portlet-border-bottom
  • 17. Banner To build the banner you need to edit: css_cached.vm: extthemesexample.warhtmlthemesexampletemplatescss_cached.vm ? .layout-banner-left ? .layout-banner-middle ? .layout-banner-right Usually only the middle is required, but if the theme needs to stretch along the x axis you will need left and right as well.
  • 18. Top, Bottom, Left, Right Top and Bottom Decorations css_cached.vm: extthemesexample.warhtmlthemesexampletemplatescss_cached.vm ¨C #layout-top-decoration ¨C #layout-corner-ul ¨C #layout-corner-ur ¨C #layout-bottom-decoration ¨C #layout-corner-bl ¨C #layout-corner-br Use these to build your top and bottom decorations Left and Right Sides css_cached.vm: extthemesexample.warhtmlthemesexampletemplatescss_cached.vm ¨C #layout-box-left ¨C #layout-box-right Look for these to edit the sides
  • 19. Exercise 3 Modify the example.war theme to look like the one below
  • 20. ? Helpful Notes: ¨C border-left: 1px dotted black; ¨C In Firefox¡¯s web developer extensions press (CTRL-SHFT-F) for helpful HTML info ? Files to modify: ¨C extthemesexample.warhtmlthemesexampletemplates ? css_cached.vm (css) ? portal_normal.vm (layout) ¨C extthemesexample.warWEB-INF ? liferay-look-and-feel.xml ($colorScheme)
  • 21. Content and Layout ? Why new layouts? ¨C Variety is good ¨C Not all sites are the same ¨C Sometimes the defaults just don¡¯t work for your needs ? How do we do it? ¨C Layouttpl (Layout Template) ? 4.0.0 makes this process so much easier!
  • 22. Prepare the layouts folder ? In the EXT directory navigate to the layouttpl folder ? Create a folder called sample.war here > extlayouttplsample.war ? In sample.war, create two folders: WEB-INF and html > extlayouttplsample.warWEB-INF > extlayouttplsample.warhtml ? We have now setup the basic folder structure for layouts. This is the process that must always be followed for new layouts
  • 23. Preparing supporting files ? Inside the WEB-INF folder that was just created, create a file and name it liferay-layout-templates.xml > extlayouttplsample.warWEB-INF liferay-layout-templates.xml ? Now create one more file here, and call it web.xml > extlayouttplsample.warWEB-INF web.xml
  • 24. liferay-layout-templates.xml liferay-layout-templates.xml extlayouttplsample.warWEB-INFliferay-layout-templates.xml <?xml version="1.0"?> <!DOCTYPE layout-templates PUBLIC "-//Liferay//DTD Layout Templates 4.0.0//EN" "http://www.liferay.com/dtd/liferay-layout-templates_4_0_0.dtd"> <layout-templates> <custom> <layout-template id="training" name="training"> <template-path>/html/layouttpl/custom/training.tpl</template-path> </layout-template> </custom> </layout-templates>
  • 25. What did that do? ? Layout-templates is our root element, it tells Liferay that we are defining new layouts ? Custom tells Liferay that this is not a built in template, but something new ? Layout-template-id and name let Liferay know what to ¨C Display in add content ¨C Set as the unique id for this template ? Template-path tells Liferay where to find the template structure (tpl) file
  • 26. web.xml web.xml extlayouttplsample.warWEB-INFweb.xml <?xml version="1.0"?> <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd"> <web-app> <display-name>sample</display-name> <listener> <listener- class>com.liferay.portal.kernel.servlet.LayoutTemplateContextListener</listener -class> </listener> </web-app>
  • 27. Preparing the tpl file ? In extlayouttplsample.warhtml, ¨C create a ¡°layouttpl¡± folder: ? Inside layouttpl, ¨C create a ¡°custom¡± folder: ? Inside custom, ¨C create the file ¡°training.tpl¡± ? extlayouttplsample.warhtmllayouttplcustomtraining.tpl
  • 28. 2-3 column layout code <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tr> <td valign="top" width="45%">$processor.processColumn("column-1")</td> <td width="10%">&nbsp;</td> <td valign="top" width="45%">$processor.processColumn("column-2")</td> </tr> </table> <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tr> <td valign="top" width="30%">$processor.processColumn("column-3")</td> <td width="5%">&nbsp;</td> <td valign="top" width="30%">$processor.processColumn("column-4")</td> <td width="5%">&nbsp;</td> <td valign="top" width="30%">$processor.processColumn("column-5")</td> </tr> </table>
  • 29. Deploy Layouts ? Navigate to ext/layouttpl ? Run ant deploy ? Open a web browser to http://localhost ? Login ? For this example, let¡¯s create a new page
  • 30. Let¡¯s add content! ? Click Add Content ? Select your Layout Template ? Click test and add (portlets with small width): ? Hello Laszlo ? Hello Velocity ? Hello World ? Your sample portlet
  • 31. Finish it ? Refresh your page ? Drag all the portlets around to fill the five columns
  • 32. Summary ? You should now know: ¨C How to create a basic theme ¨C How to create custom layouts ¨C How to add new content pages ¨C How to use change the layout template ? Things to practice ¨C The more CSS and HTML you know, the better off you will be ¨C Getting a theme just right takes time. Don¡¯t lose faith, it is possible!
  • 33. Congratulations! Congratulations! You¡¯ve just modified your own theme! Login: test@liferay.com Password: test To hot deploy JSR-168 compliant portlets, Liferay layout templates, or Liferay themes just drop your *.war files in C:/home/liferay/deploy Sample portlets can be found here: http://www.liferay.com/web/guest/downloads/samples For more information on hot deploy, click here: http://content.liferay.com/4.0.0/docs/developers/ch06s01.html
  • 34. Revision History Scott Lee 11/2/2006 - Created & Updated slides from Brett¡¯s Theme Docs & Layout Ppt Scott Lee 11/10/2006 - Fixed typos (Liferay-layout-templates.xml, tpl filepath) - added ¡°helpful notes¡± for excercise

Editor's Notes

  • #16: Its recommeded to build a theme by editing an existing one instead of creating every file from scratch.