Skip to content

Martini Webpage Template Step Operations

In Martini, web page templates are built using specific types of steps, each serving a unique purpose. The two primary types of steps are:

  1. Tag Step: Represents an HTML element.
  2. Invoke Template Step: Allows for the inclusion and reuse of common web page components like headers, footers, or menus.

Invoke Template Step

Purpose

  • Used to integrate shared components across various web pages, promoting consistency and reducing code duplication.

Example Usage

  • For instance, CSS/JS files are typically used across multiple pages. By creating a separate template for these files, they can be easily included in any web page template.

Implementation

  • These steps can be added through an editor interface or by a direct action like dragging and dropping from a project navigator.
  • Parameters and data can be managed via a specialized view, allowing for the configuration of inputs and outputs.

Example [Placeholder for Code Snippet]

  • Show an example of an Index file incorporating common components like CSS/JS imports and a message alert.

Tag Step

Purpose

  • Serves as the building block for creating the structure of a web page.

Features

  • Consists of a tag name, attributes, and content, mirroring the structure of an HTML element.
  • Can include nested steps to form complex HTML structures.

Interaction with Other Steps

  • Conditional Inclusion [Placeholder for Code Snippet]: Using conditional logic to include or exclude tag steps.
  • Repetitive Inclusion [Placeholder for Code Snippet]: Demonstrating how to generate multiple instances of a tag.
  • Random Inclusion [Placeholder for Code Snippet]: Showing the use of random logic for unpredictable tag inclusion.

Dynamic Content and Attributes

  • Setting Content [Placeholder for Code Snippet]: Illustrating how to dynamically set the content of a tag.
  • Setting Attributes [Placeholder for Code Snippet]: Explaining how to dynamically adjust the attributes of a tag for responsive design.