|
Cookbook /
ClipboardSummary: Include content on another page
Version: v0.50
Status:
Prerequisites: at least PmWiki version: 2.0, last tested on PmWiki version: 2.10
Maintainer: J. Meijer
Categories: Images
Get it here: clipboard.phpΔ Questions
Answers
Cut and Paste markups addedA clip is any text, that is treated by this plugin as a series of lines.
The clipname in (:cutend:) and (:copyend:) is optional. Controlling clipsCopy and Paste can take a number of parameters, allowing some control over the clip:
The parameters are processed in the order shown. Storage of clipsClips are stored in $XL['clip']['clip-<clipname>'] where <clipname> should be substituted with the name of the clip. You could load an XLPage in your config.php setting $XL['clips'] from that page. You can also set clips from the url by preceeding the clipname with 'clip-'. F.e. pmwiki.php?n=Group.Page?clip-myclip=mycliptext Makes myclip available to the page. You can then paste it into the page-text and thus personalize the page. Testing for clipsTo test is clip myclip exists write (:if clip myclip:). Template filling markupsClips can be used as templates and filled from a list or another clip.
Within the template (:item:) is replaced by the current item (line), and (:index:) by the current line-number. You can place (:begin:) and (:end:) markups to limit expansion to the delimited areas. As an example, this clip (formatted for inclusion into an XLPage) implements a small gallery template: 'clip-gallery' => '(:nl:)||border=1 cellspacing=0 (:nl:)(:begin:)|| %thumb newwin% [[Attach:(:item:).jpg | Attach:(:item:).jpg]] (:end:)' To use it to make two rows of 5 thumbnails you write: (:for foto1,foto2,foto3,foto4,foto5 do gallery:) Note: no need to specify .jpg extensions, this is taken care of.
Note: it would be nice if pagelists could dump their result in a clip, so a range of pages can act as the data-source for template filling. Soon to be added.
Notes
Releases
CommentsFor markup breaks when name includes dashThis works (:for name1,name2 do clipname:) This doesn't work (:for name-1,name-2 do clipname:) To include dashes in for names try changing line 156, these characters: :for ([a-zA-Z0-9]+ to :for ([a-zA-Z0-9-]+ It doesn't seem to break anything. Author's note:Changes to API expected soon. I'll be mostly off-line. See AlsoSpecial purpose scripts: Email introducing basic (non-template) features: clipboard.txtΔ |