SlideShare ist ein Scribd-Unternehmen logo
1 von 25
Downloaden Sie, um offline zu lesen
anatomia di StarterTheme
PrestaShop 1.7
Luigi Massa - PrestaShop Ambassador Torino - lmassa@bwlab.it
2 parole su di me
esperto di processi IT
SAP professional, Symfony developer,
PrestaShop professional
PrestaShop Ambassador da gennaio
2016
ex manager GDG Torino
twitter: businessweblab
site: bwlab.it
linkedin: linkedin.com/in/lmassa
strumenti
github: repository, branch and pull
request
npm: npm is the package manager for
JavaScript. Find, share, and reuse
packages of code from hundreds of
thousands of developers — and
assemble them in powerful new ways.
stylus-lang: EXPRESSIVE, DYNAMIC,
ROBUST CSS
Yaml: yet another markup language
scaricare starter theme
repository in github: https://github.com/PrestaShop
starter theme:
https://github.com/PrestaShop/StarterTheme
folder structure
● config: file di configurazione
template
● template: file tpl
● _dev: file css stylus
● assets: file compilati css, js e
immagni
● modules: allow you to override
templates for modules
● plugins: contains the Smarty
extensions required by the
theme, if any
block elements
permetteno di costruire una
gerarchia ereditaria e sovrascrivere
blocchi di template facilmente
template smarty
risorsa concettuale
smarty è simile a twig per la gestione dei
blocchi, degli include e dell’ereditarietà
{block <name>}...{/endblock}
{extends file='<tpl name>'}
{include file='<tpl name>' <var>=$varname}
block (twig)
extends
include
rapida introduzione sull’
organizzazione dello starter thee
tpl start theme
struttura
struttura starter theme home
struttura altre pagine
struttura layout layout-both-columns.tpl
usando sylus è possibile creare una
struttura semplificata dei css
sfruttando variabili ed ereditarietà e
compilando per ottenere i css
css
compiling
alcuni comandi
npm install: installa le dipendenze npm per la compilazione; sotto _dev
da lanciare sotto _dev, npm run:
● watch: compila i file stylus real time
● build: compila i file stylus e li minimizza in un unico in assets/css
● build-wach: i precedenti uniti
npm run legge il file package.json
npm run watch
controlla live le modifiche ai file .styl
compila live in css
inserisce in assets/css/dev.css
exemple: start from _dev/dev.styl
// Colors
body-background-color = white
border-color = grey
….
@import "_mixins.styl"
…..
#checkout-cart-summary
float right
width 30%
gestisce i colori del tema grafico con delle
variabili
importa altri file stylus
definisce lo stile della classe su id checkout-
cart-summary e
http://www.stylus-lang.com
esempio
Configurazione
theme.yml
Lo Starter Theme prevede un file di
configurazione yml
config/theme.yml
Il file riporta la configurazione del
tema grafico: chi l'ha creato, gli hook
abilitati etc…
La descrizione di tutti i parametri di
configurazione si trova su github.com
contenuto della configurazione
nome template = folder name
versione, autore, compatibilità, dimensione delle immagini, tipi di layout
moduli attivati e disattivati di default in fase di installazione template, hook
gestiti con i relativi moduli attivati
Anatomia di starter theme
Anatomia di starter theme

Weitere ähnliche Inhalte

Andere mochten auch

Dipesh Bhakta resume
Dipesh Bhakta resumeDipesh Bhakta resume
Dipesh Bhakta resume
Dipesh Bhakta
 
Hotel gloria caxambu prancha3
Hotel gloria caxambu prancha3Hotel gloria caxambu prancha3
Hotel gloria caxambu prancha3
josebnunes
 
Festa junina (4) copy04
Festa junina (4) copy04Festa junina (4) copy04
Festa junina (4) copy04
Maria Terra
 
Snapple Plans Book_Final Version (1)
Snapple Plans Book_Final Version  (1)Snapple Plans Book_Final Version  (1)
Snapple Plans Book_Final Version (1)
Kelly Garcia
 

Andere mochten auch (13)

Orthocare Underliners Tabanlık
Orthocare Underliners TabanlıkOrthocare Underliners Tabanlık
Orthocare Underliners Tabanlık
 
Dipesh Bhakta resume
Dipesh Bhakta resumeDipesh Bhakta resume
Dipesh Bhakta resume
 
Hotel gloria caxambu prancha3
Hotel gloria caxambu prancha3Hotel gloria caxambu prancha3
Hotel gloria caxambu prancha3
 
Identities and emotions towards civic participation
Identities and emotions towards civic participationIdentities and emotions towards civic participation
Identities and emotions towards civic participation
 
