Skip to content

Commit

Permalink
Merge pull request #531 from entando/ENDOC-518
Browse files Browse the repository at this point in the history
ENDOC-518 Clean up Classic CMS tutorials
  • Loading branch information
nshaw authored Jul 11, 2022
2 parents 8ac47ab + 5d3aad5 commit eb1acd3
Show file tree
Hide file tree
Showing 14 changed files with 554 additions and 846 deletions.
265 changes: 84 additions & 181 deletions vuepress/docs/next/tutorials/compose/content-attributes.md
Original file line number Diff line number Diff line change
@@ -1,244 +1,147 @@

# Content Attributes

Attributes can be seen as the smallest elements that compose a Content
Type. In other words, a Content Type is just a collection of different
attributes. Attributes are responsible for carrying the actual
information inside a Content in Entando and could be of different types.
In this chapter, we will review and describe the different attribute
types.
An attribute is a well-defined property characterized by an attribute type and a set of applicable parameters. One or more attributes establish the definition of a content type comprise the information provided by content. This section describes the different attribute types supported by Entando.

Firstly, we can distinguish simple attribute types from composite
attribute types. In the first case, the attribute type carries a single
piece of information (for example, an image), while the latter is an
aggregation of simple attribute types (for example, a set of images).
## Attribute Types

## Simple Attribute Types
Attribute types can be broken into two categories: simple and composed. A simple attribute type consists of a single piece of information, e.g. an image. A composed attribute type is a collection of simple attribute types, e.g. a set of images.
### Simple Attribute Types

**Attach**

This represents the information carried by a file, which is attached to
the content.

It consists of an URL corresponding to the desired file present in the
system’s resources, and a text which can either indicate the description
or the name of the file.

This attribute type is rendered as a button named “Add”. By pushing that
button, the user is prompted to select a desired file present in the
system’s Digital Assets Attachments list.
- Represents a file attached to the content
- Consists of the URL of the file in the system’s resources and a text entry containing the file name or description
- Rendered as a ***button*** called `Add`. Clicking `Add` prompts the user to select a file from the system's Digital Assets attachment list.

**Boolean**

This attribute type represents a boolean value which can either be true
or false. This attribute type is rendered as two radio buttons labeled
“Yes” and “No”.
- Represents a boolean value which can be either true or false
- Rendered as a ***radio button*** with options labeled “Yes” and “No”
- Alternative to the **check box** attribute

**Checkbox**
**Check box**

This attribute type behaves in the same way as a Boolean does – it is
actually an alternative to the Boolean attribute type - but it is
rendered with a checkbox labeled “Yes” or “No”.
- Represents a boolean value which can be either true or false
- Rendered as a ***check box*** labeled “Yes” or “No”
- Alternative to the **boolean** attribute

**Date**

This attribute type represents a date, tracking time within a content;
it is often used to filter contents appearing in lists by publication
date, etc.

It is rendered as a datepicker.
- Represents a date
- Provides time tracking capabilities
- Often used to filter content by publication date, etc.
- Rendered as a ***datepicker***

**Timestamp**

This attribute type is specialized for the Date attribute, allowing you
to also specify the hour, minute and second.

It is rendered as a datepicker for the date, and a select for hours,
minutes and seconds.
- A specialized instance of the **date** attribute
- The hour, minute and second can be specified
- Rendered as a ***datepicker*** for the date and a ***select*** for hours, minutes and seconds

**Enumerator**

The enumerator attribute type represents textual information with a
predefined set of choices; it is defined by:

- Elements which are mandatory and declares the set of available
choices;

- Separator, which is optional and declares the character to use to
separate the arguments of the enumerator. By default the comma “,”
is used.

- ExtractorBean: this parameter represents the name of the Spring bean
to use to process the values of the enumerator. The name must
exactly match the id of the bean as defined in the Spring
configuration file.

It is rendered as a select list.
- Represents textual information using a predefined set of options
- Defined by:
- Mandatory elements declaring the set of available options
- An optional separator declaring the character to separate the enumerator arguments. The default separator is a comma.
- An ExtractorBean parameter naming the Spring bean that processes the enumerator. The value of ExtractorBean must exactly match the bean ID as defined in the Spring configuration file.
- Rendered as a ***select list***

**Enumerator Map**

The enumerator map attribute type represent textual information with a
predefined set of choices; it is defined by:

- Elements in the form of a separated list of key=value pairs, (i.e.
key1=value1,key2=value2)

- Separator, which is optional and declares the character to use to
separate the key, values pairs. By default the comma is used.

