Twig Questions
Ad
Ad
October cms use curly brackets in twig markup
If you want to add markup which is having word with double curly brackets it will simply not work directly in the markup. 'you need to escape curly brackets'.
october cms extend custom twig markup
Add custom twig markup to October cms. add function, filter , test, and much more to Octobercms twig markup.
How do I print a result of JS function inside a twig loop
i have two twig variables. i need to pass them to my js function traveltime()and return result in html-tag. here is code. it is not
Display a switch by a flag
I need to display a switch if a flag in my database is setted to a positive value. <div class="form-group m-form__group row
Dynamically generate / omit HTML attribute in Twig
I want to generate a div with a specific html attribute present or absent in it, in function of if a variable my_var has been defined
Change Twig Loader order
So i've created a few twig loaders in my project for templates stored in databases. simply having them implement loaderinterface already
Displaying background image dynamically from database in twig
I am using laravel and trying to make it possible for users to change the background image of their page using an update form. they upload a pic
Access symfony form widget value by id using javascript
I am using symfony 3 generated forms. in order to validate the form i want to access the form widget value (text inputs in html) using javascript.
use twig variable in JS
(hey!) i try to use a twig variable in my js file, i tried the way mentionned
How to edit / remove `show all` view in isotope library?
There are two others topics about this, but they don't help me. i have this html: <div
Getting correct product link within WooCommerce loop when using Twig and Timber
I have customised some of the woocommerce templates and i am using the twig templating system as well as timber. on the category pages i
How to stop a class being added to an element if other elements have that class?
I have a slider that runs on a timer with buttons left and right that also move the slider. the slider works by using jquery to add an
Ad
Display a custom hook in the Back Office in Prestashop 1.7
I am trying to display some content in the default product table of prestashop. i already managed to override the twig template {% extends
add custom button on customer view twig using custom module in prestashop?
Firstly, i tried all the questions & answers related to this topic. additionally and i tried related questions and try to solve it but no
Timber Twig template - sticky post doesn't just push to top of list, it adds extra teaser to the page
I have code (below) which adds 12 post/page: 6 with a partial template that makes those 6 bigger; and 6 that get a template making those smaller -
Get js variable transpiled by Symfony4 Webpack Encore in twig / FosJsRouting bundle
I use fos_js_routing bundle on symfony4 . i need to get the routing object reachable in my twig view. i defined routing in assets/js/app.js, a
Using React in not-react website
I have a project where all the views renders by the server using twig template engine. so i write all my scripts inside the
How to properly get a parameter send using ajax in a Symfony controller (annotation)?
I have been struggling for the past 2 days and none of the answer i've find so far on the internet have helped me so far. i'm trying to
check existence of twig template in Timber
Is there a way in timber to check to see if a twig template exists before attempting to render one? i have seen so answers for how to
How do I display 3 recent posts in footer with Timber?
So, i am beating my head over this for 2 days now. how do i display 3 recent posts in footer using timber and twig? i am using a starter theme
Array to string conversion, Php to js
Hello guys i am trying to pass an array to a js file but i have this error : an exception has been thrown during the
Set twig variable in js - Symfony 3.4 - JS
Hello guys i am creating a form that works really well but when i want to set the localisation of the place but now i have to set it manually
Access a nested (grouped by) Laravel collection in Twig
I have a collection like this: how do i access/display the collection in twig. the original collection worked fine with the code below. then i
Ad
Making titles of posts appear on mouseover/hover while image rolls up
So, i have a div flex which takes 3 posts from wordpress using custom fields and twig. i get the images,
Logic Exception: must return a relationship instance
I am trying to use the following functions to display a stock level flag on using a twig view template. but i am getting the following error:
Include script only once
I am building some twig modules that require specific javascript to work. a javascript file is an asset that can be included as
Multiple items in bootstrap carousel `carousel-item` using Twig/Timber/Wordpress and Bootstrap 4
What i want is that each carousel-item hold card group with 3 cards inside .. so .. in this particular case, there are 8 related
WordPress Timber/Twig Classic Editor not breaking lines
I've got an issue with line breaks here in wordpress. i'm using timber/twig and classic editor plugin. the wyiwigs are created with
Timber + ACF - How to get get_row_index() working?
Problem: i would need to get the current layout index from flexible content field. acf already have built-in functionality for
Custom php file directory in Wordpress with Timber Twig
I am using timber with wordpress (version 5.4.2). i have installed timber's
timber/twig how to pass `posts` php-object to JavaScript? Some values are lost
When i'm trying to pass the information contained in {{posts}} i cannot retrieve all of it, at least not the post.link
String concatenation with Twig
This is not a major problem but there is a better way to concatenate a string like this one : {{ "© " ~
Javascript variable in a twig asset
I would like to use a document variable in a twig asset like this: var imgname="helloworld.png";
Issue with Post Object Timber/Twig WordPress
I have an acf field, it's a repeater, and inside the repeater is a post object. controller /* template
Ad
Timber Twig add class to ancestor menu item when page is not in menu
I have a menu with 2 sub-levels: /news/current-news/ - at the 'current-news' level, the top 'news' list item correctly picks up a
Out putting RAW ACF values in twig/timber unto page header for SEO purposes
So, from acf i have created my own seo fields in my custom wp theme, so i don't have to rely on a plugin, and i want to have the default values
WordPress ACF Repeaters with Timber/Twig
Looked around the google a lot but couldn't find the solution. i'm new to twig/timber but i have a lot laravel experience so it's similar but i'm
Wordpress menu item descriptions into Timber Twig template
I've enabled menu item descriptions in the wordpress menu screen options and added descriptions to a few menu items. does anyone know how
Add stylesheet to the starter theme
What is the proper method for adding a stylesheet to the timber starter theme for wordpress? i would normally enqueue my stylesheet in
Any way to make a grid style list in twig templates?
I'm trying to make a 3x3 grid of a template made in twig for wordpress, i'm using a for to show a media player for every episode that
Timber Pagination: page.php / not showing up
In the timber for wordpress docs (link) they say
Twig adding "%0A" to imagepath (Email-Template)
I am havin problems with some image urls generated partly through twig. here is how i am currently doing it: {% autoescape false
Use a twig filter in template_from_string function
I am creating a multilingual website with october cms, using rainlab translate and vojta svoboda twig extensions plugins. i'm
Make translation fixed in html twig template - symfony
I have this part of code in my twig template: {{ 'find.cars.back'|trans({'%url%': path('find_index')})|markdown }}
Replacing Blade with Twig in Laravel 5
I am attempting to swap out laravel's native blade templating for symfony's twig
Ad
ReactJS - Unexpected "`"
I want to use this react grid: http://codepen.io/anon/pen/yoebyw
How to add a require_once('file.php') statement in twig templates?
I'm new to this symfony2 and twig so i'm not very familiar with it. i need to add a require_once(file.php) into a mytemplate.html.twig but i just
Using Moment.js with Twig
I am using moment.js with twig for calculating time ago, code
RainLab.Blog Post List: List Sub-Categories under a specific Top-Level Category
I'm working on an october cms project which use a blog where i need to seperate blog posts in two major categories. when listing blog posts using
Using Twigbridge in a Laravel 5.1 Package
I'm trying to create a laravel 5.1 package which uses twigbridge instead of .php views. i can get normal
How to exclude a known category from a blog list using Twig and October CMS
I'm trying to exclude a known category from my blog list, as i have a special widget for it elsewhere on my page and want to avoid my articles
OctoberCMS Get URL to CMS page
In october cms, you can easily create a link to a cms page in a twig template with
Symfony - display file stored outside public
Is there a possibility to display file in twig template when the the file is not stored inside public directory? like call controller which would
Multiple forms in Symfony. Display works but multiple persist
I have a page with forms in hiddens modals. forms come from the same entity with different ids. displaying the modal works. for each modal i want
Symfony display form errors of form created on rendered controller
I'm rendering controller emailcontrooler /** * @route("/email", name="email") */ function insertemailaction(request $request)
ManyToMany relation: data correctly saved but cannot be shown : categories is empty?
In a manytomany relation (advert and category), the database is filled with the data, but i get this error when i try to show the result in twig,
Ad
Eloquent Relationship returning but not giving me the attributes
The eloquent relationship i have defined is returning the belongsto object but not actually giving me access to any of the attributes that should
Is it possible to replace the twig language format of {% %} to: {%- -%}?
{%- -%} is a whitespace delimiter in shopify liquid. i am trying to edit the default emmet function in phpstorm's twig language to
OctoberCMS set param in configuration section of template
I'm trying to render a conditional form to a twig template in octobercms... [renderform] formcode = "contact-form" == {%
How do I add a Twig test in October CMS?
This is working well in my registermarkuptags function. 'functions' => [ 'isnumeric' =>
Can we limit the if condition in for loop?
Can i bring for example only 12 contents in a for loop that satisfy the condition i want? {% for i, a in b %} {% if
Twig template JSON to something readable
I use october cms and trying to extend some futures on one of the modules. i have settings column in my db, that have several fields. but
Octobercms twig how to show upcoming birthdays
My birthdays are stored with: {{ user.profile.dob }}, and i would like do display the birthday of users within the next 30 days. here is my
October CMS | Creating a portfolio with 'show more' but struggling with twig
What i would like to achieve is, when there are more than 6 items, the remaining items go into the 'show more' section automatically.
How can I render title attribute in img tag conditionally?
I'm trying to render a title attribute in an html image tag conditionally with twig (in october cms). i tried following with
Pass on multiple arrays in October CMS
I have a list in october cms like this: <ul> <li {% if this.page.id=='some-id' %} class = "active" {% endif
How to get the SUM of a column based on the common value(id) in other column in octobercms
I get stuck here. hope someone can help. i have a database that store the purchase done users on any project. here is my table in twig
Ad
How to access markup twig variable from code in OctoberCMS
I'm trying to access variable from markup (twig) in octobercms code module. this variable is printed in loop by plugin builder. i have
How can I order by date using Twig for within seperate blocks with date fields within a matrix field?
For example i have a property matrix with 2 fields. buy and rental. within buy and rental i have a date field as well as various other
Cannot use a scalar value as an array - PHP Octobercms
I had this working before but no it doesn't. i have an array in my model, in a component i call the array and try to set as a page variable but
Can I pass a dynamic value from craft CMS to another template as well as a string value?
Can i pass a dynamic value from craft cms using twig to another template as well as a string value? using the following gives me a syntax error
How to display attachMany images in frontend in Octobercms?
This should be pretty straight forward but cant figure out what is missing. i am trying to display attachmany in front-end but it is not working.
Passing variable to Octobercms blogPosts component
On octobercms blogposts component i want to pass a variable. i want to change postsperpage value using: {variable
How can i populate select box with options in octobercms
I have this in my controller $this['item'] = cat::where('parent_id',0)->pluck('cat_title'); and this in
How can I display results in bootstrap grid in octobercms?
I have this right now in my octobercms code to display results. it currently displays it in a list but i want it in bootstrap grid of 3 equal
October CMS- Language Picker Component Twig
I am trying to add flag icons for languages to my options in for loop. so far, i got this: {{ form_open() }} <select
How to check if page property exists in OctoberCMS layout template
In layout, checking page property with is defined produces an error like "call to undefined method october
ainhalcyonuilder::meta_description()", when
OctoberCMS, comparing a record string to a string
I'm attempting to clean up my titles in my october cms project and i'm running into an issue. i have a set of pages set to be "singles" and thus have the title
Ad
How to convert a Twig array into JavaScript array
I have a twig array and i want to send it to javascript: <script> var packages = {{packages}} </script>
How can I check multiple if conditions in twig?
How can i check multiple if conditions in twig? neither of these seem to work also they all seem a but messy and heavy. {% if pageclass != "page-home" %}
How to return only articles that has translations inside Twig template, Rainlab.Translate module
I am using rainlab.translate plugin in my website and have two languages en and ka (english and georgian languages). also i
Using array variables in page filter
This is the code <a href="{{ 'questions' | page({filter[search] : 1}) }}">{{category.name}}</a> it should generate an url
Access Twig Variable in OctoberCMS Javascript file
I am using octobercms which is based in laravel framework and i set variable in my html file {% set name = 'juan' %} and i am trying to access it in my
October CMS and navigation on current page
I am trying to get the basically the active class applied to the current page. as it goes, the builder plugin is setting the url through: <a href="{{
How can I display the image from the related entry for each entry in craft CMS and twig?
I have a a list of entries. each entry has a related person. each related person has an avatar. on my index page i am looping over the entries and creating a
How can I add a class, id or attribute to a twig include?
I am working on a project that uses twig. each page uses {% extends "_layouts/_master" %} inside the _layouts/master there is a body tag
How to pass collection filtered by Ajax in October CMS
In october cms i have page which uses my component: title = "products" url = "/filter-products/:category_slug?" layout = "default" is_hidden = 00
Octobercms - Order frontend list by page variable (variable not on database)
So i'm trying to create a leaderboard with frontend user data on octobercms, the leaderboard will be based on the sum of variables that are currently in the database. i've
twig thumbnail - set relative offset
I'm using octobercms and my thumbnail gallery is generated this way: <img src="{{ image.thumb(250, 250, {mode:'crop', offset: [0,100]} ) }}">
Ad
OctoberCMS, how to sort order of the records data set (json structure) by option from previous page?
Is anyone know how to sort order of this records data set by value from previous page? eg. 1st page (previous page):
Can i pass php variables when including a partial?
I am new to octobercms so i don't know a lot of things. i read the october documentation and i know how to pass variables when using partials in the static way:
How to add pagination in a list on a frontend view?
In octobercms, how do i paginate a list with hundreds of items and display pagination elements?
Twig error saying "Expected tag name. Got something else instead"
I am using octobercms and inside one of my layout files, i have put below code. {% set i = 0 %} {% for photo in
Twig iterate/read and get value - Octobercms
Hi guys its rather a very basic question, had chance to look several questions on stackoverflow but all in vain. so i have this twig variable called
Twig templating for variables and filters
Having problems with correct output in october cms twig: using - <img src="{{ asset('assets/img/flag-'~code~'.png'|theme) }}" class="flag">
Filter items by category in Laravel October
I have a document model with a $belongsto categories relationship, everything is working well and i'm able to assign categories to documents and list them all on the
How to call 2 Functions at the same time using Twig AJAX Form?
I'm using octobercms based on laravel and
OctoberCMS: Trigger events doesn't work
After reading this (and others...) article (link) on documentation i could not find an
How to reload page after post
I'm currently creating a form on a page in octobercms that executes a php code block. html/twig: {{ form_open({ request: 'onhandleform' }) }}
Laravel displaying information in {% content %}
Have problem to display content block information {% content 'structurated/'this.page.filename %} this returns an error. if i remove
Ad
Accessing third level menu in Static Pages via twig.
I have a dropdown menu which uses the static pages menu to generate the navigation. how do i reference third level items? here is a picture explaining a typical
Twig loader crushes with October CMS
When i start fresh october project it says: class system wigloader contains 1 abstract method and must therefore be declared abstract or implement
Ad
Blog Categories
Ad