Festa junina (4) copy04
Festa junina (4) copy04Festa junina (4) copy04
Festa junina (4) copy04
 
Asana Platform Structure
Asana Platform StructureAsana Platform Structure
Asana Platform Structure
 
Snapple Plans Book_Final Version (1)
Snapple Plans Book_Final Version  (1)Snapple Plans Book_Final Version  (1)
Snapple Plans Book_Final Version (1)
 
Técnicas de memorização para Concursos Públicos
Técnicas de memorização para Concursos PúblicosTécnicas de memorização para Concursos Públicos
Técnicas de memorização para Concursos Públicos
 
Ten Applications for Drones in Construction
Ten Applications for Drones in ConstructionTen Applications for Drones in Construction
Ten Applications for Drones in Construction
 
Pancake day favourite_taste_eders
Pancake day favourite_taste_edersPancake day favourite_taste_eders
Pancake day favourite_taste_eders
 
Aljoharah AlFares
Aljoharah AlFares Aljoharah AlFares
Aljoharah AlFares
 
Examen tema 1 (modelo). enerxía, traballo e calor
Examen tema 1 (modelo). enerxía, traballo e calorExamen tema 1 (modelo). enerxía, traballo e calor
Examen tema 1 (modelo). enerxía, traballo e calor
 
Dalia Resume 03.11.2016
Dalia Resume 03.11.2016Dalia Resume 03.11.2016
Dalia Resume 03.11.2016
 

Ähnlich wie Anatomia di starter theme

DotNetToscana - Sessione TypeScript
DotNetToscana - Sessione TypeScriptDotNetToscana - Sessione TypeScript
DotNetToscana - Sessione TypeScript
Sinergia Totale
 

Ähnlich wie Anatomia di starter theme (20)

GWT vs CSS3
GWT vs CSS3GWT vs CSS3
GWT vs CSS3
 
Ddive Xpage852
Ddive Xpage852Ddive Xpage852
Ddive Xpage852
 
Slide sessione Drupal Theming & CSS Framework – Drupal Camp Torino 2010
Slide sessione Drupal Theming & CSS Framework – Drupal Camp Torino 2010Slide sessione Drupal Theming & CSS Framework – Drupal Camp Torino 2010
Slide sessione Drupal Theming & CSS Framework – Drupal Camp Torino 2010
 
Creazione componenti con Vue js
Creazione componenti con Vue jsCreazione componenti con Vue js
Creazione componenti con Vue js
 
Grunt: automazione per sviluppatori “pigri” - WordCamp Bari 2019
Grunt: automazione per sviluppatori “pigri” - WordCamp Bari 2019Grunt: automazione per sviluppatori “pigri” - WordCamp Bari 2019
Grunt: automazione per sviluppatori “pigri” - WordCamp Bari 2019
 
Giovambattista Fazioli, 10 more things
Giovambattista Fazioli, 10 more thingsGiovambattista Fazioli, 10 more things
Giovambattista Fazioli, 10 more things
 
Introduzione ad angular 7/8
Introduzione ad angular 7/8Introduzione ad angular 7/8
Introduzione ad angular 7/8
 
beContent
beContentbeContent
beContent
 
Drupal Lessons by nois3lab
Drupal Lessons by nois3labDrupal Lessons by nois3lab
Drupal Lessons by nois3lab
 
Apache Maven - Gestione di progetti Java e build automation
Apache Maven - Gestione di progetti Java e build automationApache Maven - Gestione di progetti Java e build automation
Apache Maven - Gestione di progetti Java e build automation
 
Microsoft Fast - Overview
Microsoft Fast - OverviewMicrosoft Fast - Overview
Microsoft Fast - Overview
 
DDive - 8.5.2 Xpages - L'evoluzione continua
DDive - 8.5.2 Xpages - L'evoluzione continuaDDive - 8.5.2 Xpages - L'evoluzione continua
DDive - 8.5.2 Xpages - L'evoluzione continua
 
4 dw parte2-modifiche
4 dw parte2-modifiche4 dw parte2-modifiche
4 dw parte2-modifiche
 
GNU Linux Programming introduction
GNU Linux Programming introductionGNU Linux Programming introduction
GNU Linux Programming introduction
 
DotNetToscana - Sessione TypeScript
DotNetToscana - Sessione TypeScriptDotNetToscana - Sessione TypeScript
DotNetToscana - Sessione TypeScript
 
Autumn Event Vicenza
Autumn Event VicenzaAutumn Event Vicenza
Autumn Event Vicenza
 
Santa Claus Alert: ovvero come sfruttare WinML per intercettare babbo natale
Santa Claus Alert: ovvero come sfruttare WinML per intercettare babbo nataleSanta Claus Alert: ovvero come sfruttare WinML per intercettare babbo natale
Santa Claus Alert: ovvero come sfruttare WinML per intercettare babbo natale
 
