5. What are templates?

Templates allow you to optionally broaden your output. They offer you total flexibility. You can easily adjust templates in the backend of WordPress.

The structure is designed really simple. Think of it just like the mail merge function of Word. You define the template and enter the proxies. During output on your WordPress page your proxy will be replaced by the correct value.

Templates can be easily managed via “Affiliate-Toolkit” -> “Templates”. Here you can create and edit all templates.

Import and export templates

In order to ease your work with the templates, we implemented an import and export function for the templates.

This way you can easily copy already created templates from installation to installation.

Suggestion: Our documentation contains some templates for downloading.

Export templates

In case you would like to export an already existing template, you simple need to open the overview of templates. The column “Action” allows you to export the template.

The template will be automatically downloaded afterwards.

Import templates

Templates can be imported via “Affiliate-Toolkit” -> “Tools” -> “Import templates”.

 

Create new template within the plugin

Basically, it’s really easy to create a new template via the surface. You simply need to know which kind of template you want to use.

We differentiate between the following types:

  • Product template
    Here you can access all fields of the main product incl. your user defined and ACF fields.
  • Offer template
    Here you access the proxies of your offers. The detail area is executed for every offer line of the product.
  • Picture gallery template
    Here you access the proxy of a picture. The detail area for every picture of the product is executed.
  • Comparison chart
    This type of template is special and has its own surface. But in general, it used just like a product template.

Detailed field information

The fields for the first three template types can be found here:

 

1. Type

As previously mentioned this is where you choose the type of template. Depending on the chosen type other proxies will become available.

2. Extended View

Here you can show resp. hide the heading line (4), header details (5), footer details (7), and the footer (8). Most of the templates don’t need these extended fields at all.

3. Header

The header is always the first part that needs to be completed. Here you can define e.g. the header of a table (<table>).

In the header area, you can access the proxies of the first product. Additionally, you can access the proxies %refresh_date% and %refresh_time%.

The proxy %listurl% is only available for lists.

4. Heading line (extended)

This header is executed for every line (product).

5. Header details (extended)

This header is executed once per line. The proxy {SYS_APPEND} works here.

6. Detail

The detail area is executed for every product. Here you can access all proxies of a product.

7. Footer details (extended)

The footer is executed for every line (product).

8. Footer (extended)

This footer is executed once per line. The proxy {SYS_APPEND} works here.

9. Footer

The footer area is executed only once, just like the header. But this one is placed at the end. In case of a table this one would be (</table). Here you can also use the same proxy you are using for the header.

10. CSS-Style

All CSS-styles relevant for templates are stored here and can also be defined external (e.g. in a style.css).

It is recommended, that only the styles for the corresponding template are stored here, so that no double output occurs. In case you are using the same template multiple times, you should save your CSS-style in the theme folder and not in this field.

11. Disclaimer of liability

In case you add a checkmark here (and if this checkmark is also activated in the settings) then the disclaimer of liability will not be added to the bottom of the template. If you don’t show prices or delivery information, then you also don’t need to activate the disclaimer of liability for your template.

12. Also show primary offer

Here you decide, whether the prices of the main product shall be included in the list or not (e.g. checked in the template “all offers”, but not activated in the template “additional offers”).

13. Max. number of offers

Here you can define a max. of offers for the output. E.g. in case you always just want to show the 5 cheapest offers.

14. Template proxies

This will show you the template proxies available for the current template type.

Template proxies

Here we will show you all proxies available upon delivery. This proxy is also available within the template editor itself (no. 14).

Product template and comparison table

