SlideShare a Scribd company logo
1 of 45
Download to read offline
FUN WITH FLUID
24/06/2018 Fun with Fluid 1
FUN WITH FLUID
Jigal van Hemert
jigal.van.hemert@typo3.org
@jigalvh
Creative templating
TOPICS
24/06/2018 Fun with Fluid 3
TOPICS
24/06/2018 4Fun with Fluid
1. What’s Fluid
2. Examples
3. Your examples, questions, discussion
WHAT’S FLUID?
A templating solution
24/06/2018 Fun with Fluid 5
WHAT’S FLUID?
 XML based templating engine
 Born when making FLOW3 and Phoenix (now
FLOW and NEOS)
 Now standalone project
24/06/2018 Fun with Fluid 6
EXAMPLES
24/06/2018 Fun with Fluid 7
INLINE
INSTEAD OF
BLOCKS
24/06/2018 Fun with Fluid 8
INLINE VS BLOCKS
<f:if condition="{field1}">
<f:then>
<f:if condition="{field2} == 'big'">
<f:then>
<f:form.textfield name="plaap" class="big" value="{field1}" />
</f:then>
<f:else>
<f:form.textfield name="plaap" class="small" value="{field1}" />
</f:else>
</f:if>
</f:then>
<f:else>
<f:if condition="{field2} == 'big'">
<f:then>
<f:form.textfield name="plaap" class="big" value="" />
</f:then>
<f:else>
<f:form.textfield name="plaap" class="small" value="" />
</f:else>
</f:if>
</f:else>
</f:if>
24/06/2018 Fun with Fluid 9
INLINE VS BLOCKS
<f:form.textfield
name="plaap"
class="{f:if(
condition: '{field2}=='big'',
then: 'big',
else: 'small')}"
value="{f:if(condition: '{field1}',
then: '{field1}')}"
/>
24/06/2018 Fun with Fluid 10
INLINE VS BLOCKS
 http://www.fluid-converter.com/
24/06/2018 Fun with Fluid 11
OPTIONAL
RENDERING,
SOMETIMES...
24/06/2018 Fun with Fluid 12
OPTIONAL RENDERING
 Some file types need some extra content
24/06/2018 Fun with Fluid 13
OPTIONAL RENDERING
<f:switch expression=”{file.extension}”>
<f:case value=”odt”>
<f:render section=”docstuff”
arguments=”{file:file.url}” />
</f:case>
....
</f:switch>
24/06/2018 Fun with Fluid 14
OPTIONAL RENDERING
<f:variable name="allowedext” value=”{odt:
'docstuff', ods: 'docstuff', odp: 'docstuff'
....}" />
<f:render
section="{allowedext.{file.extension}}"
optional=”1” arguments="{url: file.url}"
/>
24/06/2018 Fun with Fluid 15
OPTIONAL RENDERING
<f:alias map="{allowedext: {0: 'odt', 1: 'ods',
2: 'odp' ......}}">
<f:for each="{allowedext}" as="ext">
<f:if condition="{ext} == {file.extension}">
<f:render section="docstuff"
arguments="{file.url}"/>
</f:if>
</f:for>
</f:alias>
24/06/2018 Fun with Fluid 16
OPTION,
CHECKED OR NOT?
24/06/2018 Fun with Fluid 17
CHECK OPTION
 Form with attached options
 Each option a checkbox
 Determine if checkbox is set
24/06/2018 Fun with Fluid 18
CHECK OPTION
<f:for each=”{options} as=”option”>
<f:form.checkbox
checked=”{f:if(
condition:'{formOption.uid} ==
{option.uid}',
then: 1) -> f:for(each: formOptions,
as:'formOption')}”
/>
</f:for>
24/06/2018 Fun with Fluid 19
PARENTS, PARENTS,
PARENTS, ...
24/06/2018 Fun with Fluid 20
RECURSION
 Dog pedigree
 Dog → litter → parents(dog)
 Display previous generations
 Recursive partials
 Fluid calculation
24/06/2018 Fun with Fluid 21
24/06/2018 Fun with Fluid 22
RECURSION
<table><tr><td rowspan=”2”>{dog.name}</td>
<td class="dad">
<f:if condition="{dog.litter} && {dog.litter.dad} && ({level} >
1)">
<f:render partial="Dog/Pedigree"
arguments="{dog:dog.litter.dad, level:'{level} - 1'}" />
</f:if>
</td></tr><tr><td class=”mom”>
<f:if condition="{dog.litter} && {dog.litter.mom} && ({level} >
1)">
<f:render partial="Dog/Pedigree"
arguments="{dog:dog.litter.mom, level:'{level} - 1'}" />
</f:if>
</td></tr></table>
24/06/2018 Fun with Fluid 23
24/06/2018 Fun with Fluid 24
CLASSY
CALCULATIONS
24/06/2018 Fun with Fluid 25
INLINE PARTIAL
 Bootstrap grid
 Class depends on number of columns and
