Thank you Peter. Unfortunately the "Language" part is variable in length. I suppose I'm looking for the equivalent of a "strpos" in expressions.
On 20 August 2012 13:11, Peter Bowers <[email protected]> wrote: > On Mon, Aug 20, 2012 at 1:30 PM, Brian Tibbels > <[email protected]> wrote: > > I need to truncate a page title for side bar presentation > > (:title Language - Full Page Title:) > > > > I need the text after " - ". > > If the "Language -" part is a constant length across all pages then > standard markup expressions with the {(substr ...)} would handle it. > > I'm guessing, however, that the length of the "Language -" part > changes. In that case you could use the {(reg_replace ...)} features > of MarkupExpressionPlus > (http://www.pmwiki.org/wiki/Cookbook/MarkupExprPlus) or the {(sed > ...)} features of WikiSh (http://www.pmwiki.org/wiki/Cookbook/WikiSh). > > Or you could come up with your own PV that hardcodes the deletion of > the text up to the dash: > > $FmtPV['$TitleShort'] = 'array_pop(explode(" - ", > FmtPageTitle(@$page["title"], $name, 1)))'; > > (There are probably more elegant ways to accomplish this last but this > should give you an idea where to start.) > > -Peter >
_______________________________________________ pmwiki-users mailing list [email protected] http://www.pmichaud.com/mailman/listinfo/pmwiki-users
