1

I'm working on a website which has been developed in plone. Now I'm facing an issue, I would like to load certain content from a template via an ajax call on normal Plone page(on some event trigger). Do I need to create any python script??If yes where has it to be placed? and moreover how do I integrate it with TAL(I guess that would be needed) but I'm not sure how.

Could anyone guide me on this with necessary pointers/docs that I should look into?It would of great help to come over my issue and get things rolling.

Thanks, Avinash

Lennart Regebro
  • 167,292
  • 41
  • 224
  • 251

2 Answers2

1

In the "Plone Developer Documentation" there's a section for Javascripting in Plone that perfectly fits your needs

aclark
  • 4,345
  • 1
  • 19
  • 31
Giacomo Spettoli
  • 4,476
  • 1
  • 16
  • 24
0

Your question is a bit vague:

From your question, it seems that you just want your ajax call to return html to populate data on the page somewhere then?

Also, it sounds like you want to do the development TTW in the ZMI? Most developers would would use an add-on product and return your ajax response.

However, you can do it TTW with page templates just fine.

  • Create the new page template
  • populate it with the template code that gives you the desired output when called within the context of content on a site. For example, http://mysite.com/plone/page/my-template
  • in your javascript, use a url that in the ajax call: $.ajax({url: 'http://mysite.com/plone/page/my-template', success: function(data){ $('#content').append(data);}})

It's not really anything special to do ajax within plone--just use the tools available and piece it together.

vangheem
  • 3,293
  • 17
  • 18