Grasso Frameworks Ajax
Grasso Frameworks AjaxGrasso Frameworks Ajax
Grasso Frameworks Ajax
 
DNM19 Sessione2 Orchard Temi e Layout (Ita)
DNM19 Sessione2 Orchard Temi e Layout (Ita)DNM19 Sessione2 Orchard Temi e Layout (Ita)
DNM19 Sessione2 Orchard Temi e Layout (Ita)
 
Node js dev day napoli 2016
Node js dev day napoli 2016Node js dev day napoli 2016
Node js dev day napoli 2016
 

Mehr von Bwlab (7)

Deploy PrestaShop con Docker
Deploy PrestaShop con DockerDeploy PrestaShop con Docker
Deploy PrestaShop con Docker
 
Google shopping e Prestashop
Google shopping e PrestashopGoogle shopping e Prestashop
Google shopping e Prestashop
 
PrestaShop e Big data base
PrestaShop e Big data basePrestaShop e Big data base
PrestaShop e Big data base
 
Profiling PrestaShop
Profiling PrestaShopProfiling PrestaShop
Profiling PrestaShop
 
Normativa sui Cookies del Garante sulla Privacy
Normativa sui Cookies del Garante sulla PrivacyNormativa sui Cookies del Garante sulla Privacy
Normativa sui Cookies del Garante sulla Privacy
 
Servizi web Bwlab
Servizi web BwlabServizi web Bwlab
Servizi web Bwlab
 
Bwlab porta la tua azienda nel web
Bwlab porta la tua azienda nel webBwlab porta la tua azienda nel web
Bwlab porta la tua azienda nel web
 

Anatomia di starter theme

  • 2. Luigi Massa - PrestaShop Ambassador Torino - lmassa@bwlab.it 2 parole su di me esperto di processi IT SAP professional, Symfony developer, PrestaShop professional PrestaShop Ambassador da gennaio 2016 ex manager GDG Torino twitter: businessweblab site: bwlab.it linkedin: linkedin.com/in/lmassa
  • 3. strumenti github: repository, branch and pull request npm: npm is the package manager for JavaScript. Find, share, and reuse packages of code from hundreds of thousands of developers — and assemble them in powerful new ways. stylus-lang: EXPRESSIVE, DYNAMIC, ROBUST CSS Yaml: yet another markup language
  • 4. scaricare starter theme repository in github: https://github.com/PrestaShop starter theme: https://github.com/PrestaShop/StarterTheme
  • 5. folder structure ● config: file di configurazione template ● template: file tpl ● _dev: file css stylus ● assets: file compilati css, js e immagni ● modules: allow you to override templates for modules ● plugins: contains the Smarty extensions required by the theme, if any
  • 6. block elements permetteno di costruire una gerarchia ereditaria e sovrascrivere blocchi di template facilmente template smarty
  • 7. risorsa concettuale smarty è simile a twig per la gestione dei blocchi, degli include e dell’ereditarietà {block <name>}...{/endblock} {extends file='<tpl name>'} {include file='<tpl name>' <var>=$varname}
  • 11. rapida introduzione sull’ organizzazione dello starter thee tpl start theme struttura
  • 15. usando sylus è possibile creare una struttura semplificata dei css sfruttando variabili ed ereditarietà e compilando per ottenere i css css compiling
  • 16. alcuni comandi npm install: installa le dipendenze npm per la compilazione; sotto _dev da lanciare sotto _dev, npm run: ● watch: compila i file stylus real time ● build: compila i file stylus e li minimizza in un unico in assets/css ● build-wach: i precedenti uniti npm run legge il file package.json
  • 17. npm run watch controlla live le modifiche ai file .styl compila live in css inserisce in assets/css/dev.css
  • 18. exemple: start from _dev/dev.styl // Colors body-background-color = white border-color = grey …. @import "_mixins.styl" ….. #checkout-cart-summary float right width 30% gestisce i colori del tema grafico con delle variabili importa altri file stylus definisce lo stile della classe su id checkout- cart-summary e
  • 21. Configurazione theme.yml Lo Starter Theme prevede un file di configurazione yml
  • 22. config/theme.yml Il file riporta la configurazione del tema grafico: chi l'ha creato, gli hook abilitati etc… La descrizione di tutti i parametri di configurazione si trova su github.com
  • 23. contenuto della configurazione nome template = folder name versione, autore, compatibilità, dimensione delle immagini, tipi di layout moduli attivati e disattivati di default in fase di installazione template, hook gestiti con i relativi moduli attivati