Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6778133
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T16:13:51+00:00 2026-05-26T16:13:51+00:00

In client side ejs I use [% code %] instead of <% code %>

  • 0

In client side ejs I use [% code %] instead of <% code %> to mark ejs code, but I would like to do the same on the server side with express. On the client side I would do something like var template = new EJS({text: template_src, type:'['});

Here is my node code:

app.set('view engine', 'ejs');
app.register('.html', require('ejs'));

app.get('/', function(req, res){
    res.render('index.html', { title: 'My Site' });
});

Where do you set the “type” paramater so I can change this option

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T16:13:52+00:00Added an answer on May 26, 2026 at 4:13 pm

    From the EJS github page:

    Custom tags can also be applied globally:

    var ejs = require('ejs'); ejs.open = '{{'; ejs.close = '}}';
    

    The only thing you need to do it copy these lines at the beginning of your Express app and that’s that – the change is applied globally (change the open and close tag to whatever you want).

    Update for most recent version as of July 20, 2016

    As of most recent versions of EJS, it is not possible to use custom tags anymore (see https://github.com/mde/ejs/issues/55 ). All you can do is change delimiters from default % to others ( delimiter option ).
    There are talks about re-enabling this. See https://github.com/mde/ejs/issues/88 and https://github.com/mde/ejs/issues/115

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Learning client side code of an existing site, would like to understand some activity
Client side javascript code creates some elements (about 50-100) in a cycle: for (var
I try to add client side validation using this line of code: @Html.EnableClientValidation() But
Client side rendering is useful when we want to use wiki like syntax. Unfortunately
I am currently invoking client-side functions and server-side functions from the same button click
Silverlight works on client side so putting any sensitive data like connection strings, passwords
I have some client side code that uploads an Outlook email to a document
From client side, I need to call a server method that is not static.
For my client side development I use MooTools primarily, I have also just recently
Does SVN have client-side hook support like in TortoiseSVN ? I need a hook

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.