It is rendered as a select list which shows the available values.
- Represents textual information using a predefined set of options
- Defined by:
- Elements comprising a separated list of key-value pairs
- An optional separator declaring the character to separate the key-value pairs. The default separator is a comma.
- Rendered as a ***select list***

**Hypertext**

This attribute type holds HTML tagged text; it retains a single value
for all languages.

Even if this attribute type could support all HTML tags, we strongly
recommend using only tags which provide meaning and avoid those which
decorate or add graphics.
- Holds HTML-tagged text
- Retains a single value for all languages
- Rendered as a ***text area*** on the page to edit content

Hypertext attributes are rendered as a text area in the content edit
page; if the CKEditor is active, the user has access to a set of
additional functionalities from a dedicated editor’s toolbar. Such as
table insertion and table manipulation, special characters insertion,
string formatting, links creation.
> Notes: It is best practice to only enter meaningful HTML tags. Avoid those which are decorative or add graphics. If the CKEditor is active, additional functionalities are accessible from a dedicated editor’s toolbar (e.g.table insertion, table manipulation, special character insertion, string formatting, links creation).
**Image**

This attribute type binds an image resource to the content.

The image is always taken from the Digital Assets images list. The user
will need to specify the description accompanying the image.

Usually attributes of type Image are not indexed and are not used to
filter contents.

It is rendered as a button named “Add” that, when pushed, allows the
user to select an image from the Digital Assets images list. Once
selected the user is presented with a preview, as a thumbnail, of the
image and has the possibility to define some parameters:

- Text which is mandatory and by default takes the name of the
selected image

- legend (optional)

- alt (optional)

- description (optional)

- title (optional)
- Binds an image resource to the content
- The user must specify a description to accompany the image
- Images are rarely indexed or used to filter content
- Rendered as a ***button*** called `Add`. Clicking `Add` prompts the user to select an image from the Digital Assets image list.
- Selecting an image presents the user with a thumbnail preview and parameters:
- Text (mandatory) that defaults to the name of the selected image
- Legend (optional)
- Alt tag (optional)
- Description (optional)
- Title (optional)

**Link**

This attribute type represents an hypertext link; it is normally used to
include a link in your content: it is possible to define up to three
different types of links:

1. external links: a link pointing to a location external to the Entando
portal

2. link to page: a link which points to a page of the portal

3. link to a content: a link to another content

It is rendered as a button named “Add” that when pushed opens up a modal
window from which the user can select the link type.
- Represents an hypertext link
- Normally used to include a link within content
- It is possible to define up to three different types of links:
1. External link: Points to a location external to the Entando instance
2. Page link: Points to a page of the Entando instance
3. Content link: Points to other content within the Entando instance
- Rendered as a ***button*** called `Add`. Clicking `Add` opens a modal window from which the user can select the link type.

**Longtext**

This attribute type represents a simple unformatted text; it supports
several languages and is normally used for small descriptions, when a
short string won’t suffice.

It supports minimum length , maximal length and regular expressions as
optional parameters.

It is rendered as a textarea.
- Represents simple unformatted text
- Supports several languages and the optional parameters of minimum length, maximum length and regular expressions
- Normally used for a brief description when a short string is insufficient
- Rendered as a ***text area***

**Monotext**

Monotext represents the information in textual form, but supports only a
language; it is used for all

those fields which do not require localization.

It supports minimum length, maximal length, and regular expressions as
optional parameters.

It is rendered as a textfield.
- Represents information in textual form
- Supports only one language and the optional parameters of minimum length, maximum length and regular expressions
- Used for fields that do not require localization
- Rendered as a ***text field***

**Number**

This attribute type holds an integer number; it retains a single value
for all languages.

Supports the optional parameters: From, To, and Equal to.

It is rendered as a textfield.
- Holds an integer number
- Retains a single value for all languages
- Supports the optional parameters "From," "To" and "Equal to"
- Rendered as a ***text field***

**Text**

This attribute type holds a string; it retains a single value for all
languages.

It supports minimum length, maximal length, and regular expressions as
optional parameters.

It is rendered as a textfield.
- Holds a string
- Retains a single value for all languages
- Supports minimum length, maximum length and regular expressions as optional parameters
- Rendered as a ***text field***

**ThreeState**

Conceptually similar to the Boolean attribute, this attribute type
allows a third status “Both” to be present.

It is rendered as a radio button with “Yes”, “No”, “Both” options.

## Composed Attribute Types
- Conceptually similar to the **boolean** attribute, with "Both" as a third status option
- Rendered as a ***radio button*** with options labeled “Yes," "No” and "Both"
### Composed Attribute Types

All the attributes types of the previous chapter can only retain a
single type of information, but sometimes it is desirable to aggregate
different types of attributes into one attribute: this is where composed
attributes are used.
Simple attributes types can only retain a single type of information, whereas composed attribute types aggregate
different types of information into one attribute.

