Contents

Last updated on Sep 16, 2025

Contents Block

The Contents block displays multiple content items from your Tourismo admin platform. It can show all content or filter by specific content types, with flexible layout options including card and list views.

Overview

The Contents block is ideal for creating content showcases, blog-style layouts, or content directories. It automatically pulls content from your Tourismo admin platform and displays it in an organized, responsive grid. You can filter content by type, control the layout, and customize what information is displayed for each content item.

Block Features & Options

Display Modes

  • Content Type Filter: Select a specific content type to display only that type of content
  • View Type: Choose between card layout or list layout
  • Columns: Set the number of columns (1-4) for responsive grid layout

Layout Options

  • Show Title: Display the content title
  • Show Description: Display the content description
  • Show Image: Display the content hero image
  • Button Text: Customize the "Read More" button text

Content & Filter Options

  • Content Type Slug: Filter content by specific content type
  • Sort By: Sort content by name or other criteria
  • Linked Page ID: Required - Link to a collection page for navigation

How it Works

The Contents block queries your Tourismo Platform API to retrieve content items. It can display all content or filter by a specific content type. The block automatically excludes the current content item when viewed on a single content page to avoid showing the same item twice. Content is displayed in either a card layout with Bootstrap styling or a list layout with larger images.

How to Add & Configure

  1. Add the Contents block to your page using the block editor
  2. Select a Content Type (optional) - Choose a specific content type to filter results
  3. Choose View Type - Select "Card" for grid layout or "List" for vertical layout
  4. Set Columns - Choose 1-4 columns for responsive grid layout
  5. Configure Display Options - Toggle title, description, and image display
  6. Set Linked Page - Required - Link to a collection page for navigation
  7. Customize Button Text - Set custom text for the "Read More" button

Shortcode Usage

Basic Shortcode

[tourismo-contents]

Complete Options Table

Option Type Default Description
content_type_slug string "" Filter content by specific content type slug
view_type string "card" Display layout: "card" or "list"
columns string "3" Number of columns: "1", "2", "3", or "4"
show_title boolean true Display content titles
show_description boolean true Display content descriptions
show_image boolean true Display content hero images
button_text string "Read More" Custom text for read more button
sort_by string "name" Sort order for content items
linked_page_id string "" Required - ID of collection page for navigation
custom_template_name string "" Custom template override name
class_name string "" Additional CSS classes
align string "" Block alignment: "left", "center", "right", "wide", "full"

Practical Examples

Display all content in 2-column card layout:

[tourismo-contents columns="2" linked_page_id="123"]

Show only blog posts in list layout:

[tourismo-contents content_type_slug="blog-post" view_type="list" linked_page_id="123"]

Custom button text with 4-column layout:

[tourismo-contents columns="4" button_text="Learn More" linked_page_id="123"]

Minimal display without images:

[tourismo-contents show_image="false" linked_page_id="123"]

Content Displayed

The Contents block displays content items from your Tourismo admin platform with the following information:

  • Title: Content title (if enabled)
  • Description: Content description with markdown support (if enabled)
  • Hero Image: Featured image (if enabled)
  • Read More Button: Links to the individual content page

Layout Options

Card Layout: Content displayed in Bootstrap cards with consistent spacing and styling List Layout: Content displayed vertically with larger images and more prominent text

The block automatically handles responsive design, adjusting column layout based on screen size.

Related Blocks

  • Content Block - Display a single content item
  • Itineraries Block - Display itinerary collections
  • Listings Block - Display business/listing collections
  • Events Block - Display event collections