Jan 01
October cms use curly brackets in twig markup
October cms is using twig
as its templating language and in twig, you can access variables and other details using {{ }}
double opening curly brackets and ending double curly brackets.
So, now 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
.
Fortunately, it's really easy. you just make your word in string
so TWIG will treat it as a string
and do not parse/interpolate
it.
Check below example how to user string markup
<div id="id01">
{{ '{{firstName}} {{lastName}}' }} // <- HERE
</div>
<script>
var myObject = {"firstName" : "John", "lastName" : "Doe"};
w3.displayObject("id01", myObject);
</script>
{{ '{{firstName}} {{lastName}}' }}
-> it will output {{firstName}} {{lastName}}
in final html and you can show it or use it on your wensite
Ad
Related Questions
- → OctoberCMS Backend Loging Hash Error
- → "failed to open stream" error when executing "migrate:make"
- → OctoberCMS - How to make collapsible list default to active only on non-mobile
- → Create plugin that makes objects from model in back-end
- → October CMS Plugin Routes.php not registering
- → OctoberCMS Migrate Table
- → How to install console for plugin development in October CMS
- → OctoberCMS Rain User plugin not working or redirecting
- → October CMS Custom Mail Layout
- → October CMS - How to correctly route
- → October CMS create a multi select Form field
- → How to update data attribute on Ajax complete
- → October CMS - Conditionally Load a Different Page
- → How to disable assets combining on development in OctoberCMS
Ad