page layout
24/06/2018 Fun with Fluid 26
INLINE PARTIAL
<div class="col-md-6 or 4 or 3 or 2">
24/06/2018 Fun with Fluid 27
INLINE PARTIAL
<div class="col-md-{f:render(
partial:'Helpers/bootstrapCol',
Arguments:'{
hasMenu: hasMenu,
count: gallery.count.columns}'
)}"
>
24/06/2018 Fun with Fluid 28
INLINE PARTIAL
<f:spaceless>
<f:if condition="{hasMenu} == 1 && {count} == 2">4</f:if>
<f:if condition="{hasMenu} == 1 && {count} == 3">3</f:if>
<f:if condition="{hasMenu} == 1 && {count} == 4">2</f:if>
<f:if condition="{hasMenu} == 0 && {count} == 2">6</f:if>
<f:if condition="{hasMenu} == 0 && {count} == 3">4</f:if>
<f:if condition="{hasMenu} == 0 && {count} == 4">3</f:if>
</f:spaceless>
24/06/2018 Fun with Fluid 29
24/06/2018 Fun with Fluid 30
CACHE AS CACHE CAN
24/06/2018 Fun with Fluid 31
CACHING TEMPLATES
 Fluid templates are cached
24/06/2018 Fun with Fluid 32
CACHING TEMPLATES
<table><tr><td rowspan=”2”>{dog.name}</td>
<td class="dad">
<f:if condition="{dog.litter} && {dog.litter.dad} && ({level} >
1)">
<f:render partial="Dog/Pedigree"
arguments="{dog:dog.litter.dad, level:'{level} - 1'}" />
</f:if>
</td></tr><tr><td class=”mom”>
<f:if condition="{dog.litter} && {dog.litter.mom} && ({level} >
1)">
<f:render partial="Dog/Pedigree"
arguments="{dog:dog.litter.mom, level:'{level} - 1'}" />
</f:if>
</td></tr></table>
24/06/2018 Fun with Fluid 33
CACHING TEMPLATES
$arguments63['partial'] = 'Dog/Pedigree';
// Rendering Array
$array65 = array();
$array66 = array (
);$array65['dog'] = $renderingContext->getVariableProvider()->getByPath('dog.litter.dad',
$array66);
$output67 = '';
$array68 = array (
);
$output67 .= $renderingContext->getVariableProvider()->getByPath('level', $array68);
$output67 .= ' - 1';
$array65['level'] = $output67;
$array69 = array (
);$array65['origlevel'] = $renderingContext->getVariableProvider()->getByPath('origlevel',
$array69);
$arguments63['arguments'] = $array65;
$output62 .= TYPO3FluidFluidViewHelpersRenderViewHelper::renderStatic($arguments63,
$renderChildrenClosure64, $renderingContext);
24/06/2018 Fun with Fluid 34
CACHING TEMPLATES
 Fluid templates/partials are cached
 Some ViewHelpers can’t be cached
24/06/2018 Fun with Fluid 35
CACHING TEMPLATES
 Fluid templates/partials are cached
 Some ViewHelpers can’t be cached
 Not a big problem, unless there is a huge
block inside
24/06/2018 Fun with Fluid 36
CACHING TEMPLATES
 Paginate VH in its own partial
24/06/2018 Fun with Fluid 37
CACHING TEMPLATES
<f:render
partial="BackendUser/PaginatedListWidget"
arguments="{_all}"
/>
24/06/2018 Fun with Fluid 38
CACHING TEMPLATES
<f:be.widget.paginate
objects="{backendUsers}"
as="paginatedBackendUsers"
configuration="{itemsPerPage: 50, insertBelow:
1}">
<f:render
partial="BackendUser/PaginatedListWidgetBody"
arguments="{_all}" />
</f:be.widget.paginate>
24/06/2018 Fun with Fluid 39
CACHING TEMPLATES
<div class="table-fit">
...
<f:for each="{paginatedBackendUsers}"
as="backendUser">
<f:render partial="BackendUser/IndexListRow"
arguments="{demand: demand, backendUser: backendUser,
onlineBackendUsers: onlineBackendUsers, dateFormat:
dateFormat, timeFormat: timeFormat, returnUrl: returnUrl,
compareUserUidList: compareUserUidList}" />
</f:for>
...
</div>
24/06/2018 Fun with Fluid 40
FURTHER READING
24/06/2018 Fun with Fluid 41
FURTHER READING
 https://github.com/TYPO3/Fluid
 https://docs.typo3.org/typo3cms/
ExtbaseGuide/Fluid/Index.html
 https://docs.typo3.org/typo3cms/
ExtbaseFluidBook/8-Fluid/Index.html
24/06/2018 Fun with Fluid 42
FURTHER READING
 Keeping up-to-date:
https://typo3.org/help/documentation/what
s-new/
24/06/2018 Fun with Fluid 43
SHOW YOUR
SOLUTION
OR
CHALLENGE
24/06/2018 Fun with Fluid 44
THANK YOU!
24/06/2018 Fun with Fluid 45

More Related Content

Recently uploaded

The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
shinachiaurasa2
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
masabamasaba
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
mohitmore19
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
masabamasaba
 

Recently uploaded (20)

%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
 
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdfThe Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK Software
 

Featured

How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
 

Featured (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

Fun with fluid_t3dd18