Skip to main content
SidsProjectImpact

Back to all posts

How to Use Partials In October CMS Templates?

Published on
8 min read
How to Use Partials In October CMS Templates? image

Best CMS Development Guides to Buy in March 2026

1 4PCS Circle Template, Plastic Circle and Oval Measuring Templates, Formwork Drawings Templates (Clear Green)

4PCS Circle Template, Plastic Circle and Oval Measuring Templates, Formwork Drawings Templates (Clear Green)

  • 4 UNIQUE SIZES: MEET ALL YOUR DRAWING NEEDS EFFORTLESSLY!

  • DURABLE QUALITY: ENJOY LONG-LASTING STENCILS THAT WON'T WARP OR BEND.

  • PERFECT FOR ALL: IDEAL FOR BOTH PROFESSIONALS AND CREATIVE HOBBYISTS!

BUY & SAVE
$6.99
4PCS Circle Template, Plastic Circle and Oval Measuring Templates, Formwork Drawings Templates (Clear Green)
2 GAUENEEN 5 Pcs Architectural Templates: Circle, House Plan, Interior Design & Furniture Templates, Drafting Tools & Ruler Shapes for Architecture

GAUENEEN 5 Pcs Architectural Templates: Circle, House Plan, Interior Design & Furniture Templates, Drafting Tools & Ruler Shapes for Architecture

  • VERSATILE TEMPLATES FOR HOUSE PLANS, FURNITURE, AND MORE!
  • DURABLE, FLEXIBLE PLASTIC ENSURES EASY, RELIABLE USE EVERY TIME.
  • IDEAL FOR ARCHITECTURE, ART, AND SCHOOL PROJECTS-LIMITLESS CREATIVITY!
BUY & SAVE
$8.92
GAUENEEN 5 Pcs Architectural Templates: Circle, House Plan, Interior Design & Furniture Templates, Drafting Tools & Ruler Shapes for Architecture
3 CMS Made Simple 1.6: Beginner's Guide

CMS Made Simple 1.6: Beginner's Guide

BUY & SAVE
$48.99
CMS Made Simple 1.6: Beginner's Guide
4 Makita 193264-4 Template Guide, 3/8-Inch

Makita 193264-4 Template Guide, 3/8-Inch

  • COMPACT SIZE: PERFECTLY FITS YOUR CRAFTING NEEDS!
  • HIGH-QUALITY TEMPLATE: PRECISION CUT FOR FLAWLESS DESIGNS.
  • IMPORTED FROM JAPAN: SUPERIOR CRAFTSMANSHIP YOU CAN TRUST!
BUY & SAVE
$13.91
Makita 193264-4 Template Guide, 3/8-Inch
5 11PCS Geometric Drawings Templates, Drafting Stencils Measuring Tools, Transparent Green Plastic Ruler, for Architecture, Office, Studying, Designing

11PCS Geometric Drawings Templates, Drafting Stencils Measuring Tools, Transparent Green Plastic Ruler, for Architecture, Office, Studying, Designing

  • DURABLE, LIGHTWEIGHT TEMPLATES FOR EFFORTLESS CREATIVITY!

  • 11 VERSATILE TEMPLATES PERFECT FOR ART, DESIGN, AND LEARNING!

  • CUSTOMER SATISFACTION GUARANTEED-100% QUALITY ASSURANCE!

BUY & SAVE
$10.99 $11.97
Save 8%
11PCS Geometric Drawings Templates, Drafting Stencils Measuring Tools, Transparent Green Plastic Ruler, for Architecture, Office, Studying, Designing
6 Mr. Pen- House Plan, Interior Design and Furniture Templates, Drafting Tools and Ruler Shapes for Architecture - Set of 3

Mr. Pen- House Plan, Interior Design and Furniture Templates, Drafting Tools and Ruler Shapes for Architecture - Set of 3

  • VERSATILE TEMPLATES FOR PRECISE ARCHITECTURAL DESIGNS AND PLANS.
  • DURABLE, FLEXIBLE MATERIALS ENSURE LASTING QUALITY AND USABILITY.
  • COMPREHENSIVE KIT FOR EFFICIENT HOME AND INTERIOR DESIGN PROJECTS.
