filen name
filen name field
filen -
filen - field

Reference an article attached file by name.

filen name will display a link to the file.

<filen name field > will display the given field from the file record. A field of url will be a URL to the file.

If the file identifier given doesn't exist for the current article the empty string is returned, allowing use as ifFilen.

The result is unspecified if the field specified isn't one of the image record field names and isn't url.

iterator begin files
iterator begin files named /foo/
iterator begin files filter: FILE[file_handler] eq 'flv'
file field

Iterate over files attached to the current article.

<:file field:> can only access simple attributes.

<:filen - field:> can also access any inline representations.

iterator: crumbs/crumb

Iterators over the ancestor tree from the article parent to the root.

Parameters include:

The default depends on the value of $Constants::UNLISTED_LEVEL1_IN_CRUMBS.


NAME

  Generate::Article - generates articles.


SYNOPSIS


DESCRIPTION


TAGS

Tag notes

In your HTML each tag will be preceded by <: and followed by :>

Tags marked as conditional will require a little more. Conditional tags can be used in two ways:

<:ifName args:>true text<:or:>false text<:eif:>

or:

<:if Name args:>true text<:or Name:>false text<:eif Name:>

Tags starting iterator ... are used as iterators, like:

<:iterator begin name:> repeated text <:iterator separator name:> separator text <:iterator end name:>

In general, a parameter which can be any one of 'article', 'parent' or 'section'. In a child iterator it can also be 'child'. In a crumbs iterator it can also be 'crumbs'. If which is missing it means the current article.

Normal tags

article name

Access to fields of the article. See Article attributes.

parent name

Access to fields of the parent article. See Article attributes.

ifParent

Conditional tag, true if there is a parent.

section name

Access to the fields of the section containing the article. See Article attributes.

title which

The title of the article presented as an image if there is a titleImage or as text. See Tag notes for values for which.

ifTitleImage which

Conditional tag, true if the given article has a titleImage,

thumbnail which class

The thumbnail image as an <img> tag for object which where which is one of the article objects defined. The optional class adds a class attribute to the tag with that class.

ifThumbnail which

Conditional tag, true if the article specified by which has a thumbnail.

ifUnderThreshold
ifUnderThreshold stepkids
ifUnderThreshold allkids

Conditional tag, true if the number of children/stepkids/allkids is less or equal to the article's threshold.

body

The formatted body of the article.

keywords

Ignore this one.

iterator ... crumbs [option]

Iterates over the ancestors of the article. See the item crumbs.

option can be empty, "listedonly" or "showtop". If empty the display of an unlisted level1 ancestor is controlled by $UNLISTED_LEVEL1_IN_CRUMBS, if "listedonly" then an unlisted level1 article isn't shown in the crumbs, and it is if "showtop" is the option. This can be used in <: ifCrumbs :> too.

crumbs name

Access to the fields of the specific ancestor. name can be any of the Article attributes.

ifCrumbs [options]

Conditional tag, true if there are any crumbs.

See iterator ... crumbs [option] for information on option.

ifChildren

Conditional tag, true if the article has any children.

iterator ... children

Iterates over the children of the article. See the item child.

child name

Access to the fields of the current child.

summary

Produces a processed summary of the current child's body.

ifPrevChild

Conditional tag, true if there is a previous child. Originally used for generating a move up link, but you can use the moveUp tag for that now.

ifNextChild

Conditional tag, true if there is a next child. Originally used to generating a move down link, but you can use the moveDown tag for that now.

ifCurrentPage which

Conditional tag, true if the given which is the page currently being generated. This can be used to apply special formatting if a level1 or level2 article is the current page.

iterator ... images

Iterates over the unnamed images for the given article.

iterator ... images all

Iterates over all images for the article.

iterator ... images named

Iterates over the named images for the article.

iterator ... images named /regexp/

Iterates over images with names matching the given regular expression. Note that if the expression matches an empty string then unnamed images will be included.

image which field

Extracts the given field from the specified image.

which in this can be either an image index to access a specific image, or "-" to access the current image in the images iterator.

The image fields are:

articleId

The identifier of the article the image belongs to.

image

A partial url of the image, relative to /images/.

alt

Alternative text of the image.

