[Pmwiki-users] Group/page descriptions

John Rankin john.rankin
Sun Aug 17 20:07:37 CDT 2003


We took a slightly different approach to a similar problem. We added the markup:

  [[para:SomeGroup.PageName#anchor]]

If #anchor is omitted, it returns the first paragraph of SomeGroup.PageName, after stripping off any initial markup characters like *,#,!,:

If #anchor in included, it returns the text immediately following the anchor up to the end of the paragraph.

I'd be happy to add this script to the cookbook, if anyone thinks it would be useful. 

We find it very useful for things like trail pages. It works correctly across groups, qualifying any unqualified WikiWords or {{free links}} with SomeGroup/ if SomeGroup is not equal to $pagename's group.

We also made an in-page version, that's useful for building cross-references on FAQ pages. It allows authors to pick up the text of a "Q" and use it to create a link at the top of the page to a paragraph further down the page. One use for this would be on the TextFormattingRules page.

This approach could be generalised to include a selected paragraph in a search results page in 2 ways:

- if a [[#desc]] anchor exists, use that paragraph

- otherwise (optionally) display the first paragraph

I imagine introducing 2 parameters to control the behaviour:

  $SearchDescriptionAnchor = "desc";  # defines the [[#anchor]] to look for
  $SearchDescriptionDefaultsToFirstPara = "0"; # whether or not to display the first paragraph

The search.php script would have to do a call to PrintText to process any markup, I guess...
-- 
John Rankin

On Monday, 18 August 2003 10:53 AM, Patrick R. Michaud <pmichaud at pobox.com> wrote:
On Sun, Aug 17, 2003 at 08:28:57PM +0200, Christian Ridderstr?m wrote:
> Here's a suggested markup code:
> * Defining the page description:
> 	[[$PageDescription = <description>]]

I'd prefer 

   =description <description> 
or
   =desc <description>

for describing the markup--it's a bit easier to parse and handle when
the page is rendered.  This would also be similar to the =title markup
that a few others are using to define longer titles, and it might allow
the description to contain other double-bracketed items.

> * Accessing the page description:
> 	[[$PageDescription SomeGroup.PageName]]

Another possibility would be [[description:SomeGroup.PageName]], which
would be similar to the [[include:...]] syntax that is used for
other items.

These are just suggestions...

Pm

_______________________________________________
Pmwiki-users mailing list
Pmwiki-users at pmichaud.com
http://pmichaud.com/mailman/listinfo/pmwiki-users_pmichaud.com






More information about the pmwiki-users mailing list