All Projects → sitegeist → fluid-components

sitegeist / fluid-components

Licence: GPL-2.0 license
Encapsulated frontend components with Fluid's ViewHelper syntax for TYPO3

Programming Languages

PHP
23972 projects - #3 most used programming language
shell
77523 projects
HTML
75241 projects

Projects that are alternatives of or similar to fluid-components

schema
TYPO3 extension providing an API and view helpers for schema.org markup
Stars: ✭ 19 (-53.66%)
Mutual labels:  typo3, typo3-fluid, typo3-extension
Fluidcontent
TYPO3 extension Fluidcontent: Fluid Content Element Engine
Stars: ✭ 82 (+100%)
Mutual labels:  fluid, typo3
sf event mgt
An event management and registration extension for TYPO3 CMS based on ExtBase and Fluid.
Stars: ✭ 46 (+12.2%)
Mutual labels:  fluid, typo3
luxletter
Newsletter system for TYPO3
Stars: ✭ 18 (-56.1%)
Mutual labels:  typo3, typo3-extension
typo3v10 example sitepackage
Site package extension for TYPO3 10 feature demonstration
Stars: ✭ 13 (-68.29%)
Mutual labels:  typo3, typo3-extension
aus driver amazon s3
Provides a TYPO3 FAL driver for the Amazon Web Service S3
Stars: ✭ 15 (-63.41%)
Mutual labels:  typo3, typo3-extension
urlguard
TYPO3 extension urlguard. Allows to define what query parameters will be passed to newly created typolinks.
Stars: ✭ 16 (-60.98%)
Mutual labels:  typo3, typo3-extension
in2publish core
in2publish Community Version
Stars: ✭ 38 (-7.32%)
Mutual labels:  typo3, typo3-extension
mask export
Export your mask elements as extension
Stars: ✭ 45 (+9.76%)
Mutual labels:  typo3, typo3-extension
content defender
Define allowed or denied content element types in your backend layouts
Stars: ✭ 63 (+53.66%)
Mutual labels:  typo3, typo3-extension
TYPO3 Restler
restler (PHP REST-Framework) for TYPO3
Stars: ✭ 29 (-29.27%)
Mutual labels:  typo3, typo3-extension
restrictfe
TYPO3 extension restrictfe. Blocks access to frontend and allows to show it only to some defined exception's like if the request is from an authorized backend user, has specific IP, header etc.
Stars: ✭ 12 (-70.73%)
Mutual labels:  typo3, typo3-extension
backend debug
Debug support in TYPO3 backend
Stars: ✭ 20 (-51.22%)
Mutual labels:  typo3, typo3-extension
TYPO3CMS-Book-ExtbaseFluid
TYPO3 Documentation: "Developing TYPO3 Extensions with Extbase and Fluid" (Book)
Stars: ✭ 26 (-36.59%)
Mutual labels:  fluid, typo3
form examples
TYPO3 extension. Ships several examples for the TYPO3 Form Framework, e.g. an upload form or a custom email template with personalized salutation. Includes translation examples (both global and specific).
Stars: ✭ 30 (-26.83%)
Mutual labels:  typo3, typo3-extension
autoloader
⚙️ Best TYPO3 Swiss Army knife ever ⚙️
Stars: ✭ 22 (-46.34%)
Mutual labels:  typo3, typo3-extension
t3x-rte ckeditor image
Image support in CKEditor for the TYPO3 ecosystem
Stars: ✭ 43 (+4.88%)
Mutual labels:  typo3, typo3-extension
randomdata
TYPO3 extensions to generate new random data or replace existing data with random data
Stars: ✭ 14 (-65.85%)
Mutual labels:  typo3, typo3-extension
autoswitchtolistview
Auto switch to list view when a sysfolder is shown
Stars: ✭ 14 (-65.85%)
Mutual labels:  typo3, typo3-extension
typo3-secure-downloads
Secure your assets and data from unwanted download. Apply TYPO3 access rights to ALL file assets (PDFs, TGZs or JPGs etc. - configurable) - protect them from direct access.
Stars: ✭ 15 (-63.41%)
Mutual labels:  typo3, typo3-extension

Fluid Components

