Parts of Site However You Want Alter Template Presentation Based on Variables Chop Your Site into Maintainable Reusable Chunks Document for Code Reusablity - Slyman Analytics
global variables, snippets, pre- loaded text replacement and other templates • Can also contain HTML/JS, PHP, etc... • Embedded templates can pass variables • Nest multiple templates inside one another Types of Templates Hint: there’s more than one Pass Variables How deep can you embed?
Last thing processed in templates • For static info only • EE tags won’t work • Great for: header, footer, copyright, stylesheet links, etc... Types of Templates Hint: there’s more than one
How many have kids? Buy clothes? Consignment = sell your old clothes, buy new ones. Signup to help and get discounts/first pick Used 3rd party to login, manage your items for sale. Barcodes, POS, etc...
overhead • Processed early in rendering stages • Will parse EE tags • Can share snippets with MSM Types of Templates Hint: there’s more than one Too many database calls with regular templates
If & Statements BASIC VARIABLE {if username == "peanut_butter" AND username == "jelly"} <h1>Sandwich Time!</h1> {/if} ADVANCED VARIABLE pair type variables conditionally show or hide information on your pages based on criteria being met Advanced conditionals Parsed after all EE tags
username == "radiohead"} <h1>"I'm a creep."</h1> {if:else} <h1>It's all just rock and roll.</h1> {/if} If & Statements ELSE & ELSEIF Looks for Weezer first, then radiohead. If neither are logged in, defaults to generic.
than" <= "less than or equal to" > "greater than" >= "greater than or equal to" <> "not equal to" If & Statements OPERATORS You can use any of the following operators to compare a variable to a value: Logical operators compare multiple variables to multiple values, not getting in to that.
whatever custom fields you have here {/exp:weblog:entries} {/if} If & Segments THE SINGLE ENTRY PAGE Next/Previous don't work..not sure about pagination Low Seg2cat Only worked because each product had one category *****Any Questions?
• Project and plant channels had the same format • Needed to be able to use in a variety of sizes • Main, Homepage, Sidebar • Images and text truncating needed to be adjusted
exp_weblog_data.weblog_id=1" backspace="2"}"{field_id_4}", {/exp:query}]; var website = [{exp:query sql="SELECT DISTINCT field_id_6 FROM exp_weblog_data WHERE exp_weblog_data.weblog_id=1" backspace="2"}"{field_id_6}", {/exp:query}]; var album_title = [{exp:query sql="SELECT title FROM exp_weblog_titles WHERE exp_weblog_titles.weblog_id=1" backspace="2"}"{title}", {/exp:query}]; LOCALDATA DESIGNERSMUSIC AJAX AUTOCOMPLETE *****Any Questions?
"The Asteroids Galaxy Tour", "Blindside", "Common Children", "Elliot", "Feeder", "Fleet Foxes", "John Hopkins", "Andrew Bird", "Tyler Melashenko"]; var website = ["http://sf59.com/", "http://hammockmusic.com/", "http://coldplay.com/", "http://heroesorghosts.com", "http://www.theasteroidsgalaxytour.com/" "http://www.myspace.com/fleetfoxes"]; var album_title = ["Starflyer 59 (Gold)", "Maybe They Will Sing for Us Tomorrow", "Kenotic", "Raising Your Voice Trying to Stop an Echo", "Americana", "Leave Here a Stranger", "Silver (Extended Edition)", "My Island", "Dial M"]; LOCALDATA DESIGNERSMUSIC AJAX AUTOCOMPLETE *****Any Questions?
form_id="contact_form"} <label class="required">Current Page</label> <input class="std-input" type="text" name="location" value="{site_url}{segment_1}/{segment_2}" size="50" /> FOLIAGE FLEXIBLE CONTACT FORM Send info about what page they were on Embed Required
video="{video}" video_width="{video_width}" video_height="{video_height}"} {/exp:weblog:entries} SARAH LONGNECKER VIDEO LIGHTBOX CALLS IN MAIN TEMPLATE Could have made this whole thing a snippet to save template visual clutter? *****Any Questions?
• Product and blog page links needed to be dynamic • Other product info like short description and images needed to be dynamic as well • All of these could be overridden for special callouts
limit="1" dynamic="off"} {embed="_global/callout_related" entry_id="{entry_id}"} {/sidebar_callout} {if:else} {embed="_global/callout" entry_id="{entry_id}"} {/if} {/exp:weblog:entries} Real World Examples THE SIDEBAR TEMPLATE callout_related callout Look for related field