From a functional point of view, it would be perfectly legal to build a
content type specifying all the attributes back to back: the content
would be formally complete, but from a logical point of view the
attributes would appear mutually unrelated and, worse, the relationship
between them would not be explicit.
It is functionally legal to build a content type where all attributes are specified back-to-back: Although formally complete, this is logically insufficient, as attributes would appear mutually unrelated and their relationships to one another would not be explicitly defined.

Entando offers three types of composed attributes: List, Monolist,
Composite.
Entando offers three types of composed attributes: List, Monolist, and Composite.

**List**

This Attribute Type represents a set of independent and homogeneous
elementary Attribute types, each associated with one of the languages
defined in the system.

An immediate consequence is that this kind of list can handle only
mono-language basic attributes.

It is rendered with a button named “Add” that if pushed presents the
user a prompt to select or define the single elements which compose the
list.
- Represents a set of independent and homogeneous elementary attribute types
- Each attribute type is associated with only one of the languages defined in the system, limiting the **list** attribute to mono-language attributes
- Rendered as a ***button*** called `Add`. Clicking `Add` prompts the user to select or define the single elements which compose the list.

**Monolist**

This attribute type is a list that is common to all the system
languages; this kind of list handles multi-language and mono-language
attributes.

It is rendered with a button named “Add” that, if pushed, presents the
user with a prompt to select or define the single elements that compose
the monolist.
- Represents a list that is common to all of the languages defined in the system, allowing the **monolist** attribute to handle both mono-language and multi-language attributes
- Rendered as a ***button*** called `Add`. Clicking `Add` prompts the user to select or define the single elements which compose the monolist.

**Composite**

This attribute type is an aggregate of different, non-homogeneous,
simple attributes types. The aggregation of different types is treated
as a single unit.

It is rendered as a combination of the elementary attribute types, where
each attribute type presents the proper rendering.
- Represents an aggregate of different, non-homogeneous, simple attributes types
- The aggregation of different types is treated as a single unit
- Rendered as a combination of the elementary attribute types, where each attribute type presents the proper rendering

22 changes: 11 additions & 11 deletions vuepress/docs/next/tutorials/compose/content-templates-tutorial.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
# Content Templates

Content Templates define how information is displayed when a Content is published. They provide the styling and layout for Content Types and offer different representations of the same content.
Content Templates define how information is displayed when content is published. They provide the styling and layout for Content Types and enable different representations of the same content.

## Create a Content Template

Content Templates are managed via the Web CMS, through a user interface provided by the [Entando App Builder](../../docs/getting-started/concepts-overview.md#entando-app-builder). Follow the steps below to create and configure a Content Template.
Content templates are managed by the Entando Web Content Management System (WCMS), through a user interface accessible from the [App Builder](../../docs/getting-started/concepts-overview.md#entando-app-builder). Follow the steps below to create and configure a content template.

**1. From the left menu of the App Builder, go to `Content``Templates`.**
**1. From the left menu of the App Builder, go to `Content``Templates`**

**2. Click the `Add` button in the upper right corner.**
**2. Click the `Add` button above the list of existing templates**

![createContentTemplate](./img/content_template1.png)

**3. Define the characteristics of the Content Template:**
**3. Define the characteristics of the content template**

![defineContentTemplate](./img/content_template2.png)

- `Type`: Choose a Content Type from the drop-down list. Click the `Set` button to input your selection and enable Attribute suggestions in subsequent fields.
- `Type`: Choose a content type from the drop-down list. Click the `Set` button to input your selection.

- `Code`: Enter a sequence of up to 10 numbers to uniquely identify the Content Template. This field is mandatory.
- `Code`: Enter a sequence of up to 10 numbers to uniquely identify the content template. This field is mandatory.

- `Name`: Enter a name or description for the Content Template. This field supports a string value of 50 characters or less and should consist of one or more of the following: uppercase letters, lowercase letters, numbers and/or special characters.
- `Name`: Enter a name or description for the content template. This field is mandatory and supports a string of 50 characters or less and should consist of one or more of the following: uppercase letters, lowercase letters, numbers and/or special characters.

- `Model`: Enter HTML to model the Content Template based on Velocity language.
- `Model`: Enter HTML to model the content template with Velocity language. This field is mandatory.

- `Style Sheet`: (Optional) Enter the CSS to be applied to the HTML `Model`.

**4. Click the `Save` button.**
**4. Click the `Save` button**

This adds the Content Template to the Content Type.
This adds the content template to the content type.

Loading

0 comments on commit eb1acd3

Please sign in to comment.