Search

Hey,

I've got a client who needs to have testimonials and other data change dynamically depending on the visitors country (which I want to detect automatically) How could I do this in Symphony?

Cheers, - Eoghan

Firstly you'll need a method to detect the user's location. There are various services you can pay for, which provide you with a webservice you access using either PHP or JavaScript which will return information about the user's IP address (town, country etc.).

There are also free IP-lookup databases scattered around that you may be able to use.

The process involves taking the user's IP address, cross referencing it against the database, and finding their locality. You will then need some way of deciding which content to display to which user. This is tricky. Let's say you want to display Content #1 to USA citizens and Content #2 to UK citizens. You would need to store "USA" or "UK" alongside your content in Symphony, and a Data Source to filter the content by the locality returned from the IP lookup.

What happens if the user is not from the USA or the UK? You would need a fallback for everyone else.

The obvious solution is to simply ask the user where they are from, by means of a drop down or list of countries. Store this in a cookie or a session, and pass it into your Data Sources to filter content.

Thanks for the quick reply, I could probably just get my client to tag each testimonial within Symphony with a country code, then show the linked content depending on country, it probably would be easier to ask the user where they are from alright but I'd rather not have to ask to many questions of the user on arrival.

How would I use the cookie monster extension to add their country and filter the Data Source? I've yet to figure out the process with the that.

http://overture21.com/campfire-service/detail/26/

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details