SlideShare a Scribd company logo
1 of 24
CrowdFusion	
The Front-end Edition, Part I




Red Tettemer Interactive, 3/19/10
Linus Graybill | lgraybill@redtettemer.com | @graybill
Today’s Edumacation
Use what you already know to create themes for
CrowdFusion
  Theme folder structure
  Using CSS, JavaScript, images, and Flash
  Demystifying the CrowdFusion template language
  Setting and getting a template variable
So our CrowdFusion app looks
like this:
                our source code goes in
                   the app/ directory

                    this view folder is for
                    plugin-specific CMS
                           screens


                    our application theme
                    lives in this here view
                             folder
Themes go in view/
                                                each theme
                                                gets its own
                                                directory in
                                                 view/web/




  How do you name a theme? Themes are specified by domain -
  the theme mysite.com will only be applied to sites accessed at
  mysite.com (keep in mind for development).

  Note: Subdomains are supported, so you can have two themes,
  dev.mysite.com (for development) and mysite.com (for production)
Inside our theme directory
                   css, js,
                images, and
                  flash, are
                nested inside
                 the assets/
                  directory


                template files
                   go in the
                  templates/
                   directory
What’s in a theme?
  CSS (oooh.)
  Javascript       (ahhhh.)



  Images (oooh.)
  Flash (ahhhh.)
  Template files (.cft’s)      (uhhhh.)
Basic theme concepts
A default theme needs to exists because it’s your
fallback.
      For example: If you don’t specify a 404.cft template in
      your theme, default/404.cft will be called in its place.




Themes are assigned based on domain name
      Why? CrowdFusion is optimized for multiple sites running
      from the same CMS.
