Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents

...


Conditional Blocks

From versions 5.2.16 & 5.4.12

##ConditionBlock.StringEquals.Start## and ##ConditionBlock.End## tags can be used in the Address Search Results Template to compare the results of two strings to perform one condition if they are equal and another if they aren't. The two strings are specified using the ##ConditionBlock.Property.One.Start and .End tags and the ##ConditionBlock.Property.Two.Start and .End tags as described in the sample syntax below. The ##ConditionBlock.Result.True.Start## and .End tags and ##ConditionBlock.Result.False.Start## and .End tags are used to describe the action to perform if the comparison is True or False respectively.

Code Block
##ConditionBlock.StringEquals.Start##
    ##ConditionBlock.Property.One.Start##abc##ConditionBlock.Property.One.End##
    ##ConditionBlock.Property.Two.Start##def##ConditionBlock.Property.Two.End##
    ##ConditionBlock.Result.True.Start##
        ... Code to run on true condition
    ##ConditionBlock.Result.True.End##
    ##ConditionBlock.Result.False.Start##
        ... Code to run on false condition
    ##ConditionBlock.Result.False.End##
##ConditionBlock.End##

The following is an example of displaying different information depending upon whether or not the ##PreviousURL## is blank or not.

Code Block
##ConditionBlock.StringEquals.Start##
	##ConditionBlock.Property.One.Start####PreviousURL####ConditionBlock.Property.One.End##
    ##ConditionBlock.Property.Two.Start####ConditionBlock.Property.Two.End##
    ##ConditionBlock.Result.True.Start##
        <a href="publisher.aspx?RequestType=ParseTemplate&template=addresssearch">Search again</a>
    ##ConditionBlock.Result.True.End##
    ##ConditionBlock.Result.False.Start##
        <a href="##PreviousURL##">Back</a>
    ##ConditionBlock.Result.False.End##
##ConditionBlock.End## 

PreviousURL & HistoryID Tags

With the introduction of the new ##BackURL## ##PrevousURL##, you can automatically create links with an ID included in order that it goes back to the previous page is a security concious method. Publisher automatically creates the entire link and replaces the ##BackURL## tag ##PrevousURL## tag with it.

Code Block
http://localhost/iShare/n.n/Web/publisher.aspx?requesttype=parsetemplate&template=AddressSearch_Results.tmplt&filter=%5eName%5e+ILIKE+%27%25+1%25%27%5e&pagerecs=10&useSearch=true&order=DATEAPRECV:ASCENDING&pageno=2&maxrecords=100&basepage=publisher.aspx&history=93958fed020f411d8326864cd71a6b8b

...

Template parameters

(New in 4.4)

:PARAM

To pass values into Publisher template pages you can use querystring parameters with names that end :PARAM. These can be specified directly in a link or in form fields (using method="GET").

...

Form Action Tags

(New in 4.4)

Magic 'RESUBMIT' template name

If the template name in the SearchResultsForm tag is RESUBMIT then the current template is used again and any options from the original search are reused, unless specified again in the tag.

All :PARAM parameters are reused and resubmitted. Any new values specified elsewhere in the form will be in addition to those already present.

Magic 'RESUBMITNOPARAMS' template name

This functions identically to using RESUBMIT with the exception that no :PARAM parameters are reused.

Parameter Tags

(New in 4.4)

Param

Values of :PARAM parameters in a request can be used in a page using ##Param.XXX## tags. For example this can pass parameters through from one page to another via a third or simply show the values in a page. The following examples are used when the request includes &easting:PARAM=100000&northing:PARAM=100000 to pass co-ordinates from one page to another via a Publisher URL in an intermediary:

...

As these tags are replaced in the text at an early stage in the template processing, they can be used to pass values into other tags, see Using parameters with Recordsets below.

ParamBlock

##ParamBlock.NAME.Start## and ##ParamBlock.NAME.End## tags can be used to block out a section of the template that is only used if a :PARAM parameter is found (i.e. is present and has a value). In the following example, the paragraph is only shown if both the easting and northing parameters are present:

...

Code Block
languagexml
titleParmBlock.Not Example
##ParamBlock.Not.easting.Start##
    <p>No easting supplied!</p>
##ParamBlock.Not.easting.End##
##ParamBlock.Not.northing.Start##
    <p>No northing supplied!</p>
##ParamBlock.Not.northing.End##

SearchQuery

The q:LIKE parameter contains the value to be used in the Lucene free-text search. It may be useful to display in the context of the current search results and this can be achieved through use of the ##SearchQuery## tag:

...

Like the ##Param.name## tags in that the ##SearchQuery## tag is replaced early and can be used by later parts of the template process.

SearchQueryBlock

This functions in a similar manner to the ##ParamBlock## tag outlined above. There is also a corresponding ##SearchQueryBlock.Not## tag block.

Recordsets

(New in 4.4)

FieldBlock

##FieldBlock.FIELD.Start## and ##FieldBlock.FIELD.End## tags can be used to block out a section of a RecordSet part of a template that is only used if a field has a value in the record.

...

Here the additional information is retrieved from another DataSource (filtered by the same criteria as its parent) when not available in the outer recordset.

WithParameter

Internal Function DataSources can be used to create recordsets, but they must have parameters specified and passed in the correct order. This is done through the use of ##WithParameter.name## tags.

...