5

I'm looking for implementation information about using Backbone.js on the front end of an ExpressionEngine site. I saw this site that appears to be using EE and Backbone together but would be curious to learn more about how that would be implemented.

The Entry API add-on is the closest add-on currently built for EE that would support the REST functionality needed for Backbone. But I was wondering if this would be the recommended way to approach integrating with Backbone, what are the potential security issues, or would this be something that would have to be implemented through developing a custom plugin that will handle the interaction between backbone and the database?

What I hope to achieve is similar to the link as well. Essentially it would be a large category listings page that would be displayed and filtered based on category check boxes. Which then would simply be probably a custom SQL query based on the cat id's passed in. Then using backbone for the display of that updated query result (through REST) based on category selection in the main content area of the front end through the JavaScript. The interaction between the REST connection would be for display only and never would it be used for any actual update or create operations.

6
  • 2
    Can you be more specific? What are your concerns about using Backbone with EE? One or more specific questions would be great. "How would it be implemented" is very broad. Dec 12, 2012 at 18:02
  • Correct, I should have been more specific. Regarding the actual implementation I see this devot-ee.com/add-ons/entry-api is the closest addon currently built for EE that would support the REST functionality needed for backbone. But I was wondering if this would be the reccommended way to aproach integrating with Backbone, what are the potential security issues, or would this be something that would have to be implemented through developing a custom plugin that will handle the interaction between backbone and the database?
    – james
    Dec 12, 2012 at 18:32
  • I added these comments to your question James. Dec 12, 2012 at 18:47
  • Could you add a bit more detail about what your backbone app will actually need to do? Eg do you want full CRUD from backbone to all channels, or something more limited?
    – Tom Davies
    Dec 12, 2012 at 19:37
  • Thanks Tom, I updated my original question above with more detail regarding my goal functionality as well and the scope of the interaction.
    – james
    Dec 12, 2012 at 20:02

1 Answer 1

1

Since you don't need CRUD operations, you could probably do this with simple ajax calls instead.

The EE templates would simply return a chunk of markup instead of a whole page.

You can still use Backbone to tie all the views together and have everything updating in multiple places, but as far as I can see you don't need to be sending JSON backwards and forwards from Backbone models/collections, and therefore don't need RESTfulness...

2
  • After thinking about this awhile I do agree with this answer. Although I am still curious about how exactly this would be implemented I do believe I was over thinking it for this particular case. Thanks.
    – james
    Dec 17, 2012 at 17:54
  • If you do need those CRUD operations, take a look at the emulateHTTP method of Backbone sync: backbonejs.org/#Sync-emulateHTTP - (I've not used this yet myself, I'm quite new to Backbone, but it looks like a good first step) Dec 17, 2012 at 21:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.