active language check

{% if activeLocale == ‘de’ %} {% component ‘staticMenuDE’ class=”nav navbar-nav navbar-right” %} {% else %} {% component ‘staticMenuEN’ class=”nav navbar-nav navbar-right” %} {% endif %}

october cms – page url

<a href=”{{ ”| page }}”>Current page with current filter slugs</a> <a href=”{{ ”| page(false) }}”>Current page without any filter slugs (except default value)</a> <a href=”{{ ”| page({ filter_slug:slug_var, filter_id:id_var }) }}”>Current page with needle filter slugs</a>  

octobercms: bootstrap carousel

{% set id = random(999999) %} <div class=”carousel carousel-{{id}} slide ock-carousel” data-ride=”carousel” {% if interval is defined %}data-interval=”{{interval}}”{% endif %}> {% if indicator is not defined or indicator == true %} <ol class=”carousel-indicators”> {% for bild in bilder %} <li Read more…

october cms: basic seo

within the layout/theme: <title>{{ }}</title> <meta name=”title” content=”{{|default( }}”> <meta name=”description” content=”{{}}”> <meta name=”keywords” content=”{{}}”> inside the component: $this->page->title = “abc”; $this->page->meta_description = “abc”; $this->page->meta_keywords = “abc”;  

maplace.js – simple map with markers

Maplace.js is a library for google maps. This snippet creates a map creates 2 marker applies some “style” to this map <div id=”map” style=”height: 300px”></div> <script src=”” integrity=”sha256-BbhdlvQf/xTY9gja0Dq3HiwQF8LaCRTXxZKRutelT44=” crossorigin=”anonymous”></script> <script src=”” async defer></script> <script src=”maplace.min.js”></script> <script> function initMap() { Read more…

october cms: relations

Resources: Example: This is a (hopefully correct) working example of a 1 to n relation. // product model public $hasMany = [ ‘variants’ => [‘\Acme\Namespace\Variant’], ]; // variant model public $belongsTo = [ ‘product’ => [‘\Acme\Namespace\Product’], ]; public Read more…

october cms themes

Resources: Basic Layout: Here is a sample structure of a october theme. the layout file combines the header and the footer into a working layout, which can be used for pages. layout_header.htm <!doctype html> <html class=”no-js” lang=”de”> <head> Read more…