-
Notifications
You must be signed in to change notification settings - Fork 326
Components, Elements, or Snippets
- Hotel
- Car
- Footer
- Sidebar
First of all, Blocks - Typically a block is a position which can be filled with something in a templating system or CMS. The conventional use of the term Block is not related to our use case.
The following are candidate names and definitions:
Element: One of the simplest or essential parts or principles of which anything consists, or upon which the constitution or fundamental powers of anything are based. [1913 Webster]
Snippet: A small part or piece
Component: A constituent part; an ingredient.
Snippet implies something small or incomplete, while Element implies something more complete, foundational, and not necessarily small.
Snippet is also more commonly used in relation to templates (both "code" and html):
- https://ellislab.com/expressionengine/user-guide/templates/globals/snippets.html
- http://msdn.microsoft.com/en-us/library/ms165394.aspx
- http://manual.macromates.com/en/snippets
Element on the otherhand might perhaps be better used to talk about the atoms of our system, e.g. the content types and therefore is possibly not the best choice:
I wonder if components would be better, e.g. Component is used by Magnolia CMS for something similar:
Currently there is a templates/
directory containing the XML templates for the structures.
I propose we rename templates/
to pages/
and so we have the following file structure:
app/
Resources/
pages/
homepage.xml
product.xml
product-overview.xml
faq.xml
components/
hotel.xml
banner.xml
sidebar.xml
We maintain the Structure
class, but it becomes the abstract super-type of new Page
and Component
classes.
The new class should be contained within the Core package it represents a fundamental concept of the Sulu CMF.