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 7701431
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T22:59:02+00:00 2026-05-31T22:59:02+00:00

Would it be considered best practice to use a single template that changes it’s

  • 0

Would it be considered best practice to use a single template that changes it’s output based on script values, or have multiple templates, and use the view to pick the correct one instead?

For example, in this underscope template:

<script type="text/template" id="SkillsetTemplate">

<div class='RegularMode <%= (skillset.get('InEditMode')===false)?'show':'hide' %>'>
</div>

<div class='EditMode <%= (skillset.get('InEditMode')===true)?'show':'hide' %>'>
</div>

</script>

I use a backbone model to bind against, and use the InEditMode attribute to pick which content to render.

Should I instead have a normal mode, and an edit mode template, and use the attribute on the model to pick the template ?

For background purposes, I am using backbone.js with underscore templates and an MVC3 backend.

  • 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-31T22:59:04+00:00Added an answer on May 31, 2026 at 10:59 pm

    I’d absolutely go with a second template. I’ll admit it may not be completely DRY but you never know, you may need the edit template to not look a bit like your non-edit one (in which case you aren’t repeating yourself).

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

Sidebar

Related Questions

Is there a way in Cocoa that is currently considered best practice for creating
What would be considered best practice when you need additional data about facet results.
What would you consider best practice for organizing JUnit tests in a project, and
I think everyone here would agree that in order to be considered a professional
I have what I would consider a small sized iPhone app that uses SQLite.
Not sure if this is considered best practice or if you should even do
What's considered best practice writing OOP classes when it comes to using a property
What is considered to be best practice for handling database connections? (I omitted the
I have a small set of structured data items that I would like embedded
I have been developing an application that uses Models that are based on a

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.