Displaying the links on your site

Created: Nov 15, 2007

As explained in the introduction about the core of, LinkEX will produce an output for each category and the links belonging to this category.
It is up to you to include this generated file somewhere on your website.

Below I will present you with two different methods on how to include the output file on your website.

For more information on how to configure the output format, please refer to the documentation page about categories.

Including the output file using PHP

Since you're running LinkEX, your web server obviously has PHP installed. PHP has a few function to include a file using a simple function call, which, when executed, replaces the function call with the contents of the file.

The syntax is straight forward; <?php include( "[filename]" ); ?>

Open up the file you would like to have your links on. This file must have an extension to it is parsed by PHP, normally it is one of the following .php, .phtml, .php3, .php4 or .php5, but it can what ever your web server is configured to.
Find the place where you would like to have the links displayed, and simply write the following:
<?php include( "linkex/data/output/1001" ); ?>
The code above assumes that you have installed LinkEX in to a folder called linkex, and that it is the default first category you would like to display. 1001 represents the category id found in under the admin interface.

Including the output file using SSI

If your web server software is Apache, you can take advantage of Server Side Includes, which is a simple scripting language embedded into Apache.

Typically the page must have an extension .shtml, but again it depends on your configuration.

The syntax for including files using SSI is; <!--#include file="[filename]" -->

Open up the page where you would like to have the links displayed, and enter the following:
<?!--#include file="linkex/data/output/1001" -->
The code above assumes that you have installed LinkEX in to a folder called linkex, and that it is the default first category you would like to display. 1001 represents the category id found in under the admin interface.

Does it work?

When you are setting up a new installation, you most likely do not have any links yet, so obviously there are no links displayed on your site. To make sure everything works as it should, reload your website and view the source code in your browser.
The output file has a html comment, so you should be able to find this, <!-- Output generated by LinkEX (+http://linkex.dk/) -->.
If you don't see this comment, but the inclusion code instead read the next section.

My page is .html what do I do

If your page is a regular .html file, you can either rename the file to one of the extensions above to instruct the web server to parse the file and take advantage of one of the methods.
Sometimes it is not possible to rename the file, if you have many external links pointing to it, or many people have the site bookmarked. In such a case, you can ask your hosting provider to enable either PHP or SSI for the file type extension so the web server will treat the .html the same way it treats .php or .shtml files.

The include does not work

Please verify that web server is configured to handle the extension you are using. Ask your hosting provider if the method is supported and what extension you should use.