X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/c30f0dda9f63120405b3188aba167a61ec99216d..97819910b83aed6784e78cc28554584785d92497:/doc/plugins/contrib/getfield.mdwn diff --git a/doc/plugins/contrib/getfield.mdwn b/doc/plugins/contrib/getfield.mdwn index 929f70485..61e80c58a 100644 --- a/doc/plugins/contrib/getfield.mdwn +++ b/doc/plugins/contrib/getfield.mdwn @@ -18,15 +18,15 @@ use per-page structured data, where each page is treated like a record, and the structured data are fields in that record. This can include the meta-data for that page, such as the page title. -This plugin is meant to be used in conjunction with the **field** plugin. +This plugin is meant to be used in conjunction with the [[field]] plugin. ### USAGE One can get the value of a field by using special markup in the page. This does not use directive markup, in order to make it easier to -use the markup inside other directives. There are two forms: +use the markup inside other directives. There are four forms: -* {{$*fieldname*}} +* \{{$*fieldname*}} This queries the value of *fieldname* for the source page. @@ -39,7 +39,27 @@ use the markup inside other directives. There are two forms:
Stuff about A.
+* \{{+$*pagename*#*fieldname*+}} + + This queries the value of *fieldname* for the page *pagename*; the + only difference between this and \{{$*pagename*#*fieldname*}} is + that the full name of *pagename* is calculated relative to the + destination page rather than the source page. + + I can't really think of a reason why this should be needed, but + this format has been added for completeness. + +### Escaping + +Getfield markup can be escaped by putting a backwards slash `\` +in front of the markup. +If that is done, then the markup is displayed as-is. + +### No Value Found + +If no value is found for the given field, then the field name is returned. + +For example: + +On PageFoo: + + \[[!meta title="Foo"]] + My title is {{$title}}. + + My description is {{$description}}. + +When PageFoo is displayed: + +My title is Foo.
+ +My description is description.
+ +This is because "description" hasn't been defined for that page. + ### More Examples Listing all the sub-pages of the current page: \[[!map pages="{{$page}}/*"]] -### LIMITATIONS - -One cannot query the values of fields on pages other than the current -page or the destination page. - ## DOWNLOAD * browse at GitHub: