NAME
Konstrukt::Doc::Basics - General website organization and tag syntax
WEBSITE ORGANIZATION
You create websites as simple as you would do with plain HTML: Each page is defined as a file in your document root and may contain any HTML tags and Konstrukt tags.
A typical organization would look like this:
cache/ #the directory where the objects get cached
\- ...
logs/ #your apache logs might be stored here
|- access.log
\- error.log
page/ #the document root: all your pages and \
|- blog/ #templates are stored here
| \- index.html
|
|- guestbook/
| \- index.html
|
| ...
|
\- templates/ #all templates are stored in docroot/templates
|- blog/ #blog templates
| |- layout/
| | \- ...
| |
| \- messages/
| \- ...
|
|- guestbook/ #guestbook templates
| \- ...
|
\- layout.template #the global layout template
All static content (page definitions, templates, images, stylesheets) will be stored in files in your directory structure. All dynamic content, which is accessed by plugins like blog
or guestbook
, will usually be stored in a database.
KONSTRUKT TAG SYNTAX
The HTML files are augmented with some special Konstrukt tags.
Plugin Tags
Most important are plugin tags. They start with <&
and end with &>
:
<& some_plugin &>some content<& / &>
This will call the plugin some_plugin
, which will process the encapsulated content some content
. The tag and the content will be replaced by the plugins result.
Example:
<& upcase &>
foo
bar
baz
<& / &>
Result:
FOO
BAR
BAZ
You can also define tag attributes as you can for HTML tags:
<& some_plugin attribute="value" &>
Each opening tag must be closed with <& / &>
. You can also specify singleton tags without a content as you can do in XML/XHTML:
<& some_plugin / &>
which is identical to
<& some_plugin &><& / &>
Nested Tags
You can can nest the tags/plugins.
Example:
<& upcase &>
<& sortlines &>
foo
bar
baz
<& / &>
<& / &>
Result:
BAR
BAZ
FOO
You can even nest tags inside other tag definitions:
<& some_plugin attribute="<& other_plugin / &>" / &>
Comments
Comments will be defined just as in HTML:
<!-- <& this_plugin wont="be executed" / &> -->
If you want to remove content/text from the page, so that the client will not see it, you can use the kill plugin:
<& kill &>this text won't be delivered to the client<& / &>
Other Tags
Of course there can be other tags as well. For example the template plugin uses additional tag types to define variable fields, lists and values:
<& template src="..." &>
<$ some_var $>some value<$ / $>
<& / &>
These additional tags, if exist, will be described in the documentation of each plugin.
AUTHOR
Copyright 2006 Thomas Wittek (mail at gedankenkonstrukt dot de). All rights reserved.
This document is free software. It is distributed under the same terms as Perl itself.
SEE ALSO
Next: Konstrukt::Doc::Templating
Previous: Konstrukt::Doc::Installation, Konstrukt::Doc::About
Parent: Konstrukt::Doc