meet magento 2011-templating

58
set the basics right http://www.flickr.com/photos/unloveable/2396019222 for better templating Thursday 19 May 2011 (wk )

Upload: hans-kuijpers

Post on 01-Nov-2014

3.242 views

Category:

Business


2 download

DESCRIPTION

Magento templating explained during MeetMagento.nl 2011Do not duplicate an existing theme!

TRANSCRIPT

Page 1: Meet magento 2011-templating

set the basics right

http://www.flickr.com/photos/unloveable/2396019222

for better templating

Thursday 19 May 2011 (wk )

Page 2: Meet magento 2011-templating

boring stuff first

http://www.flickr.com/photos/swiv/5719738832

Thursday 19 May 2011 (wk )

Page 3: Meet magento 2011-templating

endless possibilities

Thursday 19 May 2011 (wk )

Page 4: Meet magento 2011-templating

temporary design change

Thursday 19 May 2011 (wk )

Page 5: Meet magento 2011-templating

set your theme

based on default Magento

Thursday 19 May 2011 (wk )

Page 6: Meet magento 2011-templating

set your theme

based on default Modern

first fallback

Thursday 19 May 2011 (wk )

Page 7: Meet magento 2011-templating

does file exist inpackage_name/ theme_name/

yes

no

does file exist inpackage_name/

default/

does file exist inbase/

default/

yes

yes

display

rendering error

no

no

How stuff works

Magento fall-back logic

Thursday 19 May 2011 (wk )

Page 8: Meet magento 2011-templating

an existing theme

http://www.flickr.com/photos/popilop/331357312

Thursday 19 May 2011 (wk )

Page 9: Meet magento 2011-templating

app/design/frontend/default/yourtheme/layout

app/design/frontend/default/yourtheme/template

skin/frontend/default/yourtheme/css

skin/frontend/default/yourtheme/images

create your ownPage generation xml instructions for each module

Content block .phtml files for each module

Visual layout info and files & UI-specific Javascript

Thursday 19 May 2011 (wk )

Page 10: Meet magento 2011-templating

• a single layout file, named local.xml, where all layout updates are placed.

• no layout files with the same name as any layout file in the base theme

• no css files with the same name as any css file in the default skin

• no .phtml template files, except for those that were modified to support the new theme.

a well coded theme

should have to following traits

usually this number will be very small

create local.css

Thursday 19 May 2011 (wk )

Page 11: Meet magento 2011-templating

Remove callouts and rarely used stuff

Add the local stylesheet

your theme starts

with local.xml

Thursday 19 May 2011 (wk )

Page 12: Meet magento 2011-templating

not much is changed

Thursday 19 May 2011 (wk )

Page 13: Meet magento 2011-templating

http://www.flickr.com/photos/playerdue/5285272605/

earn money with adsense

Thursday 19 May 2011 (wk )

Page 14: Meet magento 2011-templating

Thursday 19 May 2011 (wk )

Page 15: Meet magento 2011-templating

http://www.adsense-generator.com

Thursday 19 May 2011 (wk )

Page 16: Meet magento 2011-templating

scroll down to Developer

set both to yes

Thursday 19 May 2011 (wk )

Page 17: Meet magento 2011-templating

referral to catalog.xml

Thursday 19 May 2011 (wk )

Page 18: Meet magento 2011-templating

almost every time the same .xml

referral to catalog.xml

Thursday 19 May 2011 (wk )

Page 19: Meet magento 2011-templating

this is base/default/layout/catalog.xml

don’t edit this fileonly copy this handle to local.xml

Thursday 19 May 2011 (wk )

Page 20: Meet magento 2011-templating

only change

what needs to be changed

call for your adsense script

Thursday 19 May 2011 (wk )

Page 21: Meet magento 2011-templating

newly created filein newly created directoryin yourtheme

create your .phtml file

Thursday 19 May 2011 (wk )

Page 22: Meet magento 2011-templating

and you’re done

Thursday 19 May 2011 (wk )

Page 23: Meet magento 2011-templating

timesaver

http://www.flickr.com/photos/maigh/2141921845

Thursday 19 May 2011 (wk )

Page 24: Meet magento 2011-templating

Magento backend

goto System >> Configuration

goto Developer