Basic theme concepts
 All code to be processed by CrowdFusion is
 wrapped in {% ... %}

          {% if Data:#continued-contents %}
                  <p><a href="%RecordLink%">Read more</a></p>
          {% endif %}



                                          We reference a CrowdFusion
A CrowdFusion “if” block is written as:
                                           variable by wrapping the
     {% if ... %} ... {% endif %}
                                               variable in %...%
You want to create a theme?
            You can:
             Create directories and files
             by hand
             Copy an existing theme
             folder and modify
             Generate a theme with
             crowdgen (oooh, tell me more...)
Installing crowdgen	
Get the script:
  > git clone git@github.com:graybill/crowdgen.git



Install the Ruby gem dependencies:
  > sudo gem install builder



Copy crowdgen.rb into your CrowdFusion app root:
  > cp crowdgen/crowdgen.rb /Applications/MAMP/htdocs/my-app/.
Using crowdgen
Generating a theme with crowdgen
  > ruby ./crowdgen.rb theme www.my-site.com


Will create:


                           theme folder for www.my-site.com
                           assets folders for our css, js,
                           images, and flash

                           our basic home and 404
                           (page not found) templates
Okay, so let’s look at one of
   these template files.
What the fuck is all
this motherfucking
       shit?
The CrowdFusion templating language

 .cft is the file extenstion
      The .cft extension lets the compiler know to do stuff with
      anything inside a {% ... %} tag. Otherwise it’s HTML all the
      way.



 content blocks are the foundation for displaying
 content from the CMS
      Anything you want to output as HTML to the page needs to
      be inside a content block.
Content blocks
 Five types of content blocks:
                                                      HTML to generate before looping through
   header                                             the main content.
                                                      Loops through ever item in our
   contents                                           data call and outputs that HTML.
                                                      Is called between every line of data
   contents-inline                                    generated in contents
                                                      HTML to generate after the contents blocks
   footer                                             have been completed

   noresults                                          Shows when no data is found


        From the docs: All template blocks are optional, but there should be at
        least one in order to render output; in the absence of any defined template
        block, the system assumes that the entire template is enclosed in a contents
        block.
How do you use a content block?
“{%” marks the
beginning of a           “begin” initiates our content block
CrowdFusion block        and “header” specifies the type of
                         content block we want


        {% begin header %}
            <h1>My Awesome Site</h1>
            {% asset css?=css/screen.css %}
        {% end %}



             We tell CrowdFusion to close the
             content block with {% end %}
Header content block




Contents content block




 Footer content block
Well ain’t that inefficient.
Using partial templates
We can include our header code in a partial (_header.cft):




And then include that partial like this:
Oh, I know, you want
     your pretty.
Including CSS & JS
Including stylesheets
 {% asset css?src=css/screen.css %}




Including javascript
 {% asset js?src=js/app.js %}
Including Images & Flash
Including images inline
 <img src="{% asset img?src=img/logo.jpg %}" />


 Including Flash inline
 <embed src="{% asset version?src=swf/video.flv %}" />


 Note: Since we’re using regular HTML tags, we can use all the tag attributes
 we’re used to:

     <img src="{% asset img?src=img/logo.jpg %}" class="myimage"
     alt= "my image, yo" />
{% end %}

Hopefully you now have an idea how to create a basic
CrowdFusion theme
Next time we’ll look at pulling in data from the CMS
Own it.
Browse this, you’ll find stuff you care about:

  https://www.assembla.com/wiki/show/crowdfusion/CFT_Template_Engine




Oh, and the crowdgen homepage

  http://github.com/graybill/crowdgen

More Related Content

What's hot

Drupal 8 introduction to theming
Drupal 8  introduction to themingDrupal 8  introduction to theming
Drupal 8 introduction to themingBrahampal Singh
 
PSD to a Drupal Theme (using a base theme)
PSD to a Drupal Theme (using a base theme)PSD to a Drupal Theme (using a base theme)
PSD to a Drupal Theme (using a base theme)kuydigital
 
Theme development essentials columbus oh word camp 2012
Theme development essentials   columbus oh word camp 2012Theme development essentials   columbus oh word camp 2012
Theme development essentials columbus oh word camp 2012Joe Querin
 
Drupal 8 theming deep dive
Drupal 8 theming deep diveDrupal 8 theming deep dive
Drupal 8 theming deep diveRomain Jarraud
 
Converting (X)HTML/CSS template to Drupal 7 Theme
Converting (X)HTML/CSS template to Drupal 7 ThemeConverting (X)HTML/CSS template to Drupal 7 Theme
Converting (X)HTML/CSS template to Drupal 7 ThemeAdolfo Nasol
 
Bootstrap Paragraphs for Drupal 8
Bootstrap Paragraphs for Drupal 8Bootstrap Paragraphs for Drupal 8
Bootstrap Paragraphs for Drupal 8Jim Birch
 
Optimizing Drupal 7 HTML Markup - Using Panels, Page Manager, and Fences to P...
Optimizing Drupal 7 HTML Markup - Using Panels, Page Manager, and Fences to P...Optimizing Drupal 7 HTML Markup - Using Panels, Page Manager, and Fences to P...
Optimizing Drupal 7 HTML Markup - Using Panels, Page Manager, and Fences to P...Jim Birch
 
WordPress Theme Structure
WordPress Theme StructureWordPress Theme Structure
WordPress Theme Structurekeithdevon
 
Custom WordPress theme development
Custom WordPress theme developmentCustom WordPress theme development
Custom WordPress theme developmentTammy Hart
 
Bootstrap framework and drupal paragraphs
Bootstrap framework and drupal paragraphsBootstrap framework and drupal paragraphs
Bootstrap framework and drupal paragraphsJim Birch
 
WortdPress Child themes: Why and How
WortdPress Child themes: Why and HowWortdPress Child themes: Why and How
WortdPress Child themes: Why and HowPaul Bearne
 
Getting started with drupal 8 code
Getting started with drupal 8 codeGetting started with drupal 8 code
Getting started with drupal 8 codeForum One
 
Bootstrap Framework and Drupal
Bootstrap Framework and DrupalBootstrap Framework and Drupal
Bootstrap Framework and DrupalJim Birch
 
Marky Markup and the Funky Bunch
Marky Markup and the Funky BunchMarky Markup and the Funky Bunch
Marky Markup and the Funky Bunchdtraft
 
DrupalTour Lviv — Theming in Drupal8 (Ivan Tibezh, InternetDevels)
DrupalTour Lviv — Theming in Drupal8 (Ivan Tibezh, InternetDevels)DrupalTour Lviv — Theming in Drupal8 (Ivan Tibezh, InternetDevels)
DrupalTour Lviv — Theming in Drupal8 (Ivan Tibezh, InternetDevels)Drupaltour
 
Using Display Suite / Context to Build your Drupal Site
Using Display Suite / Context to Build your Drupal SiteUsing Display Suite / Context to Build your Drupal Site
Using Display Suite / Context to Build your Drupal SiteMatthew Wetmore
 
Shortcodes vs Widgets: Which one and how?
Shortcodes vs Widgets: Which one and how?Shortcodes vs Widgets: Which one and how?
Shortcodes vs Widgets: Which one and how?Amanda Giles
 
WordPress Child Themes
WordPress Child ThemesWordPress Child Themes
WordPress Child Themesrfair404
 
Frameworks Apis
Frameworks ApisFrameworks Apis
Frameworks Apiswellunwell
 
Display Suite: A Themers Perspective
Display Suite: A Themers PerspectiveDisplay Suite: A Themers Perspective
Display Suite: A Themers PerspectiveMediacurrent
 

What's hot (20)

Drupal 8 introduction to theming
Drupal 8  introduction to themingDrupal 8  introduction to theming
Drupal 8 introduction to theming
 
PSD to a Drupal Theme (using a base theme)
PSD to a Drupal Theme (using a base theme)PSD to a Drupal Theme (using a base theme)
PSD to a Drupal Theme (using a base theme)
 
Theme development essentials columbus oh word camp 2012
Theme development essentials   columbus oh word camp 2012Theme development essentials   columbus oh word camp 2012
Theme development essentials columbus oh word camp 2012
 
Drupal 8 theming deep dive
Drupal 8 theming deep diveDrupal 8 theming deep dive
Drupal 8 theming deep dive
 
Converting (X)HTML/CSS template to Drupal 7 Theme
Converting (X)HTML/CSS template to Drupal 7 ThemeConverting (X)HTML/CSS template to Drupal 7 Theme
Converting (X)HTML/CSS template to Drupal 7 Theme
 
Bootstrap Paragraphs for Drupal 8
Bootstrap Paragraphs for Drupal 8Bootstrap Paragraphs for Drupal 8
Bootstrap Paragraphs for Drupal 8
 
Optimizing Drupal 7 HTML Markup - Using Panels, Page Manager, and Fences to P...
Optimizing Drupal 7 HTML Markup - Using Panels, Page Manager, and Fences to P...Optimizing Drupal 7 HTML Markup - Using Panels, Page Manager, and Fences to P...
Optimizing Drupal 7 HTML Markup - Using Panels, Page Manager, and Fences to P...
 
WordPress Theme Structure
WordPress Theme StructureWordPress Theme Structure
WordPress Theme Structure
 
Custom WordPress theme development
Custom WordPress theme developmentCustom WordPress theme development
Custom WordPress theme development
 
Bootstrap framework and drupal paragraphs
Bootstrap framework and drupal paragraphsBootstrap framework and drupal paragraphs
Bootstrap framework and drupal paragraphs
 
WortdPress Child themes: Why and How
WortdPress Child themes: Why and HowWortdPress Child themes: Why and How
WortdPress Child themes: Why and How
 
Getting started with drupal 8 code
Getting started with drupal 8 codeGetting started with drupal 8 code
Getting started with drupal 8 code
 
Bootstrap Framework and Drupal
Bootstrap Framework and DrupalBootstrap Framework and Drupal
Bootstrap Framework and Drupal
 
Marky Markup and the Funky Bunch
Marky Markup and the Funky BunchMarky Markup and the Funky Bunch
Marky Markup and the Funky Bunch
 
DrupalTour Lviv — Theming in Drupal8 (Ivan Tibezh, InternetDevels)
DrupalTour Lviv — Theming in Drupal8 (Ivan Tibezh, InternetDevels)DrupalTour Lviv — Theming in Drupal8 (Ivan Tibezh, InternetDevels)
DrupalTour Lviv — Theming in Drupal8 (Ivan Tibezh, InternetDevels)
 
Using Display Suite / Context to Build your Drupal Site
Using Display Suite / Context to Build your Drupal SiteUsing Display Suite / Context to Build your Drupal Site
Using Display Suite / Context to Build your Drupal Site
 
Shortcodes vs Widgets: Which one and how?
Shortcodes vs Widgets: Which one and how?Shortcodes vs Widgets: Which one and how?
Shortcodes vs Widgets: Which one and how?
 
WordPress Child Themes
WordPress Child ThemesWordPress Child Themes
WordPress Child Themes
 
Frameworks Apis
Frameworks ApisFrameworks Apis
Frameworks Apis
 
Display Suite: A Themers Perspective
Display Suite: A Themers PerspectiveDisplay Suite: A Themers Perspective
Display Suite: A Themers Perspective
 

Viewers also liked

Viewers also liked (6)

Uso di Moodle nell'apprendimento linguistico
Uso di Moodle nell'apprendimento linguisticoUso di Moodle nell'apprendimento linguistico
Uso di Moodle nell'apprendimento linguistico
 
L2O
L2OL2O
L2O
 
Av Kukla
Av KuklaAv Kukla
Av Kukla
 
Propaganda
PropagandaPropaganda
Propaganda
 
Znake8
Znake8Znake8
Znake8
 
MCOM 510 Class 11
MCOM 510 Class 11MCOM 510 Class 11
MCOM 510 Class 11
 

Similar to CrowdFusion: The Front-End Edition, Part I: Presentation Layer

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 wayMarek Sotak
 
Don't Fear the Custom Theme: How to build a custom WordPress theme with only ...
Don't Fear the Custom Theme: How to build a custom WordPress theme with only ...Don't Fear the Custom Theme: How to build a custom WordPress theme with only ...
Don't Fear the Custom Theme: How to build a custom WordPress theme with only ...LinnAlexandra
 
Introduction To Drupal
Introduction To DrupalIntroduction To Drupal
Introduction To DrupalLauren Roth
 
WordCamp Greenville 2018 - Beware the Dark Side, or an Intro to Development
WordCamp Greenville 2018 - Beware the Dark Side, or an Intro to DevelopmentWordCamp Greenville 2018 - Beware the Dark Side, or an Intro to Development
WordCamp Greenville 2018 - Beware the Dark Side, or an Intro to DevelopmentEvan Mullins
 
Instagram filters (8 24)
Instagram filters (8 24)Instagram filters (8 24)
Instagram filters (8 24)Ivy Rueb
 
An Overview of RoboHelp 7
An Overview of RoboHelp 7An Overview of RoboHelp 7
An Overview of RoboHelp 7Scott Abel
 
Customizing WordPress Themes
Customizing WordPress ThemesCustomizing WordPress Themes
Customizing WordPress ThemesLaura Hartwig
 
Instagram filters (8 24)
Instagram filters (8 24)Instagram filters (8 24)
Instagram filters (8 24)Ivy Rueb
 
So, You Wanna Dev? Join the Team! - WordCamp Raleigh 2017
So, You Wanna Dev? Join the Team! - WordCamp Raleigh 2017 So, You Wanna Dev? Join the Team! - WordCamp Raleigh 2017
So, You Wanna Dev? Join the Team! - WordCamp Raleigh 2017 Evan Mullins
 
Improving your responsive workflow with style guides
Improving your responsive workflow with style guidesImproving your responsive workflow with style guides
Improving your responsive workflow with style guidesLuke Brooker
 
Intermediate Web Design.doc
Intermediate Web Design.docIntermediate Web Design.doc
Intermediate Web Design.docbutest
 
Intermediate Web Design.doc
Intermediate Web Design.docIntermediate Web Design.doc
Intermediate Web Design.docbutest
 
Newbies guide to customizing word press themes 25
Newbies guide to customizing word press themes 25Newbies guide to customizing word press themes 25
Newbies guide to customizing word press themes 25New Tricks
 
Beginner's guide to drupal
Beginner's guide to drupalBeginner's guide to drupal
Beginner's guide to drupalmayank.grd
 
Child Themes and CSS in WordPress
Child Themes and CSS in WordPressChild Themes and CSS in WordPress
Child Themes and CSS in WordPressMatthew Vaccaro
 

Similar to CrowdFusion: The Front-End Edition, Part I: Presentation Layer (20)

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
 
Don't Fear the Custom Theme: How to build a custom WordPress theme with only ...
Don't Fear the Custom Theme: How to build a custom WordPress theme with only ...Don't Fear the Custom Theme: How to build a custom WordPress theme with only ...
Don't Fear the Custom Theme: How to build a custom WordPress theme with only ...
 
WordPress Theming 101
WordPress Theming 101WordPress Theming 101
WordPress Theming 101
 
Introduction To Drupal
Introduction To DrupalIntroduction To Drupal
Introduction To Drupal
 
WordCamp Greenville 2018 - Beware the Dark Side, or an Intro to Development
WordCamp Greenville 2018 - Beware the Dark Side, or an Intro to DevelopmentWordCamp Greenville 2018 - Beware the Dark Side, or an Intro to Development
WordCamp Greenville 2018 - Beware the Dark Side, or an Intro to Development
 
Instagram filters (8 24)
Instagram filters (8 24)Instagram filters (8 24)
Instagram filters (8 24)
 
An Overview of RoboHelp 7
An Overview of RoboHelp 7An Overview of RoboHelp 7
An Overview of RoboHelp 7
 
Customizing WordPress Themes
Customizing WordPress ThemesCustomizing WordPress Themes
Customizing WordPress Themes
 
W pthemes
W pthemesW pthemes
W pthemes
 
Joomla Templates101
Joomla Templates101Joomla Templates101
Joomla Templates101
 
Instagram filters (8 24)
Instagram filters (8 24)Instagram filters (8 24)
Instagram filters (8 24)
 
So, You Wanna Dev? Join the Team! - WordCamp Raleigh 2017
So, You Wanna Dev? Join the Team! - WordCamp Raleigh 2017 So, You Wanna Dev? Join the Team! - WordCamp Raleigh 2017
So, You Wanna Dev? Join the Team! - WordCamp Raleigh 2017
 
Improving your responsive workflow with style guides
Improving your responsive workflow with style guidesImproving your responsive workflow with style guides
Improving your responsive workflow with style guides
 
Intermediate Web Design.doc
Intermediate Web Design.docIntermediate Web Design.doc
Intermediate Web Design.doc
 
Intermediate Web Design.doc
Intermediate Web Design.docIntermediate Web Design.doc
Intermediate Web Design.doc
 
Newbies guide to customizing word press themes 25
Newbies guide to customizing word press themes 25Newbies guide to customizing word press themes 25
Newbies guide to customizing word press themes 25
 
Drupal - Introduction to Drupal Creating Modules
Drupal - Introduction to Drupal Creating ModulesDrupal - Introduction to Drupal Creating Modules
Drupal - Introduction to Drupal Creating Modules
 
Beginner's guide to drupal
Beginner's guide to drupalBeginner's guide to drupal
Beginner's guide to drupal
 
Child Themes and CSS in WordPress
Child Themes and CSS in WordPressChild Themes and CSS in WordPress
Child Themes and CSS in WordPress
 
Themes
ThemesThemes
Themes
 

Recently uploaded

Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAndikSusilo4
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 

Recently uploaded (20)

Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & Application
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 

CrowdFusion: The Front-End Edition, Part I: Presentation Layer

  • 1. CrowdFusion The Front-end Edition, Part I Red Tettemer Interactive, 3/19/10 Linus Graybill | lgraybill@redtettemer.com | @graybill
  • 2. Today’s Edumacation Use what you already know to create themes for CrowdFusion Theme folder structure Using CSS, JavaScript, images, and Flash Demystifying the CrowdFusion template language Setting and getting a template variable
  • 3. So our CrowdFusion app looks like this: our source code goes in the app/ directory this view folder is for plugin-specific CMS screens our application theme lives in this here view folder
  • 4. Themes go in view/ each theme gets its own directory in view/web/ How do you name a theme? Themes are specified by domain - the theme mysite.com will only be applied to sites accessed at mysite.com (keep in mind for development). Note: Subdomains are supported, so you can have two themes, dev.mysite.com (for development) and mysite.com (for production)
  • 5. Inside our theme directory css, js, images, and flash, are nested inside the assets/ directory template files go in the templates/ directory
  • 6. What’s in a theme? CSS (oooh.) Javascript (ahhhh.) Images (oooh.) Flash (ahhhh.) Template files (.cft’s) (uhhhh.)
  • 7. Basic theme concepts A default theme needs to exists because it’s your fallback. For example: If you don’t specify a 404.cft template in your theme, default/404.cft will be called in its place. Themes are assigned based on domain name Why? CrowdFusion is optimized for multiple sites running from the same CMS.
  • 8. Basic theme concepts All code to be processed by CrowdFusion is wrapped in {% ... %} {% if Data:#continued-contents %} <p><a href="%RecordLink%">Read more</a></p> {% endif %} We reference a CrowdFusion A CrowdFusion “if” block is written as: variable by wrapping the {% if ... %} ... {% endif %} variable in %...%
  • 9. You want to create a theme? You can: Create directories and files by hand Copy an existing theme folder and modify Generate a theme with crowdgen (oooh, tell me more...)
  • 10. Installing crowdgen Get the script: > git clone git@github.com:graybill/crowdgen.git Install the Ruby gem dependencies: > sudo gem install builder Copy crowdgen.rb into your CrowdFusion app root: > cp crowdgen/crowdgen.rb /Applications/MAMP/htdocs/my-app/.
  • 11. Using crowdgen Generating a theme with crowdgen > ruby ./crowdgen.rb theme www.my-site.com Will create: theme folder for www.my-site.com assets folders for our css, js, images, and flash our basic home and 404 (page not found) templates
  • 12. Okay, so let’s look at one of these template files.
  • 13. What the fuck is all this motherfucking shit?
  • 14. The CrowdFusion templating language .cft is the file extenstion The .cft extension lets the compiler know to do stuff with anything inside a {% ... %} tag. Otherwise it’s HTML all the way. content blocks are the foundation for displaying content from the CMS Anything you want to output as HTML to the page needs to be inside a content block.
  • 15. Content blocks Five types of content blocks: HTML to generate before looping through header the main content. Loops through ever item in our contents data call and outputs that HTML. Is called between every line of data contents-inline generated in contents HTML to generate after the contents blocks footer have been completed noresults Shows when no data is found From the docs: All template blocks are optional, but there should be at least one in order to render output; in the absence of any defined template block, the system assumes that the entire template is enclosed in a contents block.
  • 16. How do you use a content block? “{%” marks the beginning of a “begin” initiates our content block CrowdFusion block and “header” specifies the type of content block we want {% begin header %} <h1>My Awesome Site</h1> {% asset css?=css/screen.css %} {% end %} We tell CrowdFusion to close the content block with {% end %}
  • 17. Header content block Contents content block Footer content block
  • 18. Well ain’t that inefficient.
  • 19. Using partial templates We can include our header code in a partial (_header.cft): And then include that partial like this:
  • 20. Oh, I know, you want your pretty.
  • 21. Including CSS & JS Including stylesheets {% asset css?src=css/screen.css %} Including javascript {% asset js?src=js/app.js %}
  • 22. Including Images & Flash Including images inline <img src="{% asset img?src=img/logo.jpg %}" /> Including Flash inline <embed src="{% asset version?src=swf/video.flv %}" /> Note: Since we’re using regular HTML tags, we can use all the tag attributes we’re used to: <img src="{% asset img?src=img/logo.jpg %}" class="myimage" alt= "my image, yo" />
  • 23. {% end %} Hopefully you now have an idea how to create a basic CrowdFusion theme Next time we’ll look at pulling in data from the CMS
  • 24. Own it. Browse this, you’ll find stuff you care about: https://www.assembla.com/wiki/show/crowdfusion/CFT_Template_Engine Oh, and the crowdgen homepage http://github.com/graybill/crowdgen

Editor's Notes