[pmwiki-users] (no subject)

H. Fox haganfox at users.sourceforge.net
Wed Apr 11 16:56:36 CDT 2007


On 4/11/07, Dave Cooke <david at ellendee.co.uk> wrote:
> J. Meijer <commentgg <at> hotmail.com> writes:
>
> >
> >
> >
> > You may try this:  # use {$FullTitle} in page;list templates
> etc$FmtPV['$FullTitle'] = $FmtPV['$Title'];   # {$Title} is now for exclusive
> use in pagelist, leading A & The stripped$FmtPV['$Title'] =
> "preg_replace('^(A|The) ','',".$FmtPV['$Title'].")";What it does is substitute
> {$Title} with a version that strips leading A & The. Pagelists will use this
> value and therefore sort correctly. The original {$Title} is still available as
> {$FullTitle}. Use this in pagelist templates and page text. Hope this helps,/jm
> > On 4/11/07, david <at> ellendee.co.uk <david <at> ellendee.co.uk> wrote:I'm
> putting together a couple of sites. One involves titles of books andthey both
> involve peoples names. For the titles I need to ignore a leading'A' or 'The'
> when sorting and for the names I'd like to sort on surname(last 'word' in
> title).Are these possible?
> >
>
> Thanks, but when I tried it all I got were repeating lines of Warning:
> preg_replace(): No ending delimiter '^' found in
> /home/ellendee/public_html/FolkLyrics/pmwiki.php(664) : eval()'d code on line 2

Try

$FmtPV['$Title'] = "preg_replace('/^(A|The) /','',".$FmtPV['$Title'].")";

Hagan



More information about the pmwiki-users mailing list