change Scope

expand Debug

set Template Path Hints to Yes

save Config

(clean Cache)

Magento frontend

refresh page

Thursday 19 May 2011 (wk )

Page 25: Meet magento 2011-templating

Magento backend

goto System >> Configuration

goto Developer

change Scope

expand Debug

set Template Path Hints to No

save Config

(clean Cache)

Magento frontend

refresh page

Thursday 19 May 2011 (wk )

Page 26: Meet magento 2011-templating

http://bit.ly/DeveloperToolbar

Thursday 19 May 2011 (wk )

Page 27: Meet magento 2011-templating

I’m a UNIX geek fond of SSH

find the extension key

use it to install

done

Thursday 19 May 2011 (wk )

Page 28: Meet magento 2011-templating

enabled by default

scroll down to Developer

Thursday 19 May 2011 (wk )

Page 29: Meet magento 2011-templating

click and go

Thursday 19 May 2011 (wk )

Page 30: Meet magento 2011-templating

click and go

Thursday 19 May 2011 (wk )

Page 31: Meet magento 2011-templating

a child can do the laundry

from the book: “I always get my sin”

Thursday 19 May 2011 (wk )

Page 32: Meet magento 2011-templating

add more

four ways to add a link

http://www.flickr.com/photos/farruska/208926935

Thursday 19 May 2011 (wk )

Page 33: Meet magento 2011-templating

Thursday 19 May 2011 (wk )

Page 34: Meet magento 2011-templating

do not forget to activate

Thursday 19 May 2011 (wk )

Page 35: Meet magento 2011-templating

Thursday 19 May 2011 (wk )

Page 36: Meet magento 2011-templating

http://www.flickr.com/photos/andrec/2893549851

Thursday 19 May 2011 (wk )

Page 37: Meet magento 2011-templating

Thursday 19 May 2011 (wk )

Page 38: Meet magento 2011-templating

app/design/frontend/base/layout/catalog.xml

a call for a template file

Thursday 19 May 2011 (wk )

Page 39: Meet magento 2011-templating

app/design/frontend/default/yourtheme/template/catalog/navigation/top.phtml

URL key from CMS page

Thursday 19 May 2011 (wk )

Page 40: Meet magento 2011-templating

DONE!!

Thursday 19 May 2011 (wk )

Page 41: Meet magento 2011-templating

http://www.flickr.com/photos/boklm/486678763

Thursday 19 May 2011 (wk )

Page 42: Meet magento 2011-templating

Thursday 19 May 2011 (wk )

Page 43: Meet magento 2011-templating

app/design/frontend/default/yourtheme/template/catalog/navigation/top.phtml

call for static block in backend

Thursday 19 May 2011 (wk )

Page 44: Meet magento 2011-templating

create new static block

Thursday 19 May 2011 (wk )

Page 45: Meet magento 2011-templating

{{store direct_url="loremipsum"}}

Thursday 19 May 2011 (wk )

Page 46: Meet magento 2011-templating

http://www.flickr.com/photos/boklm/486646798

Thursday 19 May 2011 (wk )

Page 47: Meet magento 2011-templating

Thursday 19 May 2011 (wk )

Page 48: Meet magento 2011-templating

app/design/frontend/base/layout/page.xml

no call for a template file

Thursday 19 May 2011 (wk )

Page 49: Meet magento 2011-templating

app/design/frontend/default/yourtheme/layout/local.xml

URL key from CMS page

Thursday 19 May 2011 (wk )

Page 50: Meet magento 2011-templating

DONE!!

Thursday 19 May 2011 (wk )

Page 51: Meet magento 2011-templating

http://www.flickr.com/photos/boklm/486676439

Thursday 19 May 2011 (wk )

Page 52: Meet magento 2011-templating

Thursday 19 May 2011 (wk )

Page 53: Meet magento 2011-templating

Thursday 19 May 2011 (wk )

Page 54: Meet magento 2011-templating

Thursday 19 May 2011 (wk )

Page 55: Meet magento 2011-templating

Thursday 19 May 2011 (wk )

Page 56: Meet magento 2011-templating

Thursday 19 May 2011 (wk )

Page 57: Meet magento 2011-templating

Thursday 19 May 2011 (wk )