ProxyDescription
%shoplogo%Logo of the shop which was chosen from the product.
%smallshoplogo%Small logo of the shop which was chosen from the product.
%shoptitle%Shop title
%shoplogourl%URL of shop logo
%smallshoplogourl%URL of small shop logo.
%shopcustomfield1%User defined field 1 from the shop.
%shopcustomfield2%User defined field 2 from the shop.
%shopcustomfield3%User defined field 3 from the shop.
%acf_shop_xyz%The fields of Advanced Custom Fields from the offer’s shop.
%shopid%The Shop-ID which was chosen for the product (or list).
%listid%Distinct ID of product. At Amazon e.g. ASIN.
%listtitle%Title of list, in case a list is used.
%templateid%ID of current template.
%mark%When activated in settings, a * to the affiliate link marking will be added.
%title%Title of product
%short_title%Shortend title of product (according to settings).
%detailtext%Button title for link on product page.
%detailurl%URL for product page or to a product with the main product (when activated).
%detaillink%Link to detail URL.
%detailvisibility%In case a link for the product page exists, it can be made “visible” here.
%productid%ID of product
%asin%Distinct ID of product (used to update the product)
%ean%EAN or several EANs of product.
%isbn%ISBN of product.
%brand%Brand of product.
%productgroup% Productgroup of product.
%availability%Availability of product.
%shipping%Shipping rates of product.
%offerscount%Number of offers for product
%minprice%Price of the cheapest offer.
%minprice_url%Link to the cheapest offer.
%minprice_shoptitle%Shop title of cheapest offer.
%minprice_shoplogourl%URL for Shop-Logo of cheapest offer.
%minprice_smallshoplogourl%URL for small Shop-Logo for cheapest offer.
%maxprice%Price for most expensive offer.
%maxprice_url%Link of most expensive offer.
%maxprice_shoptitle%Shop title for most expensive offer.
%maxprice_shoplogourl%URL for Shop-Logo of most expensive offer.
%maxprice_smallshoplogourl%URL for small Shop-Logo for most expensive offer.
%thumbimages_xxx%Respective small galley picture with HTML-Tag (img). Xxx will be replaced by number.
%mediumimages_xxx%Respective small galley picture with HTML-Tag (img). Xxx will be replaced by number.
%images_xxx%Respective original galley picture with HTML-Tag (img). Xxx will be replaced by number.
%smallimageurl%URL to small main picture of product.
%mediumimageurl%URL to medium-sized main picture of product.
%largeimageurl%URL to large main picture of product.
%smallimage%Small main picture with HTML-Tag (img).
%mediumimage%Medium-sized picture with HTML-Tag (img).
%largeimage%Original sized picture with HTML-Tag (img).
%by_text%Either the manufacturer or author of the product.
%productlink%Link to product with HTML-Tag (a).
%cartlink%Link to shopping cart (when blank, product link is used) with HTML-Tag (a).
%producturl%URL to product.
%customerreviewsurl%URL to customer reviews of product.
%acf_list_xyz%Fields of Advanced Custom Fields from the offer’s list.
%hidelistlink%In case no link list exists, display:none will be sent back.
%listlink%Link to list (from list) with HTML-Tag (a).
%listurl%URL to list (from list).
%listlinktext%Title for link on Amazon list.
%linkmark%Same function as proxy %mark% but for button type.
%link%Depending on button type either the shopping cart link, the product page link, or the product link will be entered here as HTML (a).
%linktext%Text for button (depending on button type).
%titlelinkmark%Same function as the proxy %mark% but for the product title link.
%titlelink%Either link to product or link to product website with HTML-Tag (a).
%bestseller_text%Shows “no 1 bestseller”. By default, for the first 3 products. Can be changed in settings.
%bestseller_number%Shows “no 1”. By default, for the first 3 products. Can be changed in settings
%reviewsurl%URL to own reviews (of the product).
%rating%Shows '1 of 5 stars' in case customer ratings are available.
%star_rating%Shows star reviews with HTML-Tag (span).
%reviewcount2%Same function as proxy %rating%.
%reviewcount%Shows text for 'show reviews' resp. the number of reviews, if available.
%reviewslink%Link to customer review (or own review URL if provided) with HTML-Tag (a).
%markrating%Same function as proxy %mark% but for star reviews.
%prime_icon%Displays Prime icon as HTML-Tag (img) – when activated it’ll also be linked.
%save_percentage%Shows savings in percent.
%save_percentage_%Shows savings in percent and in a bracket.
%save_text%Shows savings as “your savings:”.
%save_amount%Shows savings as number.
%listprice_text%Shows list price as “list price:”.
%listprice%Shows list price as number.
%price%Shows retail price or “not available”.
%price_text%Shows retail price as “price:”.
%info_text%Either displays characteristics or the descriptions, depending on settings.
%predicate_id%Used for comparison chart.
%predicate_text%Used for comparison chart.
%predicate_color%Used for comparison chart.
%predicate_borderstyle%Used for comparison chart.
%testresult%Shows test badge.
%pro%Shows Pro-List of product as HTML-Tag (ul).
%contra%Shows Contra-List of product as HTML-Tag (ul).
%post_list%Shows list of linked main products as HTML-Tag (ul).
%features_text%Shows characteristics of product.
%description_text%Shows decription of product.
%priceinfo_text%Shows text “price incl. VAT, plus S&H“.
%cssclass%Shows CSS-class from shortcode.
%content%Shows content of shortcode.
%moreoffers%Shows the 'More offers'-template of the product.
%customfield_xyz%Contains user defined fields. XYZ need to be replaced by own name.
%customtaxonomy_xyz%Contains user defined taxonomies. XYZ need to be replaced by own name.
%total_rating%In case the review plugin 'WP Review' has been installed, the overall rating will be displayed here.
%refresh_date%Update date of product.
%refresh_time%Update time of product.
%disclaimer%Disclaimer of liability taken from settings, when activated.

