Skip to main content

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 module the behaviour of the layout changes 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 stylesheet 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

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 https://www.example.com/administrator/components/com_datafeeds/cron/feedcron.php

or

0 4 * * * c u r l -silent  -o /dev/null https://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/cron;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

update frequency

each feed has it's own update frequency, ( in the feed configuration ). This is the minimal time between two updates. So if the update freqnuency is set to 360000 (100 hours) and your cron calls the feedcron every day, still the update will only occur every 4 days. If you set your update frequency to 60 seconds and your cron is called once a month the update will be once a month.

 


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 in the head section and it looks like

<meta name="x-data-36" content="shop-antillen" />

 

Now create a new joomla article, use the string in content as alias

 

 It's a good idea to create a article category for the SEO  articles

Example

The extra content in this example is at the bottom https://demos.affiliatefeeds.nl/shop/Bulgarije.html

 

 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
  • 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.

Downloads

Joomla 4.0 Versions

Latest version for Joomla 4: pkg_datafeeds-420.zip

Moving from the packages with version number 4. ( or 400.) to a package with version number 420 might cause issues in your overrides.

the links are created with different functions and parameters. Check the examples in modules/tmpl for How-To's

It is recommended to test the update before moving to a production server.

The latest 4. version:  pkg_datafeeds-400.zip 

Joomla 3.x (legacy)

Both should run on PHP 7.4 and PHP 8.0

Quick start

If you need help to get started please feel free to ask.

Joomla 2.5

As joomla 2.5 has reached end of life the component is not maintained for this version.

 

What are the differences?

Besides code cleanup and adaption to newer API functions there has been a major change in the database field names.

  • All Selectx and menu_x fields  are renamed to fieldx. The names are now consistent in both front end as the backend
  • Prijs is renamed to price
  • href, the product link, is renamed to url

What version to use?

If you are starting from scratch use the package version. 

If you are already using the older version you might want to use that version on newer sites as well.

How to migrate?

The new package should install over the old version, updating:

  • the database tables _dataitems and _datafeeds
  • updating your menu and module settings for com_datafeeds and mod_datamenu

You will have to change manually

  • update template overrides
  • update your code in feeds.php xrouter.php and xhelper.php

Code in template overrides is easily updated by changing the field names. In your files you will need to replace array references in objects like $item and $row:

  • rename all occurrences of Select[0-19] to field[0-19] (templates,xhelper,xrouter)
  • rename all occurrences of menu_[0-19] to field[0-19] (feeds.php)
  • rename all occurrences of Prijs to price 
  • rename all occurrences of href to url

Dont' forget to backup before switching!

 

Betaal info

Je kunt een support licentie afnemen door 53,55 euro over te maken op bankrekening 112876730 t.n.v. Gryla B.V. Deventer.

Gelieve je (bedrijfs)naam te vermelden in de betaling en je factuurgegevens te mailen. Na ontvangst van de betaling ontvang je een factuur en toegang tot het pro forum.