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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T00:27:14+00:00 2026-06-10T00:27:14+00:00

A simple and short question: If a view contains two or more sub views.

  • 0

A simple and short question: If a view contains two or more sub views. Should the view container be a layout view?

If not, what are good alternatives?

Update:

my code:

var LikeButtonModal = Backbone.Model.extend({
    url: 'api/profile/like/'
});

var LikeButton = Backbone.Marionette.ItemView.extend({
    tagName: 'button',
    className: 'like',
    template: '<div>like</div>',
    events: {
        'click' : 'like'
    },
    initialize: function(userId){
        this.model = new LikeButtonModal();
    },
    like: function(){
        this.model.save();
    }
})

var LeftProfileView = Backbone.Marionette.Layout.extend({
    template: '#profile-left',
    regions:{
        extra : '.extra'
    },
    initialize: function(){
        this.on("item:rendered", this.editable, this);
    },
    onRender: function(){
        if(this.model.get('userid') != ActiveUser.get('userid')){
            this.extra.show(new LikeButton(this.model.get('userid')));
        }
    }
});
  • 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-10T00:27:15+00:00Added an answer on June 10, 2026 at 12:27 am

    Layouts are good for this if you will be replacing the sub-views at different times, or if the sub-views are very different types… for example, a layout might contain your header, your navigation and your main content region.

    Other options are CollectionViews and CompositeViews.

    Collection views will render a collection of items, using the same type of view for each item in your collection. This works well for lists of things.

    CompositeViews are CollectionViews that can render a wrapper template around the collection. For example, an HTML table structure. The table, thead, tbody and tfooter tags can be rendered in the CompositeView’s wrapper template, and then a collection of items can be rendered in to the tbody tag.

    This might shed a little more light on the subject, too: https://github.com/derickbailey/backbone.marionette/wiki/Use-cases-for-the-different-views

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

Sidebar

Related Questions

Simple and short question. Swapping two variables in Python is very easy: a, b
Short and simple question. In Winforms you can bind a dataview to a combobox
I have a simple question, not able to sort it out. I have a
Can anyone show a short and simple code snippet? It should take the name
Short version: Is there a simple, built-in way to identify the calling view in
Hopefully a simple question. I have several models, two of them, :users and :songs
The question is simple: How can i pass data from model to view(or back
Short and simple, our project has a Launcher component and an Application component and
For some short and simple queries I've been using the query designer in SSMS
So, I am writing a short (and simple) regular expression, but I can think

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.