width
height

dimensions of the image.

url

the url if any associated with the image

image which align
image which
image

Produces HTML to render the given image.

which can be an image index (1, 2, 3...) to select one of the images from the current article, or '-' or omitted to select the current image from the images iterator. If align is present then the align attribute of the image is set.

If the image has a URL that <a href="...">...</a> will also be generated.

ifImage imageindex

Condition tag, true if an image exists at the given index.

ifImages
ifImages all

Conditional tag, true if the article has any images.

ifImages named

Conditional tag, true if the article has any named images.

ifImages named /regexp/

Conditional tag, true if the article has any named images, where the name matches the regular expression.

ifImages unnamed

Conditional tag, true if the article has any unnamed images.

embed child

This has been made more general and been moved, see embed child in the Generate manpage.

ifDynamic

Tests if the article is dynamically generated.

top field

Toplevel article being generated. This is the page that any articles are being embedded in.

iterator ... files

Iterates over the files attached to the article, setting the file tag.

file field

Information from the current file in the files iterator.

The file fields are:

Article attributes

id

Identifies the article.

parentId

The identifier of the parent article.

title

The title of the article. See the title tag

titleImage

The name of the title image for the article, if any. See the title and ifTitleImage tags.

body

The body of the article. See the body tag.

thumbImage
thumbWidth
thumbHeight

The thumbnail image for the article, if any. See the thumbnail tag.

release
expire

The release and expiry dates of the article.

keyword

Any keywords for the article. Indexed by the search engine.

link
admin

Links to the normal and adminstrative versions of the article. The url tag defined by Generate.pm will select the appropriate tag for the current mode.

threshold

The maximum number of articles that should be embeded into the current article for display. See the ifUnderThreshold tag.

summaryLength

The maximum amount of text displayed in the summary of an article. See the summary tag.

generator

The class used to generate the article. Should be one of Generate::Article, Generate::Catalog or Generate::Product.

level

The level of the article. Sections are level1, etc

listed

How the article is listed. If zero then the article can only be found in a search. If 1 then the article is listed in menus and article contents, if 2 then the article is only listed in article contents.

lastModified

When the article was last modified. Currently only used for display in search results.

lastModifiedBy

Set the the current admin user logon if access_control is enabled in the cfg.

created

Set to the current date time when a new article is created.

createdBy

Set to the current admin user logon if access_control is enabled in the cfg.

author

A user definable field for attributing the article author.

pageTitle

An alternate article title which can be used to make search engine baited oage titles.

metaDescription

Article metadata description, used as metadata in the generated HTML output.

metaKeywords

Article metadata keywords, used as metadata in the generated HTML output.

The following attributes are unlikely to be used in a page:

displayOrder

Used internally to control the ordering of articles within a section.

imagePos

The position of the first image in the body. The body tag will format images into the body as specified by this tag.

template

The template used to format the article.

flags

Flags which can be checked by code or template tags to control behaviours specific the the article.

force_dynamic

Forces a page to be displayed dynamically with page.pl regardless of access control.

inherit_siteuser_rights

Controls whether the article inherits its parents access controls.

Admin tags

The following tags produce output only in admin mode.

admin

Produces buttons and links used for administering the article.

moveUp

Generates a move up link if there is a previous child for the current child.

moveDown

Generates a move down link if there is a next child for the current child.

admin

Produces buttons and links used for administering the article.

This tag can use a specialized template if it's available. If you call it with a parameter, <:admin template:> then it will use template admin/adminmenu/template.tmpl. When used in an article template <:admin:> behaves like <:admin article:>, when used in a catalog template <:admin:> behaves like < <:admin catalog: >>, when used in a product template <:admin:> behaves like <:admin product:>. See Admin Menu Templates for the tags available in admin menu templates.

If the template doesn't exist then the old behaviour applies.

Admin Menu Templates

These tags can be used in the templates included by the <:admin:> tag.

The basic template tags and ifUserCan tag can be used in admin menu templates.

article field

Retrieves a field from the current article.

parent field

Retrieves a field from the parent of the current article.

ifParent

Conditional tag, true if the current article has a parent.

ifEmbedded

Conditional tag, true if the current article is embedded in another article, in this context.