mde / ejs

Embedded JavaScript templates -- http://ejs.co
Apache License 2.0
7.71k stars 846 forks source link

contentFor not working #623

Closed rahulkathet closed 3 years ago

rahulkathet commented 3 years ago

ContentFor() not working when adding inline script tag.

Screenshot 2021-09-05 at 8 56 11 AM Screenshot 2021-09-05 at 8 56 00 AM Screenshot 2021-09-05 at 8 55 50 AM
mde commented 3 years ago

ContentFor is neither JavaScript, nor part of the EJS API. Looks like it's something from Sinatra or Handlebars? Anyhow, it's not EJS. Closing this issue. Please feel free to reopen if there is an actual problem with EJS.

rahulkathet commented 3 years ago

ContentFor is neither JavaScript, nor part of the EJS API. Looks like it's something from Sinatra or Handlebars? Anyhow, it's not EJS. Closing this issue. Please feel free to reopen if there is an actual problem with EJS.

Thank you for the information, just sharing if someone else is looking for a solution.

The issue was with "express-ejs-layouts"

Not working when it is set to "true" sampleapp.set("layout extractScripts", true)

Resolved when set to false sampleapp.set("layout extractScripts", false)