BlocTypes Planning

Prerequisites: Types Planning

Objective

Define the structure of each BlocType with its fields, identify variants, and plan custom admin templates.

Info

This step is planning. Actual BlocType creation in the back-office will be done after PHP code development.

Define BlocTypes

Info

Numeric prefixes (01., 02., etc.) in BlocType names are only used to order them in back-office lists. They are not displayed to contributors when creating content.

BlocType 1: Hero (H1)

Usage: All pages

Name: 01. Hero (H1) View: bloc_hero

  1. lang: Associated content for other language (string)
  2. title: H1 title (string, required)
  3. breadcrumbTitle: Title for breadcrumb (string, optional)
  4. description: WYSIWYG description (string, required)
  5. image: Background image (file PNG/JPG, optional)
  6. ctaTitle: Primary CTA title (string, optional)
  7. ctaTarget: Primary CTA target (string, optional)
  8. ctaSecondaryTitle: Secondary CTA title (string, optional)
  9. ctaSecondaryTarget: Secondary CTA target (string, optional)
Fields:

Required fields: title, description

BlocType 2: Title (H2 - H4)

Usage: Documentation pages

Name: 03. Title (H2 - H4) View: bloc_title

  1. hn: Title level (dropdown H2/H3/H4, required)
  2. title: Title text (string, required)
Fields:

Required fields: hn, title

BlocType 3: Content

Usage: Documentation pages

Name: 04. Content View: bloc_content

  1. content: Rich content (WYSIWYG, required)
Fields:

  1. Toolbar: bold, italic, underline, list, link
  2. Allowed formats: bold, italic, link, underline, list
WYSIWYG options:

Required fields: content

BlocType 4: Code

Usage: Documentation pages

Name: 06. Code View: bloc_code

  1. language: Language used (dropdown, required)
  2. code: Code block (textarea, required)
Fields:

Available languages: PHP, SQL, JSON, Typescript, HTML, SCSS, Javascript, CSS, Bash, Text, GraphQL

Required fields: language, code

BlocType 5: Info

Usage: Documentation pages

Name: 05. Info View: bloc_info

  1. type: Alert type (dropdown info/warning/error, required)
  2. title: Infobox title (string, required)
  3. content: Infobox content (WYSIWYG, required)
Fields:

  1. Toolbar: bold, italic, underline, list
  2. Allowed formats: bold, italic, underline, list
WYSIWYG options:

Required fields: type, title, content

BlocType 6: Feature (H3)

Usage: Home page

Name: 02. Feature (H3) View: bloc_feature

  1. icon: SVG icon (file SVG, required)
  2. title: H3 title (string, required)
  3. description: Short description (WYSIWYG, required)
Fields:

  1. Toolbar: bold, italic, underline, list
  2. Allowed formats: bold, italic, underline, list
WYSIWYG options:

Required fields: icon, title, description

BlocType 7: Cta

Usage: Home and documentation pages

Name: 04. Cta View: bloc_cta

  1. title: H2 title (string, required)
  2. description: Description (WYSIWYG, required)
  3. ctaTitle: Button title (string, required)
  4. ctaTarget: Link target (string, required)
Fields:

  1. Toolbar: bold, italic, underline, list
  2. Allowed formats: bold, italic, underline, list
WYSIWYG options:

Required fields: title, description, ctaTitle, ctaTarget

BlocType 8: Card

Usage: Contact page

Name: 04. Card View: bloc_card

  1. icon: SVG icon (file SVG, required)
  2. title: Title (string, required)
  3. description: Description (WYSIWYG, required)
  4. link: Link title (string, optional)
  5. linkRoute: Link target (string, optional)
  6. linkUrl: Raw URL (string, optional)
Fields:

  1. Toolbar: bold, italic, underline
  2. Allowed formats: bold, italic, underline
WYSIWYG options:

Required fields: icon, title, description

BlocType 9: Contact

Usage: Contact page only

Name: 07. Contact View: bloc_contact

  1. title: Form H2 title (string, required)
  2. successTitle: Success H2 title (string, required)
  3. success: Success message (WYSIWYG, required)
Fields:

  1. Toolbar: bold, italic, underline
  2. Allowed formats: bold, italic, underline
WYSIWYG options:

Required fields: title, successTitle, success

Identify Variants

Hero: Variants by Page Type

The Hero BlocType contains all possible fields. Variants are handled at PHP widget level:

  1. Shows: title, description, image, ctaTitle, ctaTarget, ctaSecondaryTitle, ctaSecondaryTarget
  2. Hides: breadcrumbTitle
  3. Layout: Full-width with background image
Home Variant:

  1. Shows: title, description, breadcrumbTitle
  2. Hides: image, CTA
  3. Layout: Simplified without image
Documentation Variant:

  1. Shows: title, description
  2. Hides: image, CTA, breadcrumbTitle
  3. Layout: Simplified without image
Contact Variant:

lang field: Present in all variants for multilingual linking

Admin Templates

Some BlocTypes require custom interfaces in the back-office to improve input experience.

Template 1: bloc_hero.php

BlocType: Hero (H1)

Need: Dropdowns to select targets

  1. lang: Dropdown listing all Nodes/Composites for FR/EN linking
  2. ctaTarget: Dropdown listing all Nodes/Composites
  3. ctaSecondaryTarget: Dropdown listing all Nodes/Composites
Affected fields:

Reason: Avoids manual route entry, displays organized list by type (Sections/Articles) with language indication

Template 2: bloc_cta.php

BlocType: Cta

Need: Dropdown to select target

  1. ctaTarget: Dropdown listing all Nodes/Composites
Affected fields:

Reason: Avoids manual route entry, provides all available content

Template 3: bloc_card.php

BlocType: Card

Need: Dropdown to select target

  1. linkRoute: Dropdown listing all Nodes/Composites
Affected fields:

Reason: Avoids manual route entry, allows easy target content selection

Summary

Defined BlocTypes

Total: 9 BlocTypes

With variants: 1 (Hero) With admin templates: 3 (Hero, Cta, Card)

Complete List

  1. Hero (H1) - bloc_hero - Admin template
  2. Title (H2-H4) - bloc_title
  3. Content - bloc_content
  4. Code - bloc_code
  5. Info - bloc_info
  6. Feature (H3) - bloc_feature
  7. Cta - bloc_cta - Admin template
  8. Card - bloc_card - Admin template
  9. Contact - bloc_contact

Validation

Before continuing, verify:

  1. 9 BlocTypes defined with their fields
  2. Required fields identified for each BlocType
  3. Hero variants planned
  4. 3 admin templates to develop identified