BUY & SAVE
$7.95
Mr. Pen- House Plan, Interior Design and Furniture Templates, Drafting Tools and Ruler Shapes for Architecture - Set of 3
7 Pacific Arc All Purpose Template Guide, Featuring A Protractor, 4 Inch Ruler, French Curves, and Standard Shapes

Pacific Arc All Purpose Template Guide, Featuring A Protractor, 4 Inch Ruler, French Curves, and Standard Shapes

  • VERSATILE TEMPLATE WITH PROTRACTOR, RULER, AND VARIOUS SHAPES.
  • COMPACT 3X6 SIZE FITS EASILY IN ANY WORK BAG.
  • HIGH-QUALITY, TRANSLUCENT PLASTIC ENSURES PRECISION IN ART.
BUY & SAVE
$5.94
Pacific Arc All Purpose Template Guide, Featuring A Protractor, 4 Inch Ruler, French Curves, and Standard Shapes
8 Mr. Pen Circle Templates - Large & Small Sizes, Circle Stencil & Ruler for Drafting & Drawing

Mr. Pen Circle Templates - Large & Small Sizes, Circle Stencil & Ruler for Drafting & Drawing

  • DURABLE, TRANSPARENT PLASTIC FOR LONG-LASTING CIRCLE DRAWING.
  • VERSATILE SIZES FROM 0.0625 TO 3.5 FOR ALL YOUR PROJECTS.
  • RULER MARKINGS INCLUDED-NO NEED FOR EXTRA TOOLS! PORTABLE DESIGN!
BUY & SAVE
$5.99
Mr. Pen Circle Templates - Large & Small Sizes, Circle Stencil & Ruler for Drafting & Drawing
9 Angrox Geometric Drawings Templates Measuring Geometry Rulers 15 Pcs with 1 Pack File Bag for Design School Studying Office Building…

Angrox Geometric Drawings Templates Measuring Geometry Rulers 15 Pcs with 1 Pack File Bag for Design School Studying Office Building…

  • VERSATILE 11PCS TEMPLATES & TOOLS FOR PRECISION EVERYWHERE!
  • DURABLE, FLEXIBLE DESIGN ENSURES LONGEVITY AND CLARITY!
  • 100% SATISFACTION GUARANTEE WITH PROMPT CUSTOMER SUPPORT!
BUY & SAVE
$15.99
Angrox Geometric Drawings Templates Measuring Geometry Rulers 15 Pcs with 1 Pack File Bag for Design School Studying Office Building…
+
ONE MORE?

Partials in October CMS templates are a way to reuse sections of code that are used in multiple template files. They allow for modularity and abstraction in the template structure, making it easier to change and maintain the code.

To use partials in October CMS templates, you can follow these steps:

  1. Create a partial file: Start by creating a partial file with the extension .htm. This file will contain the reusable section of code. The file can be named based on its purpose or functionality.
  2. Place the code in the partial: Open the partial file and add the HTML, PHP, or Twig code that you want to reuse. This can include variables, loops, conditionals, or any other valid template code.
  3. Include the partial in a template file: To include the partial in a template file, use the {% partial %} tag. Inside this tag, specify the name of the partial file without the file extension. {% partial "name-of-partial" %}
  4. Pass data to the partial: If you need to pass data from the template file to the partial, you can use the with keyword followed by the data you want to pass. This data can be variables, arrays, or any other valid data type. {% partial "name-of-partial" with dataVariable %}
  5. Render the partial inside a specific block: If you want the partial to be rendered inside a specific block, you can use the {% placeholder %} tag in the template file. This allows you to define the location where the partial should be rendered. {% placeholder 'blockName' %}
  6. Use the {% content %} tag: In the specific block where you want the partial to be rendered, use the {% content %} tag. This will output the contents of the partial in that location. {% content 'blockName' %}

By utilizing partials in October CMS templates, you can easily reuse code across different pages and components of your website, enhancing maintainability and flexibility in your template structure.

How to use partials in October CMS templates?

