Re: [pmwiki-users] Problem with PTV in Pagelists

2010-05-28 Thread Ian Barton

On 28/05/10 14:43, Eemeli Aro wrote:

On 28 May 2010 16:32, Ian Barton  wrote:

{(ftime fmt="%A, %B %d, %Y" when='{=$Name}')} doesn't appear to work, see
the page referenced above for the output.


On the page itself, you need to use {$Name} or {*$Name}.

{=$Name} is required in the pagelist template to refer to the name of
page being listed at the moment.

eemeli


Thank you. Page list now working!

Ian.

___
pmwiki-users mailing list
pmwiki-users@pmichaud.com
http://www.pmichaud.com/mailman/listinfo/pmwiki-users


Re: [pmwiki-users] Problem with PTV in Pagelists

2010-05-28 Thread Eemeli Aro
On 28 May 2010 16:32, Ian Barton  wrote:
> {(ftime fmt="%A, %B %d, %Y" when='{=$Name}')} doesn't appear to work, see
> the page referenced above for the output.

On the page itself, you need to use {$Name} or {*$Name}.

{=$Name} is required in the pagelist template to refer to the name of
page being listed at the moment.

eemeli

___
pmwiki-users mailing list
pmwiki-users@pmichaud.com
http://www.pmichaud.com/mailman/listinfo/pmwiki-users


Re: [pmwiki-users] Problem with PTV in Pagelists

2010-05-28 Thread Ian Barton

On 28/05/10 12:56, Eemeli Aro wrote:
> On 28 May 2010 14:37, Ian Barton  wrote:
>> The pagelist displays the next five events in the Calendar group. The
>> problem is with $JournalDateTitle. This splits the filename from
>> Calendar.201005028 into a more human readable format. It displays 
correctly
>> when I use it on a page in the calendar group, but not displayed in 
a side
>> bar on the front page. This worked OK with the previous version of 
PmWiki

>> that I had installed.
>
> Where's $JournalDateTitle coming from? Is it some custom code that's
> generating it, as it doesn't appear on the page sources?
>
> I'd recommend instead using the standard MarkupExpression ftime:
>
> {(ftime fmt="%A, %B %d, %Y" when='{=$Name}')}
>
> instead of {=$JournalDateTitle}.

It's a custom function (see end of message). It's designed to return a 
human readable date from the Page name e.g. News.20100527 would give 
Thursday, 27 May 2010.


If you look at http://www.dodcott-cum-wilkesley.co.uk/wiki/News/20100527 
you can see that it works in the base page, but not when used in a pagelist.


I don't normally write php and it's been a couple of years since I set 
up this site. As it's always worked OK before the latest upgrade, my 
memory of why I did it that way is a bit rusty:)


{(ftime fmt="%A, %B %d, %Y" when='{=$Name}')} doesn't appear to work, 
see the page referenced above for the output.


Thanks for your help.


# Title that appears as at the top of each entry.
$FmtPV['$JournalDateTitle'] = 'TitleToDate2($pagename)'

function TitleToDate2($pagename) {
$tname = 
preg_replace("/[^.]*\.([\d\-]*)(.*)/e","'$1'==''?'$2':'$1'",$pagename);

preg_match("/([\d]*)[-]?([\d]*)[-]?([\d]*)/e",$tname,$m);

$year = (integer) substr($tname, 0, 4);
$month = (integer) substr($tname, 4, 2);
$day = (integer) substr($tname, 6, 2);

   $tdate=  mktime(0, 0, 0, $month, $day, $year);


$bmonth = strftime("%A, %d %B %Y",$tdate);
return $bmonth;
}

___
pmwiki-users mailing list
pmwiki-users@pmichaud.com
http://www.pmichaud.com/mailman/listinfo/pmwiki-users


Re: [pmwiki-users] Problem with PTV in Pagelists

2010-05-28 Thread Eemeli Aro
On 28 May 2010 14:37, Ian Barton  wrote:
> The pagelist displays the next five events in the Calendar group. The
> problem is with $JournalDateTitle. This splits the filename from
> Calendar.201005028 into a more human readable format. It displays correctly
> when I use it on a page in the calendar group, but not displayed in a side
> bar on the front page. This worked OK with the previous version of PmWiki
> that I had installed.

Where's $JournalDateTitle coming from? Is it some custom code that's
generating it, as it doesn't appear on the page sources?

I'd recommend instead using the standard MarkupExpression ftime:

{(ftime fmt="%A, %B %d, %Y" when='{=$Name}')}

instead of {=$JournalDateTitle}.

eemeli

___
pmwiki-users mailing list
pmwiki-users@pmichaud.com
http://www.pmichaud.com/mailman/listinfo/pmwiki-users


[pmwiki-users] Problem with PTV in Pagelists

2010-05-28 Thread Ian Barton
I have just upgraded my PmWiki to the latest stable 2.2.16 from a 
previous 2.x version. I am now having a problem using page text 
variables in page lists. I am presuming that this is caused by a change 
in behavior, but can't work out how to fix it.


My page list looks like this:

(:pagelist group=Calendar if="date {(ftime %Y%m%d)}.. {=$Name}" count=5 
fmt=#calendar order=name -Calendar.HomePage -RecentChanges:)


the format command looks like:

[[#calendar]]
||'''[[{=$FullName}| {=$JournalDateTitle}]]'''||

(:include {=$FullName} lines=2:)

(:if ! equal {>$Group}:)
-
(:if:)
[[#calendarend]]

The pagelist displays the next five events in the Calendar group. The 
problem is with $JournalDateTitle. This splits the filename from 
Calendar.201005028 into a more human readable format. It displays 
correctly when I use it on a page in the calendar group, but not 
displayed in a side bar on the front page. This worked OK with the 
previous version of PmWiki that I had installed.


You can see the site at: http://www.dodcott.org/wiki/

Ian.

___
pmwiki-users mailing list
pmwiki-users@pmichaud.com
http://www.pmichaud.com/mailman/listinfo/pmwiki-users