writer

toc
`writer' tags A writer is a tag that can produce output. Normally the default will be to written to the page, unless the tag has a body. All tags which produce output themselves are `writers'. This is contrary to tags which don't produce output, but only produce contextual information (e.g. mm:cloud, mm:node), or programmatic tools (e.g. mm:present, mm:import, mm:list)
see alsowrite | writerreferrer
attributes
  • jspvar
    The name of the variable to be created. Normally, but not always, the scope of this variable is the body of the tag. This attribute can never contain context variables.
  • vartype

    The type of the variable to be created. Usually there is a reasonable default for this attribute. This attribute can never contain context variables.

    The value of this is used for the `jspvar' if you create it, but it is also used for the 'context' variables. It is less often essential then, but it is essential to set it right e.g. when you want to use the `isgreaterthan' tag, because strings compare differently than numbers.


    see: isgreaterthan
    Objectjava.lang.Object
    Stringjava.lang.String
    Nodeorg.mmbase.bridge.Node
    Cloudorg.mmbase.bridge.Cloud
    Transactionorg.mmbase.bridge.Transaction
    decimaljava.math.BigDecimal
    Integerjava.lang.Integer
    Vectorjava.util.Vector. It's better to use List, normally.
    Listjava.util.List
    Longjava.lang.Long
    Doublejava.lang.Double
    Floatjava.lang.Float
    Datejava.util.Date
    Fieldorg.mmbase.bridge.Field
    FieldValueorg.mmbase.bridge.FieldValue
    Booleanjava.lang.boolean
    fileitemorg.apache.commons.fileupload.FileItem. Can be used in multipart file uploads (comfortable in combination with EL)
  • write
    Whether to write to the page or not. Normally the default value will suffice. If you don't write to the page, the produced string can e.g. be used by sub tags, or only written to a context variable.
    true
    false
  • escape (since: MMBase-1.7)
    Override the default escape behaviour determined by the surrounding Content-tag.
    Escaper
    text/plainThis equals no escaping
    noneNo escaping
    text/htmlEscapes for use in HTML.
    text/html/attributeEscapes for use in HTML atributes
    text/xmlEscapes for use in XML (or XHTML).
    inlineInterpret as 'enriched' ASCII for 'inline' HTML parts (so no blocks)
    pInterpret as 'enriched' ASCII for 'block' HTML parts. It normally generates one or more p-tags (everything is enclosed by a p tag, including lists).
    ppAs 'p', but only one sequences of one br-tags are produced
    p-ommit-surroundingas p, but surrounding p /p tags are omitted (you must place them by hand). This can be needed for 'read-more' links.
    pp-ommit-surrounding
    plInterpret as 'enriched' ASCII for 'block' HTML parts. It normally generates one or more p-tags. Lists (ul tags) are placed outside the paragraphs. As such a block may start or end with an ul tag.
    pplAs 'p2', but only one sequences of one br-tags are produced
    pl-ommit-surroundingas p2, but surrounding p /p tags are omitted (you must place them by hand).
    ppl-ommit-surroundingas pp2, but surrounding p /p tags are omitted (you must place them by hand).
    wikiGenerates piece of XHTML2 compatible XML
    sqlEscapes for use in SQL (escaping of quotes). You will _not_ have to use this if use mm:constraint.
    js-single-quotesEscapes single quotes for use in Javascript (with \').
    js-double-quotesEscapes double quotes for use in Javascript (with ").
    js-both-quotesEscapes both quote types (' and ") for use in Javascript (with \').
    urlEscapes for use in an URL (using escaping with %). When you use mm:url with mm:param tags you will not have to use this.
    urlparamSimilar to 'url' but also escapes '+'
    uppercaseConverts to all uppercase.
    lowercaseConverts to all lowercase.
    identifierReplaces anything which is not alphanumeric by underscores.
    censorFinds and replaces 'forbidden' words.
    swallowEverything disappears
    linksFinds and makes clickable URL's.
    plainlinksFinds and makes clickable URL's, assuming plain/text input.
    figletFilters through the command-line tool 'figlet', which can have amusing results.
    trimmerTrims leading and trailing whitespace
    cp1252 Escapes the CP1252 characters which are not in ISO-8859-1. You don't want to serve your pages as CP1252 (it is not a standard encoding). It is adviceable to do it using UTF-8, but if you really want to use ISO-8859-1, you can create reasonable surrogates by this (nicer then question marks).
    cp1252wrong Escapes the CP1252 characters, but suppose that the String was originally wrongly encoded (CP1252 bytes were incorrectly supposed ISO-8859-1)
    spaceremover Replace 1 or more white space characters by one space, unless, those are the first or last of the string, those are replaced with nothing.
    spaceswallower Removes all whitespace.
    roman This works on integers only, and converts them to a roman numbers (lowercase, so see also 'uppercase'). This works only for natural numbers smaller than 4000.
    rot13 Performs 'rot 13' encoding of the string, to scramble letters. Can be decoded by doing a rot13 again.
    rot5 Performs 'rot 5' encoding of the string. This scrambles the digits.
    md5
    adler32 Performs a 'adler32' checksum.
    crc32 Performs a 'crc32' checksum.
    java Escapes non-ASCII characters to java escape sequences.
    reducespace

    Replaces groups of one and more newlines by one new line, and one or more space by one space. This spares bandwidth and makes the result better readable.

    This is default for most XML-like content types.

    entitiesAny non-ASCII character will be replaced by an XML-entity.
    xmetodoReplaces ?, ?, ?, ?, ?, ? with cx, gx, hx, jx, sx, ux
    hmetodoReplaces ?, ?, ?, ?, ?, ? with ch, gh, hh, jh, sh, u
    perl Interpret the complete body as a perl program, and write the result.
    sitestat Rewrites the input to the characters which are alowed in Sitestat keys for page statistics, being: "A-Z, a-z, 0-9, - . _".

    The value can also refer to the id of an escaper tag


    see: content | escaper | format attribute of formatter
tags of this typealiaslist | attachment | cloudinfo | countrelations | depth | field | fieldinfo | formatter | function | image | treeinclude | leafinclude | include | index | info | listfunction | nextbatches | nodeinfo | previousbatches | property | setting | shrink | size | stringlist | time | link | treefile | leaffile | url | write