Knowledge base/Tips & Tricks

Display TouristWay's offers in your website

Technical Support
posted this on September 09, 2009 12:28

Before you start thinking about complex XML-based integrations, I would advise you to consider starting with far easier AJAX calls you can use to ask TouristWay ready-to-display html snippets already filled with data+layout.

Follow this for a quick try:

  1. unpack the ZIP attached to this article somewhere on your disk
  2. upload searcha-ajax.html to /templates/RAW/ folder of your TouristWay (use FILES menu in the administration area)
  3. edit showmetw.html, replace "YOURPROJECTNAME.touristwayapp.com" with your project url (i.e. bookgreece.touristwayapp.com) and save
  4. click on showmetw.html to open it with your browser
  5. you should see a spinning wheel for a moment (your page contacting TouristWay) and then TouristWay output replacing it. Slick!

and this is how I made it:

  1. Duplicate the template searcha.html (for example) and strip all components but the one that has id=search.
  2. Remove the CANVAS node too from the XML
  3. Save the template as searcha-ajax.html
  4. Test the output calling http://YOURPROJECTNAME.touristwayapp.com/twpub/index.cgi?m=searcha-ajax (the output will have no styling since you removed the CANVAS)
  5. call this url from your website through an Ajax call and inject the output in your page... for example we love JQUERY (www.jquery.org) and that's what I used in my example to do the required Ajax voodoo (see showmetw.html attached)
Of course you can customize the component's templates or combine the output of more components or just modify TouristWay templates to look like a white-label site (i.e. by emptying header and footer) and embed the full page in your site without having to remove too much.

 

 
Topic is closed for comments