Versions Compared

Key

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

Table of Contents

...

PreviousURL & HistoryID Tags

With the introduction of the new ##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 ##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

...

The downside of this is that it's sometimes advantageous to be able to craft you own custom links, but it wasn't possible to add the new ID to the link. Hence, the introduction of the ##HistoryID## tag.
Now you can now create your own custom link and have the History ID automatically inserted into it by using something like:

 

Code Block
http://localhost/iShare/n.n/Web/publisher.aspx?template=AddressSearch_Results.tmplt&requestType=parseTemplate&history=##HistoryID##

 

Which would produce something like the following:

 

Code Block
http://localhost/iShare/n.n/Web/publisher.aspx?template=AddressSearch_Results.tmplt&requestType=parseTemplate&history=93958fed020f411d8326864cd71a6b8b

 

Template parameters

(New in From version 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 From version 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 From version 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.

...

Using parameters with Recordsets

(New in From version 4.4)

As ##Param## substitution occurs early in the template processing - (see Processing Order), their values are already replaced by the time the ##Filter## and ##OrderBy## tags are used. This means that, for example, the filter’s field name, filter value, sort field’s name and sort direction can be dynamically updated through use of parameters, e.g.:

...