Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
Safari Sun
Just launched a new Textpattern site for my client Safari Sun, who create tailor-made safari holidays to Africa and the Indian Ocean Islands.
The site is fully responsive and uses the following plugins:
- adi_contact
- adi_menu
- adi_variables
- bot_write_tab_customize
- rah_expanding
- rah_function
- rah_repeat
- rah_sitemap
- upm_textile
- zem_contact_reborn
- zem_nth
I also used ied_plugin_composer to help build a custom plugin to use openexchangerates.org to update the exchange rates. Currently this is a one-click manual process in the Textpattern admin interface, but I’m planning on creating a custom URL to trigger the update, which I can then call using a cron job.
Offline
Re: Safari Sun
Nice addition to your (and txp) portfolio! I like the responsiveness and (relative) js-independence, add a noscript
static google map, and it will be perfect.
springworks wrote #278629:
I also used ied_plugin_composer to help build a custom plugin to use openexchangerates.org to update the exchange rates. Currently this is a one-click manual process in the Textpattern admin interface, but I’m planning on creating a custom URL to trigger the update, which I can then call using a cron job.
Why wouldn’t you include openexchangerates.org json data in aks_cache
and retrieve it from there (with your plugin) on demand, so site visitors would trigger the rates update?
Offline
Re: Safari Sun
etc wrote #278641:
Nice addition to your (and txp) portfolio! I like the responsiveness and (relative) js-independence, add a
noscript
static google map, and it will be perfect.Why wouldn’t you include openexchangerates.org json data in
aks_cache
and retrieve it from there (with your plugin) on demand, so site visitors would trigger the rates update?
Thanks. I always like to minimise dependence on js if I can – I’ll look into putting in a noscript
static fallback.
There’s one or two more things to add to the site still, but I wanted to launch it ASAP because the site it replaced looked so outdated and was awful for SEO.
I’ll take a look at aks_cache
too and try and work out how to use it with openexchangerates.org and see if that is an easier way to have the exchange rates auto update. In reality, rates don’t need to be updated more than once a day or once a week as they are only used to give visitors an indication of a currency’s value.
Offline
Re: Safari Sun
springworks wrote #278642:
I’ll take a look at
aks_cache
too and try and work out how to use it with openexchangerates.org and see if that is an easier way to have the exchange rates auto update.
That’s fairly easy, the first visitor (probably a bot) will trigger the rates update and store them for 24 hours:
<txp:variable name="exrates">
<txp:aks_cache id="exrates" noreset="1" hour="24">
<txp:etc_query url="http://openexchangerates.org/api/latest.json?app_id=your_app_id" markup="raw" />
</txp:aks_cache>
</txp:variable>
<h4>Currency</h4>
<txp:etc_query data='<txp:variable name="exrates" />' query="." markup="json" wraptag="p">
Kenyan Shilling (KES), £1 = {$/({rates/KES?}|{rates/GBP?}).number_format($|2)} KES<br />
<small><em>Last updated: {$strftime(%d %B %Y|{timestamp?})}</em></small>
</txp:etc_query>
You can replace etc_query
with your own plugin, of course.
Offline
Re: Safari Sun
Ahh, that’s interesting.
At the moment, I’m storing the exchange rate data in articles in a separate section, so the only time I’m only calling openexchangerates.org is when the update button on the Admin side is clicked.
That way, page loads aren’t held up by waiting for openexchangerates.org data to be processed. But, of course, by caching the JSON response using aks_cache, with your system that is only happening once per day (or whatever the caching frequency is).
Offline
Re: Safari Sun
I liked it, thanks for sharing. Now I feel like going to Madagascar in August to see lemurs. Anyway, really great job.
Offline
Pages: 1