We need a page on our website with a price summary of the individual tours displayed for different party sizes and seaons, linked through to the pricing and season tables on TCMS. Is this something which could be set up by API or is there a report within TCMS would could be set up with a link to the web?
Permalink Reply by Paul on February 22, 2010 at 2:45pm
Hi Graham,
This would probably be best with a CMS templates driven page. A "Single Page Template" could be used to produce the HTML (web page) directly, or it could produce a data file (XML, CSV etc) which your developer could process using PHP to get the values out.
Presuming you are producing HTML the code would be something like the code below will list all Tours with a table of their "Freesale Seasons" underneath:
There are optional attributes you can use to change the ordering of Tours, limit which Tours get shown, list Departures or display pretty much any other element. For details see the CMS template documentation.
As you use TourCMS for your booking engine but not to manage your developer will need to go into Website Manager > FTP Setup and load some FTP settings so TourCMS can log onto your website to store the page. Probably best to work in a new sub-directory to avoid accidentally overwriting anything that's there already.
Then it's just a case of heading to Website Manager > Single Page Templates, saving a new Template with the above code and then clicking "Rebuild" (and then Rebuilding just that template).
Using CMS templates would require you to log into TourCMS occasionally and "Rebuild" the page to update the dates & prices, the API wouldn't require this however for the example you have given it would be a bit more complex to set up.
Is there any chance we can read in a remote xml file and display within our cms? It'd be preferrable if there was an xml file always available which we could read 'on the fly'.
Permalink Reply by Paul on February 23, 2010 at 10:35am
Hi Darren,
The template code above could be used to produce an XML file instead of HTML (just swap out the HTML tags for XML tags of your choice), this could then be transferred via FTP to a location of your choosing by clicking "Rebuild" on the template.
Obviously that is local rather than remote, if you don't want TourCMS to send you the file you could pull something together from the XML API, perhaps with a CRON job to cache the output locally as to get the full pricing/availability for all Tours in one page you would be doing multiple API calls.
Generally (i.e. no specific knowledge of your setup) I would say the former is technically simpler but does create a manual process moving forward to generate the file.
OK, this being the case, then you're probably right. So would you send the html file that your system generates, via ftp, to a specific directory on our server each time, or web root - and does it overwrite the last one or rename it?
Permalink Reply by Paul on February 23, 2010 at 11:44am
The file would be overwritten each time it gets generated, you load FTP settings (which would control where TourCMS logs in) then when you set up your template you can configure the path.
I've followed your steps added the following single page template: http://www.villageways.com/tourcms/pricesummary.php and made that directory writable, added ftp details also, but rebuilding the template does not result in a file ftp'd to that directory.
Darren
Permalink Reply by Paul on February 24, 2010 at 11:55am
Hi Darren,
I just logged in using the FTP details you have entered in TourCMS and can see "pricesummary.php" in the root, it appears to contain the dates & prices ok.
EDIT: Additionally I have just rebuilt the page (presumably you have changed the path of the template since rebuilding the first time) and now have a "/tourcms/pricesummary.php". However, the link still isn't working, presumably the FTP login details you have entered don't match up to the root of the actual villageways.com website?