This TYPO3 extensions puts frontend developers in a position to create encapsulated components in pure Fluid. By defining a clear interface (API) for the integration, frontend developers can implement components independent of backend developers. The goal is to create highly reusable presentational components which have no side effects and aren't responsible for data acquisition.

⬇️ TL;DR? Get started right away ⬇️

What does it do?

Fluid templates usually consist of three ingredients:

  • Templates,
  • Layouts, which structure and wrap the markup defined in the template, and
  • Partials, which contain markup snippets to be reused in different templates.

In addition, ViewHelpers provide basic control structures and encapsulate advanced rendering and data manipulation that would otherwise not be possible. They are defined as PHP classes.

The extension adds another ingredient to Fluid: Components.

What are components?

Fluid components are similar to ViewHelpers. The main difference is that they can be defined solely in Fluid. In a way, they are quite similar to Fluid's partials, but they have a few advantages:

  • They provide a clear interface via predefined parameters. The implementation is encapsulated in the component. You don't need to know what the component does internally to be able to use it.
  • With semantic component names your templates get more readable. This gets even better with atomic design or similar approaches.
  • They can easily be used across different TYPO3 extensions because they utilize Fluid's namespaces. No partialRootPath needed.

How do components look like?

The following component implements a simple teaser card element:

Components/TeaserCard/TeaserCard.html

<fc:component>
    <fc:param name="title" type="string" />
    <fc:param name="link" type="Typolink" />
    <fc:param name="icon" type="string" optional="1" />
    <fc:param name="theme" type="string" optional="1" default="light" />

    <fc:renderer>
        <a href="{link}" class="{component.class} {component.class}-{theme}">
            <h3 class="{component.prefix}title">{title}</h3>
            <f:if condition="{content}">
                <p class="{component.prefix}description">{content}</p>
            </f:if>

            <f:if condition="{icon}">
                <i class="icon icon-{icon} {component.prefix}icon"></i>
            </f:if>
        </a>
    </fc:renderer>
</fc:component>

Use the following code in your template to render a teaser card about TYPO3:

{namespace my=VENDOR\MyExtension\Components}
<my:teaserCard
    title="TYPO3"
    link="https://typo3.org"
    icon="typo3"
>
    The professional, flexible Content Management System
</my:teaserCard>

The result is the following HTML:

<a href="https://typo3.org" class="smsExampleTeaserCard smsExampleTeaserCard-light">
    <h3 class="smsExampleTeaserCard_title">TYPO3</h3>
    <p class="smsExampleTeaserCard_description">The professional, flexible Content Management System</p>

    <i class="icon icon-typo3 smsExampleTeaserCard_icon"></i>
</a>

(improved indentation for better readability)

Getting Started

  1. Install the extension either from TER or via composer:

    composer require sitegeist/fluid-components
    
  2. Define the component namespace in your ext_localconf.php:

    $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['fluid_components']['namespaces']['VENDOR\\MyExtension\\Components'] =
    	\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('my_extension', 'Resources/Private/Components');

    Use your own vendor name for VENDOR, extension name for MyExtension, and extension key for my_extension.

  3. Create your first component in EXT:my_extension/Resources/Private/Components/ by creating a directory MyComponent containing a file MyComponent.html

  4. Define and apply your component according to How do components look like?. The Extended Documentation can be helpful as well.

  5. Check out Fluid Styleguide, a living styleguide for Fluid Components, and Fluid Components Linter to improve the quality and reusability of your components.

If you have any questions, need support or want to discuss components in TYPO3, feel free to join #ext-fluid_components.

Why should I use components?

  • Components encourage markup reusage and refactoring. Only the component knows about its implementation details. As long as the interface stays compatible, the implementation can change.
  • Components can be a tool to enforce design guidelines. If the component's implementation respects the guidelines, they are respected everywhere the component is used. A helpful tool to accomplish that is the corresponding living styleguide: Fluid Styleguide.
  • Components formalize and improve communication. Frontend developers and integrators agree on a clearly defined interface instead of debating implementation details.
  • Components reduce dependencies. Frontend developers can work independent of integrators and backend developers.

Extended Documentation

Feature References

How-To's

Authors & Sponsors

The development and the public-releases of this package is generously sponsored by my employer https://sitegeist.de.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].