Skip to content

FrontEndManagementCSS

Paceaux edited this page Jul 7, 2015 · 5 revisions

Introduction

This page outlines Tridion design approaches and trade-offs with two approaches to managing CSS.

CSS is code for which a Tridion developer is responsible for maintaining, but not necessarily writing. CSS is a stylesheet language which is used for formatting markup, predominantly HTML. Like any quality code, it should be well-architected so that it is flexible, maintainable, and sustainable. This will outline patterns for managing CSS.

CSS Management

There are at least three approaches for managing the CSS for a website in Tridion

Approach 1: Binary Files

Synonyms

  • Multimedia Components
  • CSS Schema

Context

This approach is often used with a code repository.

  • A developer uses WebDav to transfer CSS files from a code repo.
  • CSS is put into Tridion using multimedia schema
  • Default Multimedia Schema is used or a CSS multimedia schema is created

Publishing

  • The CSS binaries can be published to the web server
  • CSS component template can be created, CSS components added to a page template for CSS, the CSS page is published

Approach 2: Code Components

Synonyms

  • Code Schemas
  • Plain text Schemas

Context

This approach is often used without a code repository.

  • A developer copies and pastes CSS from a text editor into a code component.
  • CSS is managed in Tridion as either a generic "code component" or a custom CSS component which contains a large plaintext field

Publishing

  • CSS components must be added to a CSS page template with a CSS component Template
  • A CSS page is published

Approach 3: External Files

Synonyms

  • Web application: an application used to deliver the website to the end user

Context

As web sites increasingly use MVC frameworks, the web application begins to live outside of Tridion. Whether the MVC framework is Java or .NET, the templates/ views live inside of the web application's project/solution, rather than Tridion. These applications frequently also contain the JavaScript and CSS for the website. Therefore, all components responsible for the presentation of the content live outside of Tridion.

Publishing

Rather than using Tridion for pushing CSS, stylesheets have a separate development lifecycle from content.

Pros and Cons

Pros Cons
Binary File CSS is kind of like content, Easy to migrate from code repo, no risk of errors in migration Cannot edit CSS in Tridion, front-end debugging goes more slowly, CSS doesn't share same life cycle as web application
Code Component CSS is content, can edit CSS in Tridion, front-end debugging goes quickly difficult to migrate from code repo, risk of migration errors, CSS doesn't share same life cycle as web application
External Files CSS separate from Tridion, Easy to migrate from repository, files are placed directly on web server, front-end developers don't need to touch Tridion at all CSS shares same development life cycle as other code

Clone this wiki locally