| Included Files
On the majority of modern web servers, it's possible to include a web page within another. This is known as a Server Side Include (SSI) because it's your server that does the work of finding the included file and inserting it into your web page. An important benefit of organizing your website in this way is to prevent unnecessary updates. For example, when a new article is added to the database, a link to it may need to be displayed on each article page because it will be shown in a headline; however, each of your articles will include a common headlines file which can be updated separately so that none of your old article pages need to be updated. The default templates that Article Manager comes with make use of a lot of SSIs. Category lists, headline pages, and a search form are included on every page a web visitor would see. Includes and Dynamic Page RenderingSome pages are generated dynamically by search.cgi and view.cgi, such as search results and archived pages. Article Manager can render includes in one of two ways: through "template includes"; or by parsing SSI. This is determined by the Dynamic Page Rendering options in Setup Options/General. Option 1: Resolve SSIs and Server-side Scripting In addition to SSI tags, scripts (such as ASP or PHP code) or anything else your server can resolve in a static page will be resolved in pages returned by search.cgi and view.cgi. These pages will be interpreted based on the "Publish file extension" setting in the setup options - if your published pages are being created as .asp files, the software will interpret your dynamically-generated pages as .asp files as well. These dynamic pages should function exactly the same as static pages in nearly every respect. Example SSIs: Depending on your server configuration, your SSIs could look like one of the following: <!--#include virtual="/webroot_path_to/publish/include.txt"-->Article Manager Includes: For including files published by Article Manager (such as headlines files, category list, etc.) your SSI code should use the $publishdir_virtual$ placeholder to automatically set the virtual path to the publish directory. Your includes should look something like this: <--#include virtual="$publishdir_virtual$$file_gcategories$"--> Option 2: Resolve "template include" tags - deprecated in 1.32 If you are using template includes, every SSI tag in your templates should be mirrored a corresponding template include. If you are adding your own includes to the templates, note that template includes are relative to the publish folder. Template includes use the following format: <!-- template include : filename.html --> or |