Customize the layout/tempates

Changing an existing layout.

The easiest way to change an exisisting layout of the component or module is to use template override

Simply copy

JOOMLA-ROOT/components/com_datafeeds/views/items/tmpl/default_<LAYOUT>.php

to

JOOMLA-ROOT/templates/YOUR TEMPLATE/html/com_datafeeds/items/default_<LAYOUT>.php

or for the module

JOOMLA-ROOT/modules/mod_datamenu/tmpl/<LAYOUT>.php

to

JOOMLA-ROOT/templates/YOUR TEMPLATE/html/mod_datamenu/<LAYOUT>.php

and modify the copied file.

Adding a layout

Copy an existing layout for the component

JOOMLA-ROOT/components/com_datafeeds/views/items/tmpl/default_<LAYOUT>.php

to

JOOMLA-ROOT/components/com_datafeeds/views/items/tmpl/default_<YOURNAME>.php

or for the module

JOOMLA-ROOT/modules/mod_datamenu/tmpl/<LAYOUT>(_item|_list|_custom).php

to

JOOMLA-ROOT/modules/mod_datamenu/tmpl/<YOUNAME>.php

for the component version for joomla 1.5 an version 2.5 prior to version 1469 you must change the name of the function in the php file

 For the module the behaviour of the layout hanges on the suffix. Layout without suffix ( default.php, search.php) display a menu, layouts with _list or _item ( top5table_list.php) display a list of items.

Changing the CSS

Add any template specific CSS to the stylesheett of your template.

The compoment does include a stylesheet to your website, to remove it copy

JOOMLA-ROOT/components/com_datafeeds/views/items/tmpl/default.php

to

JOOMLA-ROOT/templates/YOUR TEMPLATE/html/com_datafeeds/items/default.php

and remove the line with the datafeeds.css

Callback functions

This page tries to explain the usage of callback functions. callbacks are php-functions used to filter and manipulate feed data. Each item in a feed is parsed by the callback function. In the feed configuration the default callback is set to generic_cb. You can change this to your own functions. Callback functions go into the feeds.php script, there is a 'edit callbacks' tab/link in the menu's

 

Read more: Callback functions

Menu configuration

Display options

 

This tab allows to set navigation and sorting options. There are two sets of options, one applies to the start page of your 'shop' the other to all other deeper pages.

group function

When setting the group on option to on or setting it to one of the database fields, the component will only show a single item per value of that field. When set to on the field from the first menu level will be used.

example: if you set the value to 'merchant' (=feed name) to component will show a single item of each merchant on the homepage. This gives a more divers presentation.

Another purpose of the group  function is with siblings, assigning for example the 'ean code' to a Select field and then grouping on this field will only show a single product with that ean code. Then siblings can be used to show the  rest in a price comparison.

With group other pages (svn:1433)set to yes not only on the first page items are grouped but on all other deeper pages as well, intented usage is with siblings.

With group other pages set to smart grouping is automatic turned of when there is nothing to group. For example there is just on merchant left.

On the fashion demo the group on is set to Select1 (the gender), now for example a page like underwear will only show 3 items: one for each gender. While men's underwear will show all products since there is nothing to group on: only one gender.

 

 

Database fields

The following values are avaible to create custom layouts in the component or module

item values

  • [items_id] => incremetal number
  • [feed_id] => 147
  • [feed] => Name of the feed from the feed configuration
  • [hits] => number of kliks on the url
  • [description]
  • [title]
  • [url] => cloacked url in mod_datamenu the name is count_url, url is the uncloacked version
  • [Prijs] => the price
  • [Select0]...[Select9] => Fields from the database
  • [image] => image url
  •  

Obsolete

  • [adddate] => date (date/time in older versions) added, use items_id to sort on added date
  • [s0] => Select0
  • [s1]...[s3] => Values for this item as they appear on menu level 1 - 3, see default_full.php how to get these
  • [pprijs] => the price as well

Simple component layout to show it all

<?php 

defined('_JEXEC') or die('Restricted access');
# components/com_datafeeds/views/items/tmpl/default_dummy.php

if ($this->pagination ) {
$links= $this->pagination->getPagesLinks();
echo '<div class="pagination" id="datafeeds_top">'.$links.'</div>';
}
foreach ($this->dataitems as $item ) {
print "<pre>";
print_r($item);
print "</pre><hr>";
}

automatic import using cron jobs

For automatic updating the feeds you will need to call the feedcron periodically. On unix style systems this is usually done using a cronjob. Most hosting providers allow to set up some cron.

There are two options calling the webpage using w g e t, curl or lynx. Or using the CLI version of php. The choice depends on the availability using the CLI version is highly recommend, this avoids  max_execution_time problems.

a typical webpage request looks like:

0 4 * * * w g e t -q -O /dev/null http://www.example.com/administrator/components/com_datafeeds/cron/feedcron.php

or

0 4 * * * c u r l -silent  -o /dev/null http://www.example.com/administrator/components/com_datafeeds/cron/feedcron.php

