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 June 2026

1 Tamaki Circle Template Measuring Geometry Ruler Geometric Drawings Stencils Rulers Scale Drafting Digital Drawing Set for Office and School Building Formwork Drawings Templates, 2 Pack

Tamaki Circle Template Measuring Geometry Ruler Geometric Drawings Stencils Rulers Scale Drafting Digital Drawing Set for Office and School Building Formwork Drawings Templates, 2 Pack

  • CREATE PROFESSIONAL GEOMETRIC PATTERNS WITH EASE AND PRECISION.
  • DURABLE PLASTIC DESIGN ENSURES LONG-TERM USE AND RELIABILITY.
  • VERSATILE FOR ART, MATH, ARCHITECTURE, AND EVERYDAY PROJECTS!
BUY & SAVE
$5.99
Tamaki Circle Template Measuring Geometry Ruler Geometric Drawings Stencils Rulers Scale Drafting Digital Drawing Set for Office and School Building Formwork Drawings Templates, 2 Pack
2 4 Pcs Drawing Template Drafting Stencil Ruler Circle and Oval Templates Plastic Drawing Measuring Rulers Geometric Drawings Stencils for Office and School Building Formwork Drafting Tool (Green)

4 Pcs Drawing Template Drafting Stencil Ruler Circle and Oval Templates Plastic Drawing Measuring Rulers Geometric Drawings Stencils for Office and School Building Formwork Drafting Tool (Green)

  • DURABLE, FLEXIBLE PLASTIC ENSURES LONG-LASTING USE WITHOUT BREAKING.
  • VERSATILE TOOLS FOR ARCHITECTS, STUDENTS, AND ARTISTS IN ANY SETTING.
  • COMPLETE SET OF 4 TEMPLATES MAKES DRAWING EASY AND PRECISE!
BUY & SAVE
$5.97
4 Pcs Drawing Template Drafting Stencil Ruler Circle and Oval Templates Plastic Drawing Measuring Rulers Geometric Drawings Stencils for Office and School Building Formwork Drafting Tool (Green)
3 Tamaki Circle Template Circle Round Stencil Templates for Drafting for Office and School Building Formwork Drawings Templates, Large and Small Size, 3 Pack

Tamaki Circle Template Circle Round Stencil Templates for Drafting for Office and School Building Formwork Drawings Templates, Large and Small Size, 3 Pack

  • DURABLE PLASTIC TEMPLATES FOR LONG-LASTING, CONVENIENT USE.
  • VERSATILE FOR SKETCHING, DRAFTING, AND VARIOUS DESIGN PROJECTS.
  • IDEAL FOR ARCHITECTURE, MATH, ART, AND SCHOOL LEARNING NEEDS.
BUY & SAVE
$6.99
Tamaki Circle Template Circle Round Stencil Templates for Drafting for Office and School Building Formwork Drawings Templates, Large and Small Size, 3 Pack
4 Mr. Pen- House Plan, 3 pcs, Interior Design and Furniture Templates, Clear Flexible Plastic, Drafting Tools, Ruler Shapes for Architecture, 1/4 Inch Scale, Kitchen, Bath, Bedroom, Office, Living Room

Mr. Pen- House Plan, 3 pcs, Interior Design and Furniture Templates, Clear Flexible Plastic, Drafting Tools, Ruler Shapes for Architecture, 1/4 Inch Scale, Kitchen, Bath, Bedroom, Office, Living Room

  • COMPLETE 3-PC SET FOR PRECISE ARCHITECTURAL AND INTERIOR DESIGNS.
  • DETAILED SYMBOLS FOR COMPREHENSIVE HOUSE PLANNING AND LAYOUT.
  • DURABLE, FLEXIBLE TEMPLATES IDEAL FOR PROS AND DIY PROJECTS ALIKE.
BUY & SAVE
$7.95 $13.99
Save 43%
Mr. Pen- House Plan, 3 pcs, Interior Design and Furniture Templates, Clear Flexible Plastic, Drafting Tools, Ruler Shapes for Architecture, 1/4 Inch Scale, Kitchen, Bath, Bedroom, Office, Living Room
5 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 11PC TEMPLATE SET: PERFECT FOR ARTISTS, DESIGNERS, AND STUDENTS.

  • PRECISION MEASUREMENT: METRIC RULER ACCURACY DOWN TO 1MM FOR DETAILED WORK.

  • DURABLE & CLEAR DESIGN: FLEXIBLE PLASTIC ENSURES LASTING USE AND READABILITY.

BUY & SAVE
$12.35 $15.99
Save 23%
Angrox Geometric Drawings Templates Measuring Geometry Rulers 15 Pcs with 1 Pack File Bag for Design School Studying Office Building…
6 4PCS Plastic Circle and Oval Templates - Clear Green Measuring Templates for Drawing and Formwork Projects

4PCS Plastic Circle and Oval Templates - Clear Green Measuring Templates for Drawing and Formwork Projects

  • COMPREHENSIVE SET OF 4 STENCILS MEETS ALL ARTISTIC NEEDS EFFORTLESSLY.
  • DURABLE CONSTRUCTION ENSURES PRECISION-WON'T WARP OR BEND EASILY.
  • VERSATILE FOR ALL SKILL LEVELS-PERFECT FOR ANY DESIGN PROJECT!
BUY & SAVE
$5.79
4PCS Plastic Circle and Oval Templates - Clear Green Measuring Templates for Drawing and Formwork Projects
7 Makita 193263-6 Template Guide, 1/2-Inch

Makita 193263-6 Template Guide, 1/2-Inch

  • COMPACT SIZE: PERFECT FOR CONVENIENT STORAGE AND PORTABILITY.
  • UNIQUE JAPANESE DESIGN: ELEVATE YOUR PROJECTS WITH PREMIUM CRAFTSMANSHIP.
  • VERSATILE USE: IDEAL FOR CRAFTS, DIY, AND PROFESSIONAL PROJECTS.
BUY & SAVE
$9.40 $11.09
Save 15%
Makita 193263-6 Template Guide, 1/2-Inch
8 15PCS Geometric Drawings Templates, Measuring Geometry Rulers, Drafting Stencils Measuring Tools

15PCS Geometric Drawings Templates, Measuring Geometry Rulers, Drafting Stencils Measuring Tools

  • DURABLE MATERIALS ENSURE PRECISION FOR ALL YOUR DRAWING PROJECTS!
  • INCLUDES 11 SHAPES & 4 TOOLS FOR VERSATILE CREATIVE POSSIBILITIES.
  • METRIC MARKINGS PROVIDE ACCURATE MEASUREMENTS FOR STUNNING DESIGNS.
BUY & SAVE
$12.59
15PCS Geometric Drawings Templates, Measuring Geometry Rulers, Drafting Stencils Measuring Tools
9 Makita 193264-4 Template Guide, 3/8-Inch

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

  • COMPACT SIZE: PERFECT FOR CREATIVE PROJECTS ANYWHERE!
  • UNIQUE JAPANESE DESIGN: ELEVATE YOUR CRAFTING WITH QUALITY!
  • VERSATILE TEMPLATE STENCIL: IDEAL FOR VARIOUS ART APPLICATIONS!
BUY & SAVE
$13.91
Makita 193264-4 Template Guide, 3/8-Inch
+
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.