AutoLinks Templates
Location of the default Templates
The location of the default templates used by AutoLinks are:
administrator/components/com_autolinks_ce/views/articles/tmpl ... for the Commercial Unlimited License administrator/components/com_autolinks/views/articles/tmpl ... for the Creative Commons License
Each link position or use has its own dedicated Template file, these individual files are:
Template File | Used for |
---|---|
autolinks_bookmarks.inline.php | For the inline Bookmarks to Links shown on the Top or Bottom of the Article. |
autolinks_links.bottom.php | For the Links shown on the Bottom of the Article. |
autolinks_links.inline.php | For the Links shown inline of the Article. |
autolinks_links.top.php | For the Links shown on the Top of the Article. |
To customize one of these files, please follow the directions of Customizing the default Templates below. Do refrain from modifying the default templates, as with any update these modifications will get overwritten.
Customizing the default Templates
To customize on of the default Templates, follow this directions:
- Create a directory for the customization in your templates home directory:
templates/my-template/html/com_autolinks_ce/article
(For the Creative Commons License:templates/my-template/html/com_autolinks/article
) - Copy the default template file to this new directory, and keep the filename from the default file.
- Modify the default template as you wish or require. This customized template will get used by AutoLinks once detected in the new directory.
Internationalization of AutoLinks Messages
(Commercial Unlimited License only)
AutoLinks is using some minimal text for Templates of the Link Presentation. To make translations of this text, use the following default language file to create a additional language file for the language of the translation:
language/en-GB/en-GB.plg_content_autolinks_ce.ini
The Joomla 1.5 native language functionality is used for this.
Creating and using a new Template
(Commercial Unlimited License only)
When wanting to use a Alternate Template for a individual Link, the file for this Alternate Template is to be placed in the same directory as when customizing a default template file:
templates/my-template/html/com_autolinks_ce/article ... when using the Commercial Unlimited License
- When naming the new template, always start the filename with
autolinks_
:autolinks_contact.php
- Only use a PHP file for this template with the extension
.php
- In the setting for the Alternate Template of your link, just use the name of your new link template without the extension:
autolinks_contact
Available Data Structures
These are the Data Structures available to the Templates holding the Link data for each Autolink:
Variable | Use |
---|---|
$autolinks['all'] | Array of all active $autolink Autolinks |
$autolinks['header'] | Array of all $autolink AutoLinks to be positioned in the top of the Article |
$autolinks['footer'] | Array of all $autolink AutoLinks to be positioned in the bottom of the Article |
$autolink | Array holding the current AutoLink of a inline Link or Bookmark to a Link positioned in the top or bottom of the Article |
The $autolink
structure holds the following data:
$autolink['id'] ... ID of the database entry of this link $autolink['expression'] ... Search Expression as phrase or Regular Expression $autolink['description'] ... Description $autolink['link_type'] ... 'content-id' for Article ID, 'url' for URL $autolink['link'] ... Link to Article or URL $autolink['content-id'] ... ID of the Article if link is to content $autolink['title'] ... The Phrase as it is found in the Article $autolink['target'] ... Anchor Target, is set to '_blank' for Property "Open in new window or tab" $autolink['bookmark'] ... The Bookmark ID of this link $autolinl['template'] ... Name of the Alternate Template, if set. (only Commercial Unlimited License)
This structures may be used in the AutoLinks template files, see the individual default template files as example for their usage.