To use partials in October CMS templates, follow the steps below:

  1. Create a partial - A partial is a reusable piece of code that can be included in multiple templates. To create a partial, navigate to the partials directory under your theme or plugin directory. Create a new PHP file with a .htm extension, for example, _header.htm.
  2. Add HTML code to the partial - Add the HTML code that you want to reuse across multiple templates in the partial file. For example, you can add the header HTML code in the _header.htm file.
  3. Include the partial in a template - To include the partial in a template, use the following syntax: {% partial "partialname" %}. Replace partialname with the actual name of your partial. For example, to include the _header.htm partial in a template, use {% partial "_header" %}.
  4. Pass variables to the partial - You can pass variables to the partial by passing them as parameters in the partial tag. For example: {% partial "partialname" with { variableName: variableValue } %}.
  5. Reuse the partial in other templates - You can now include the same partial in other templates by using the {% partial %} tag with the appropriate partial name.

Note: Partials can also include dynamic content using components and component properties. You can add components to the partial file and set properties as needed.

The recommended way to handle translation within a partial in October CMS is to use the built-in localization features provided by the Laravel framework. October CMS is based on Laravel and inherits its localization capabilities.

To translate text within a partial, you can use the __ or trans helper functions. These functions allow you to specify a key or translation string and will return the translated value based on the current locale set in your application.

Here's an example of how to use the __ helper function within a partial:

In the above example, the text "Hello, :name" will be translated based on the current locale. If the current locale is set to English, the translated value will be "Hello, John".

You can also use the trans helper function in a similar way:

Both __ and trans helper functions are interchangeable and achieve the same result. It's recommended to use the one that you find more readable or consistent with your coding style.

To create translation files for your app, you can use the locales directory in your plugin or theme folder. Inside the locales directory, you can create separate files for each language you want to support, such as en.yaml for English and fr.yaml for French. These translation files should contain key-value pairs mapping the translation keys to their translated values.

Once you have your translation files set up, you can switch the current locale in October CMS by using the setLocale method provided by the App facade:

use Illuminate\Support\Facades\App;

App::setLocale('fr'); // Set the locale to French

By following these practices, you can ensure that translation within a partial is handled properly in October CMS.

How to nest partials within other partials in October CMS templates?

To nest partials within other partials in October CMS templates, you can follow these steps:

  1. Define the parent partial: Create a new partial file (e.g., _parent.htm) in the themes/[your-theme]/partials directory or any relevant directories.

  2. Place the child partial within the parent partial: In the _parent.htm file, use the @partial directive to include the child partial. For example:

    Parent Partial

    @partial('child')

  3. Define the child partial: Create another partial file (e.g., _child.htm) in the same directory or in a different directory, as required.

  4. Incorporate the child content within the child partial file.

  5. Use the parent partial in your template file: Use the @partial directive to include the parent partial in your template file (e.g., page.htm).

    @partial('partials/parent')

That's it! Now, when you render your template file, the child partial will be included within the parent partial. Remember to adjust the file paths accordingly based on the organization of your partial files.

What is a partial in October CMS templates?

In October CMS, a partial is a reusable snippet of code that can be included in multiple templates. It allows you to keep certain parts of your templates separate and organized, making it easier to maintain and update your site.

A partial can include HTML, PHP, or any other supported code. It can be used to represent a specific section, module, widget, or any other distinct piece of functionality within a template.

By using partials, you can avoid duplicating code and improve code reusability. For example, if you have a header section that is present on every page of your website, you can create a header partial and include it in all your templates. If you later need to make a change to the header, you only need to modify the partial file, and the change will be reflected on all pages that include it.

Partials in October CMS provide a way to separate concerns and modularize the code, promoting better organization and maintainability in your templates.

What is the difference between a partial and a snippet in October CMS?

In October CMS, the terms "partial" and "snippet" are often used interchangeably, but there are some subtle differences in their usage and purpose:

  1. Partial: A partial in October CMS refers to a reusable code block that contains HTML, PHP, and other content. It is typically used to break down a larger codebase into smaller, manageable parts. Partials are commonly included and rendered within other template files using the {% partial %} tag. They can be used to handle repetitive sections or common elements like headers, footers, or sidebars across multiple pages.
  2. Snippet: A snippet in October CMS refers to a self-contained, reusable code block that is entirely independent and contained within its own file. Snippets are typically used for creating reusable content sections or functionalities like forms, widgets, or interactive components. Snippets are designed to be easily reusable and can be included in pages by using the {% snippet %} tag or by dragging and dropping snippets into the CMS backend.

In summary, both partials and snippets provide a way to break down complex code into smaller, more manageable units, but partials are more commonly used for dividing and organizing templates, while snippets are specifically designed to be reusable and self-contained components.