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

  • SEARCH
  • Home
  • 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 7752827
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T11:53:54+00:00 2026-06-01T11:53:54+00:00

So, I just started working with flatironjs and plates . I’m trying to figure

  • 0

So, I just started working with flatironjs and “plates“. I’m trying to figure out how I can have a main layout template and then a partial template that loads content into the main layout template similar to how expressjs does it…

With expressjs there’s the layout.js and perhaps index.js. index.js populates the content area of layout.js. It seems like this would be baked I’m not seeing a way to do this based on the documentation.

  • 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-06-01T11:53:55+00:00Added an answer on June 1, 2026 at 11:53 am

    Main layout template (template.html):

    <h1>This is the main template.</h1>
    <div id="main"></div>
    

    Partial (partial.html):

    <p>This is the partial that should be rendered into the main template.</p>
    

    Then you can do this:

    var fs = require("fs"),
        Plates = require("plates");
    
    // Read the two files from disk
    
    var template = fs.readFileSync("template.html", "utf-8");
    var partial = fs.readFileSync("partial.html", "utf-8");
    
    // Render the partial into main.
    // The data-key in the second param is matched to the id in the template.
    // Plates renders the corresponding value - in this case the contents of
    // partial.html - between the start and end tags with this id.
    
    var rendered = Plates.bind(template, {main: partial});
    

    So console.log(rendered)should give you:

    <h1>This is the main template.</h1>
    <div id="main">
      <p>This is the partial that should be rendered into the main template.
    </p>
    

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

Sidebar

Related Questions

I just started working on Python and have been trying to run an outside
Hi I have just started working with Highstock's javascript charts and was trying to
I just started working using Google Maps API yesterday, and trying to set up
I just started working on a new project and I can't set the build
I have just started working with nodejs. I wonder if there is a way
Hi am just started working on grails.. developed my first application in grails can
I have just started working on an open source project. The project is hosted
Just started working with android and ran into a small problem. I am have
I just started working on alfresco v 3.4. I have created document library action
I just started working with PHP and have managed to run a simple CRUD

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.