FAQ
Hello,

I was wondering what is the best way to serve pages created by merging an HTML layout with contents from a database record.

In my case, I'm using the combination of Node, Express, MongoDB and Mongoose. If a web designer creates a nice layout page (say a user page of an address book, where contents of the user is displayed), what would be the workflow here? In one hand I have read the template and on the other hand I have the user database record. How do I merge the two? I thought of adding placeholders in the layout, like $user_image, $first_name, $last_name, $department, etc. I could then find/replace these placeholders with real data. Is this an acceptable workflow, or is there a simpler way? How are you guys working together with the web designer? I'm very curious about this.

Thanks in advance,

-- Tito

--
Job Board: http://jobs.nodejs.org/
Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

Search Discussions

  • Fent at Mar 4, 2012 at 10:06 am
    Use an unobtrusive templating engine https://github.com/flatiron/plates
    On Sunday, March 4, 2012 2:29:59 AM UTC-7, Tito wrote:

    Hello,

    I was wondering what is the best way to serve pages created by merging an
    HTML layout with contents from a database record.

    In my case, I'm using the combination of Node, Express, MongoDB and
    Mongoose. If a web designer creates a nice layout page (say a user page of
    an address book, where contents of the user is displayed), what would be
    the workflow here? In one hand I have read the template and on the other
    hand I have the user database record. How do I merge the two? I thought of
    adding placeholders in the layout, like $user_image, $first_name,
    $last_name, $department, etc. I could then find/replace these placeholders
    with real data. Is this an acceptable workflow, or is there a simpler way?
    How are you guys working together with the web designer? I'm very curious
    about this.

    Thanks in advance,

    -- Tito
    --
    Job Board: http://jobs.nodejs.org/
    Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
    You received this message because you are subscribed to the Google
    Groups "nodejs" group.
    To post to this group, send email to nodejs@googlegroups.com
    To unsubscribe from this group, send email to
    nodejs+unsubscribe@googlegroups.com
    For more options, visit this group at
    http://groups.google.com/group/nodejs?hl=en?hl=en
  • Jann Horn at Mar 4, 2012 at 11:00 am

    Am Sonntag, den 04.03.2012, 02:05 -0800 schrieb fent:
    Use an unobtrusive templating engine https://github.com/flatiron/plates
    Templating engine is a good idea. However, use mine! :P

    http://search.npmjs.org/#/vacuum

    Well, templating engines are a bit like flow control libraries/tools -
    there's a bunch of opinions on how to do it right, and so there's a lot
    of them.
  • Fent at Mar 4, 2012 at 11:49 am
    Nice. More templating engines should offer streaming.

    But he did mention he's looking for a solution for both programmers and
    designers. With plates there's no special syntax, it's just plain html.
    On Sunday, March 4, 2012 4:00:40 AM UTC-7, Jann Horn wrote:

    Am Sonntag, den 04.03.2012, 02:05 -0800 schrieb fent:
    Use an unobtrusive templating engine https://github.com/flatiron/plates
    Templating engine is a good idea. However, use mine! :P

    http://search.npmjs.org/#/vacuum

    Well, templating engines are a bit like flow control libraries/tools -
    there's a bunch of opinions on how to do it right, and so there's a lot
    of them.
    --
    Job Board: http://jobs.nodejs.org/
    Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
    You received this message because you are subscribed to the Google
    Groups "nodejs" group.
    To post to this group, send email to nodejs@googlegroups.com
    To unsubscribe from this group, send email to
    nodejs+unsubscribe@googlegroups.com
    For more options, visit this group at
    http://groups.google.com/group/nodejs?hl=en?hl=en
  • Jann Horn at Mar 4, 2012 at 6:00 pm

    Am Sonntag, den 04.03.2012, 03:49 -0800 schrieb fent:
    Nice. More templating engines should offer streaming.
    thanks :)

    But he did mention he's looking for a solution for both programmers and
    designers. With plates there's no special syntax, it's just plain html.
    But that also means it's restricted to use in HTML files.
  • Tito Ciuro at Mar 4, 2012 at 11:33 pm
    Hi Jann,

    Having read both options, I would say that plates matches our workflow better. Based on the way we work, plates is unobtrusive and easily lets each one of us work without having to change anything. If at some point we see that it's not working for us, we'll certainly look at vacuum. :-)

    Thanks for the feedback!

    -- Tito
    On Mar 4, 2012, at 3:00 PM, Jann Horn wrote:

    Am Sonntag, den 04.03.2012, 03:49 -0800 schrieb fent:
    Nice. More templating engines should offer streaming.
    thanks :)

    But he did mention he's looking for a solution for both programmers and
    designers. With plates there's no special syntax, it's just plain html.
    But that also means it's restricted to use in HTML files.
    --
    Job Board: http://jobs.nodejs.org/
    Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
    You received this message because you are subscribed to the Google
    Groups "nodejs" group.
    To post to this group, send email to nodejs@googlegroups.com
    To unsubscribe from this group, send email to
    nodejs+unsubscribe@googlegroups.com
    For more options, visit this group at
    http://groups.google.com/group/nodejs?hl=en?hl=en
  • Marcel Laverdet at Mar 5, 2012 at 1:35 am
    *hijack* xml-literals is plates but without the need to use strings
    everywhere:

    https://github.com/laverdet/js-xml-literal
    On Sun, Mar 4, 2012 at 5:33 PM, Tito Ciuro wrote:

    Hi Jann,

    Having read both options, I would say that plates matches our workflow
    better. Based on the way we work, plates is unobtrusive and easily lets
    each one of us work without having to change anything. If at some point we
    see that it's not working for us, we'll certainly look at vacuum. :-)

    Thanks for the feedback!

    -- Tito
    On Mar 4, 2012, at 3:00 PM, Jann Horn wrote:

    Am Sonntag, den 04.03.2012, 03:49 -0800 schrieb fent:
    Nice. More templating engines should offer streaming.
    thanks :)

    But he did mention he's looking for a solution for both programmers and
    designers. With plates there's no special syntax, it's just plain html.
    But that also means it's restricted to use in HTML files.
    --
    Job Board: http://jobs.nodejs.org/
    Posting guidelines:
    https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
    You received this message because you are subscribed to the Google
    Groups "nodejs" group.
    To post to this group, send email to nodejs@googlegroups.com
    To unsubscribe from this group, send email to
    nodejs+unsubscribe@googlegroups.com
    For more options, visit this group at
    http://groups.google.com/group/nodejs?hl=en?hl=en
    --
    Job Board: http://jobs.nodejs.org/
    Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
    You received this message because you are subscribed to the Google
    Groups "nodejs" group.
    To post to this group, send email to nodejs@googlegroups.com
    To unsubscribe from this group, send email to
    nodejs+unsubscribe@googlegroups.com
    For more options, visit this group at
    http://groups.google.com/group/nodejs?hl=en?hl=en

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupnodejs @
categoriesnodejs
postedMar 4, '12 at 9:30a
activeMar 5, '12 at 1:35a
posts7
users4
websitenodejs.org
irc#node.js

People

Translate

site design / logo © 2022 Grokbase