Offer templates

ProxyDescription
%listid%Distinct ID of product. At Amazon e.g. ASIN.
%templateid%ID of current template.
%shopid%The Shop-ID which was chosen for the product (or list).
%productid%ID of product.
%price%Shows retail price of offer.
%price_text%Shows retail price of offer incl. “price:”.
%mark%When activated in settings, a * to the affiliate link marking will be added.
%linkmark%Same function as proxy %mark%.
%linktext%Contains text “buy now”.
%productlink%Link to product with HTML-Tag (a).
%producturl%URL of product.
%producttitle%Title of offer.
%availability%Availability of offer.
%shipping%Shipping costs of offer.
%totalprice%Total price of offer (shipping + retail price).
%shipping_text%Shipping costs incl. 'Shipping:'.
%availability_text%Availability incl. 'Availability:'.
%bestprice_badget%Shows 'Best price' in case this is the cheapest offer.
%offerindex%Shows consecutive number (starts at 1).
%shoplogo%Logo of the shop which was chosen from the product.
%smallshoplogo%Small logo of the shop which was chosen from the product.
%shoptitle%Shop title
%shoplogourl%URL of shop logo.
%smallshoplogourl%URL of small shop logo.
%shopcustomfield1%User defined field 1 from the shop.
%shopcustomfield2%User defined field 2 from the shop.
%shopcustomfield3%User defined field 3 from the shop.
%acf_shop_xyz%The fields of Advanced Custom Fields from the offer’s shop.

Picture gallery templates

ProxyDescription
%title%Title of product.
%listid%In case a list is used, this is the distinct list ID.
%templateid%ID of current template.
%shopid% The Shop-ID which was chosen for the product (or list).
%productid%ID of product.
%smallimage%Small main picture with HTML-Tag (img).
%mediumimage%Medium-sized picture with HTML-Tag (img).
%image%Original sized picture with HTML-Tag (img).
%smallimageurl%URL to small main picture of product.
%mediumimageurl%URL to medium-sized main picture of product.
%imageurl%URL to original-sized main picture of product.
%mark%When activated in settings, a * to the affiliate link marking will be added.
%shoplogo%Logo of the shop which was chosen from the product.
%smallshoplogo%Small logo of the shop which was chosen from the product.
%shoptitle%Shop title
%shoplogourl%URL of shop logo.
%smallshoplogourl%URL of small shop logo.
%shopcustomfield1%User defined field 1 from the shop.
%shopcustomfield2%User defined field 2 from the shop.
%shopcustomfield3%User defined field 3 from the shop.
%productlink%Link to product.
%acf_shop_xyz%The fields of Advanced Custom Fields from the offer’s shop.
%acf_list_%The fields of Advanced Custom Fields from the list.
%acf_%The fields of Advanced Custom Fields from the product.

Template procedures

In order to clarify the whole process, we created a little example.

Easy process

With this process 90% of all templates can be designed and displayed accordingly.

atkp-ablauf1

Everything that’s added to the header section will be executed once. The detail area will be executed for every product. The footer will be, just like the header, only executed once.

Advanced process

In order to get to the remaining 10%, we added some additional fields (to be activated via the checkmark “advanced display”).

atkp-ablauf2

This way even complex comparison charts can be created. The header details, footer details, as well as the detail area can be “split” into lines. Via the proxy {SYS_APPEND} the template will be divided and then (based on the sequence) every template line will be connected with one another.

Create new template via file

In case you are using the Affiliate-Toolkit-Starter, premium functions such as templates will not be available. But you can still adjust templates and create your own templates. This of course all works without the premium version as well! Changes of the standard templates are only temporarily unsupported! 😉

Details concerning the structure and the proxies can be found above.

The plugin index contains a subfolder called “templates”. Here you’ll find and adjust all standard templates. When you copy the template, you can as well create your own template. Please keep in mind: The template name needs to contain at least one letter otherwise your template won’t be searched for in the “template” directory.

To make the template changes update-proof, you should create a folder called “atkp-templates” in your “Theme”-index (child-theme). You can copy your templates into this folder. Also changes to the standard templates can be copied into this folder. This folder overrides the standard directory.

The structure of the file is generally the same as the one on the surface but you should have some PHP knowledge. The templates are all derived from the “/includes/atkp_default_template_base.php.php“ class.

Tipps for creating templates

Handling blank fields

Once a field is blank, it won’t be displayed. Here a shifting in layout may happen. The standard templates are created in such way that this doesn’t happen. But with user defined templates this may cause problems.

As a trick for “blank” fields &nbsp; (space) can be used. If this has been defined behind the proxy, the line along with its size will be kept.

 

More about templates

Do you still have questions? No problem :-)
We are happy to answer your questions in our forum.