HCG Web Services Documentation
6 July 2009 • Version 1.0

Remote Tags for FAQs

These remote tags are designed to provide FAQs through a simple tag placed in a remote website.

NOTE: Remote Tags are a restricted service and are intended for use only in websites owned by The Hain Celestial Group. They are not for general use. Please contact Jim Applegate if you need to set up access to Remote Tags.

Base URL : http://rtags.hcgweb.net/{version}/faqs/

The current version is v1.

The HTTP Method used is POST.

Available Tags:

faqList

Displays a standard list of FAQs with the option of either displaying the answers below or linking to a FAQ detail page.

The data must be submitted via the POST method.

URL Format

http://rtags.hcgweb.net/{version}/faqs/faqList

Parameter Required Description Options and Samples
version Yes The version of the rTag that you are using. v1
site-id Yes The alpha code used to identify on which HCG site the tag is installed. ge = Garden of Eatin'

See a complete list of codes.
list-tpl No The template name for the results.* faq_list

Default: faq_list

*For security reasons, there is no mechanism for overriding templates directly from a remote server. Many modifications can be made using CSS, but if you need to make markup changes to a template, contact Jim Applegate to either modify the default template or add a new template to the list of options.

Example Pages

The example pages below shows what the tag looks like in action.

Templates and CSS

The code

<?php
   $post_array = array();
   $post_vars = '';
   $ch = '';
   $output = '';
   $rtag_url = $server.'v1/faqs/faqList';
   
   $config = array();
   $config['site-id'] = 'cs';
   
   foreach ($config AS $key => $value)
      $post_array[] = $key.'='.$value;
   
   foreach ($_POST AS $key => $value)
      $post_array[] = $key.'='.$value;

   $post_vars = implode('&', $post_array);

   $ch = curl_init($rtag_url);
   curl_setopt($ch, CURLOPT_POST, 1);
   curl_setopt($ch, CURLOPT_POSTFIELDS, $post_vars);
   curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
   curl_setopt($ch, CURLOPT_HEADER, 0);
   curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
   $output = curl_exec($ch);
   curl_close($ch);
        
   echo $output;
?>