Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

124
Views
W3.JS Display HTML Data {{variable}} in Octobercms Page or Partial

please help me with October CMS Code - Page or Partial, how to use them with W3.JS.

W3.JS Display HTML Data {{variable}} in Octobercms

{{ }} this transcription use OctoberCMS for your own data

But W3.JS Display HTML Data use the same transcription

https://www.w3schools.com/w3js/w3js_display.asp

<div id="id01">
{{firstName}} {{lastName}}
</div>

<script>
var myObject = {"firstName" : "John", "lastName" : "Doe"};
w3.displayObject("id01", myObject);
</script>

it doesn't work

thank you for your help

Vasek

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

Wrap the JavaScript template part in verbatim filter: https://twig.symfony.com/doc/3.x/templates.html#escaping

about 4 years ago · Juan Pablo Isaza Report

0

It's very simple you just make it string so TWIG will treat it as a string and do not parse/interpolate it.

ref: https://tutorialmeta.com/octobercms/october-cms-use-curly-brackets-twig-markup

<div id="id01">
{{ '{{firstName}} {{lastName}}' }}
</div>

<script>
var myObject = {"firstName" : "John", "lastName" : "Doe"};
w3.displayObject("id01", myObject);
</script>

{{ '{{firstName}} {{lastName}}' }} -> it will output {{firstName}} {{lastName}} in final markup

if any doubt please comment

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!