(remove the spaces in w g e t and c u r l)

a typical command line call:

0 4 * * * (cd  JOOMLA-ROOT/administrator/components/com_datafeeds;php feedcron.php)


JOOMLA-ROOT is the real location of you joomla installation on the harddisk. Finding the right path might be a bit of a hassle and depends on your server. Have a look in site -> global configuration of your joomla installation. Under 'system' or 'server' there are the paths to JOOMLA-ROOT/tmp and JOOMLA-ROOT/logs

Adding content to the datafeeds pages

Mod_datamenu allows to add extra text, meta tags and page titles to single datafeeds pages.

For example, this gardening page has a customized meta-description and (the same) text in the lower left part of the page.

Step one

adding a mod_datamenu module

Create a new mod_datamenu module using the 'extensions -> module mangager' in the joomla administrator. On the right select 'Article' ( artikel in older versions) as your layout. On the left assign it a title and module position.

 

Step two

adding and mapping content

To map articles to datafeeds pages the datafeeds page slug is used. This slug is used as  article alias when creating an article.

The page slug is the part of the url starting with the menu-alias.The menu alias is defined in the joomla-menu settings of the datafeeds page.

From the slug only the string parts are used. Replace slashes '/', spaces ' ' and pluses '+' with dashes '-' and remove any query parameters from the url including the numbers and t- and q- tokens used in the datafeeds sef url.

You can find the alias in the source code of your html page, between comment markt. ( some templates/plugins strip the comments from you html)

Examples :

http://demos.affiliatefeeds.nl/shop/garden.html article alias will be 'garden'

http://demos.affiliatefeeds.nl/shop/garden/Gifts/3-All+gifts.html article alias will be garden-gifts-all-gifts 

If you are using non-sef url simply use the query values add up the q? values and prepend the menu alias. http://demos.affiliatefeeds.nl/shop/index.php?option=com_datafeeds&Itemid=153&q1=Gifts&q3=All+gifts gives the same alias as the previous example.

If your datafeeds are used as default page in joomla 1.7 the menu alias is not used. This the article alias for http://demos.affiliatefeeds.nl/shop/Tuin.html is tuin.

 

If you want to add content to sub-pages add the page 'number' to the alias.

Example:

The extra content is at the bottom.

First page: http://demos.affiliatefeeds.nl/shop/fashion.html

Second Page : http://demos.affiliatefeeds.nl/shop/fashion/start20.html

Third and other pages : http://demos.affiliatefeeds.nl/shop/fashion/start80.html

The last 'third and other pages' is achieved by settings the levels parameter in the module to 3.

If you want to have the same (first page) content on all pages set levels to 0

 

 

 The component does not allow to manually modify single items, although changes can be performed using import filters.

 

Installation

Either use the component to add the com_datafeeds to your existing joomla site or use the full installer  this is  a complete joomla website including the component and examples. You can not use the full installer on an existing site! Please select the correct download

 

After installation click on the import link in the installation report (component installation) or go to the datafeeds section and hit the import link.  You should get a page with progress bars. Watch the lines with 'xxx items in database'  these should go up.

Common problems preventing import are

  • high server load,
  • no write permission for JOOMLA-ROOT/administrator/cache 
  • server limitations on external http requests.

When using the full joomla install the site should now be up and running including menus

If you installed only the component you will need to create a new joomla-menu and a new mod_datamenu module 

Create a menu for the component using the 'menus' section of your joomla administrator. Leave the right site blank for now, just enter the title page on the left site.

Create a module using the extension -> module-manager of joomla. Use 'datamenu', leave the right side as is for now just enter the appropriate title and module position on the left side.

 

 

Affiliate feeds for Joomla

Features

 

  • Import XML or CSV product datafeed into Joomla
  • Suitable for any currency, for example £ € $ etc.
  • Search engine friendly links
  • Google Sitemap generation
  • Each feed can be pre-processed before importing, rewriting data
  • Automatic cron imports
  • Automatic purge of old items
  • Cloacked links
  • free

Get started using the full install.

The fastest way to get started and learn about the use and configuration of the component is to download the complete joomla install including the component. Depending on your experience creating a database and installing joomla it might take less then 10 minutes. more

Get started using the component only.

Joomla already up and running? Install the component. more

The Power of this component

A extremely powerful part of this component is the usage of import-filters  called 'callback' functions. These functions allow for manipulating the data before it's inserted into the database. Common problems in datafeeds are the variety in spelling of items ( TV - Television) and single plural ( T-Shirt - T-shirts). Import-filters functions can solve this.

System Requirements

The component has the same system requirements as joomla, in addition it requires curl or the php setting allow_url_fopen set on (prefered). The component is tested against the latest version of joomla 1.5 and 1.7

Some hosts prevent outgoing http request, this is a showstopper. There is a simple test script to test the basics: req-test.zip, put the containing php script on your server and load it.

For importing large feeds access to the command line version of php is recommended.

Old versions of mysql ( < 4.1.2) will not support database collation, this might result in problems with special characters.