phpWCMS open source web content management system
This is the outdated phpwcms project site.
Something new is coming soon. Always keep in mind to check GitHub for the newest release.
phpwcms Replacement Tags
A flexible tool for special content parts

phpwcms is a flexible tool for storing and editing different types of content. It comes with many predefined content type editors. But often it is simply to much and you might wish to have a basic snippet of code that represents a special function or returns additional or extended content parts. Replacement tags are implemented for this reason in the content parser. The following text will describe every available phpwcms replacement tag. You can use replacement tags anywherwe: in headlines, subheadlines, summary, templates and so on.


{CONTENT}

Returns the complete article content. If you have inserted code in template's main block you have to use this tag anywhere in the template. Use this only once.


{BREADCRUMB}

Generates a breadcrumb menu like the one on top of this page.


{NAV_TABLE_SIMPLE}

Creates a simple navigation table based on the currect structure level.


{NAV_TABLE_COLUMN}

Produces a complete menu - the same as on the left.


{SPACER:widthxheight}

This will create a spaceholder HTML image tag (transparent GIF).
Sample: {SPACER:10x5} = <img src="img/leer.gif" border="0" width="10" height="5">


{PHP:my_external.php}

All output of "my_external.php" script will be inserted. This is very powerful. You can use any availabe content var of phpwcms for your script or connet to other external sources.
Sample: <?php echo PHP_VERSION." // date: ".date("Y-m-d"); ?> =
output: 5.6.38-nmm2 // date: 2019-06-16


{IMAGE:imagename}

With the help of this replacement tag you can easy insert an image anywhere in content. It returns a standard HTML image tag.
Sample: {IMAGE:doc/5.gif}

{IMAGE_LEFT:imagename}

With the help of this replacement tag you can easy insert an left aligned image anywhere in content.
Sample: {IMAGE_LEFT:banner/phpwcms_88x31.gif}

{IMAGE_RIGHT:imagename}

With the help of this replacement tag you can easy insert an right aligned image anywhere in content. It returns a standard HTML image tag.
Sample: {IMAGE_RIGHT:banner/phpwcms_80x15.gif}

The base directory for these 3 tags is "picture", located in the phpwcms root dir. You can use other path values, e.g. for parent dir use "../"


[ID integer]string[/ID]

This creates a HTML link to an article with ID (integer). String represents the text that is linked. Sample: [ID 4]read this[/ID] > read this

[ID string]string[/ID]

This creates a HTML link to a structure level with ALIAS (string). Second string represents the text that is linked. Sample: [ID news]read news[/ID] > read news

[EXT url]string[/EXT]

Creates an link to URL (opens in a new browser window) around the string.
Sample: [EXT http://www.apple.com]goto Apple[/EXT] > goto Apple

[INT url]string[/INT]

Creates an link to URL (opens in same browser window) around the string.
Sample: [INT http://www.microsoft.com]visit MS[/INT] > visit MS


{RANDOM:image_path}

This is the replacement tag for a random image. Put this anywhere in text or template to show a random pic. Alle images inside the given image path are used. All jpg, jpeg, gif and png extended files are supported.
Sample: {RANDOM:picture/doc/smilies} random image: icon13.gif (reload page to see effect)

You should not use the old random image replacement tags anymore:
{RANDOM_GIF:path_GIFs}, {RANDOM_JPEG:path_JPEGs}, {RANDOM_PNG:path_PNGs}
There a php script (img/random_image.php) reads and delivers the images; slow because images will not be cached by webbrowser.


{DATE_LONG|MEDIUM|SHORT|ARTICLE}, {TIME_LONG|SHORT|ARTICLE}

Look at the samples and the "*" part — it's self-explanatory. The date and time format is set in "conf.template_default.inc.php". You can set different language for the month and dayname — at the moment supported: EN, DE, IT, FR (see the template config).

Sample:
{DATE_LONG} = Sunday, 16. June 2019
{DATE_MEDIUM} = Sun, 16. Jun 19
{DATE_SHORT} = 2019/06/16
{DATE_ARTICLE} = 2011/01/02
{TIME_LONG} = 17:41:13
{TIME_SHORT} = 17:41
{TIME_ARTICLE} = 10:23


[BACK]string[/BACK]

This creates the typical go 1 page back javascript link '<a href="javascript:history.back();" target="_top" alt="go back">string</a>'. Tip! String can also be an image.


[PRINT]string[/PRINT]

Creates a special link to the print layout of current page. Only {CONTENT} will be returned. There is a special CSS file for the print layout available that can be set to printer friendly formatting. String can be an image or text


[b][/b] [i][/i] [s][/s] [u][/u]

Use these to format your texts in any content. Maybe also if HTML tags are not allowed. These replacement tags corresponds with same HTML tags:
[b]bold[/b], [i]italic[/i], [s]strike[/s], [u]underline[/u]



More replacement tags in preparation

The development of replacement tags is in progress - there might be new available in current version. Check the forum too - I do not have time to fill in the documentation often. Sorry.