TERMINALFOUR t44u 2012 - Programmable layouts

345 views

Published on

The plans for TERMINALFOUR Site Manager for the next year. This session included an open Q&A and feedback session.

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
345
On SlideShare
0
From Embeds
0
Number of Embeds
12
Actions
Shares
0
Downloads
0
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

TERMINALFOUR t44u 2012 - Programmable layouts

  1. 1. Programmable Page & Content Layouts
  2. 2. Existing Functionality in Site Manager 7.3 • Page Layouts (Styles) & Content Layouts (Template Formatters) • Made up of HTML with T4 Tags in them • On preview / publish, T4 Tags are parsed and Brokers, written in Java are called to process themProgrammable Layouts 2
  3. 3. Shortcomings of placeholders • Using token replacement is restrictive • No if / then / else logic Programmable Layouts • Can be applied to Page and Content Layouts • Initially implemented Javascript (Rhino) • Scope to extend to other scripting languages • Allow Layouts to be programmed • Turing CompleteProgrammable Layouts 3
  4. 4. Programmable Layouts • All functionality in current Layouts available in Programmable Layouts document.write (BrokerUtils.processT4Tags (oStmt, oCache, oSection, oContent, sLang, fPreview, sTextToParse)); • Process T4 Tags within the provided page and output the result to the current page • Using document.write writes text to the current pageProgrammable Layouts 4
  5. 5. Programmable Layouts • Simple if / then / else logic if (BrokerUtils.isFullTextPage (oCache)) { document.write (<p>This is a full text page</p>); } if (sLang === es) { document.write (<p>Were on the Spanish page.</p>); } else { document.write (<p>Were NOT on the Spanish page.</p>); }Programmable Layouts 5
  6. 6. Sample Footer 6
  7. 7. Programmable Layouts • More Complex functionality possible • Prototype queries an external database & outputs the results in a HTML table within the published page • This has been done with less than 100 lines of code within the LayoutProgrammable Layouts 7
  8. 8. Benefits of Programmable Layouts • Applicable to Page and Content Layouts • Makes it simple to create complex pages • Hugely powerful • Provide simple if / then / else logic • Access to entire TERMINALFOUR API • Can access external database • Can read external web servicesProgrammable Layouts 8
  9. 9. • Will be available in Beta form in Site Manager 7.4 • Can be enabled on a per-Layout basis to ensure backwards-compatibility and performance • Security…Programmable Layouts 9

×