[pmwiki-users] PageListTemplates recipe extended

Martin Fick fick at fgm.com
Wed Oct 26 15:30:33 CDT 2005


On Sat, Oct 22, 2005 at 12:08:46PM +0200, Daniel Scheibler wrote:
> Hello,
> 
> I extend the PageListTemplates recipe.
> Now are six new custom variables available:
> {$PageList.NameSpaced}
> {$PageList.GroupSpaced}
> 
> {$PageList.NextNameSpaced}
> {$PageList.NextGroupSpaced}
> 
> {$PageList.PreviousNameSpaced}
> {$PageList.PreviousGroupSpaced}
> 
> The updated recipe is available at
> http://www.pmwiki.org/wiki/Cookbook/PageListTemplates
> 
> Greets,
> 
> Daniel Scheibler


  Great!


  I have updated it again slightly so that the new variables
you have added are loaded on demand if they are not set
already.  I have been meaning to add every variable that I
can think of, the on demand stuff was holding me back a
little.  

  Since it is now ready for more variables, I have a naming
question. It seems like the variable names might be too long
and hard to remember/type.  If I add more, this risks
getting even worse, any ideas/suggestions on this?

  I was thinking of dishing the 'PageList' prefix in favor
of 'Page', 'Prev', 'Next', 'Is' and 'Count' like this:


   Current Name                                Suggested New Name
   
   {$PageList.Name}                            {$Page.Name} 		 
   {$PageList.NameSpaced}                      {$Page.NameSpaced}		 
   {$PageList.Group}                           {$Page.Group}		 
   {$PageList.GroupSpaced}                     {$Page.GroupSpaced}  	 
   {$PageList.LastModified}                    {$Page.LastModified} 	 
   {$PageList.LastModifiedBy}                  {$Page.LastModifiedBy}	 
                                                				 

   {$PageList.PreviousName}                    {$Prev.Name} 	 
   {$PageList.PreviousNameSpaced}              {$Prev.NameSpaced}	 
   {$PageList.PreviousGroup}                   {$Prev.Group}	 
   {$PageList.PreviousGroupSpaced}             {$Prev.GroupSpaced}   
   {$PageList.PreviousLastModified}            {$Prev.LastModified}  
   {$PageList.PreviousLastModifiedBy}          {$Prev.LastModifiedBy}
                                                				 

   {$PageList.NextName}                        {$Next.Name}		 
   {$PageList.NextNameSpaced}                  {$Next.NameSpaced}	 
   {$PageList.NextGroup}                       {$Next.Group}		 
   {$PageList.NextGroupSpaced}                 {$Next.GroupSpaced}	 
   {$PageList.NextLastModified}                {$Next.LastModified}	 
   {$PageList.NextLastModifiedBy}              {$Next.LastModifiedBy}	 
                                                				 

   {$PageList.FirstGroupPage}                  {$Is.FirstGroupPage}	 
   {$PageList.LastGroupPage}                   {$Is.LastGroupPage}	 
   {$PageList.FirstPage}                       {$Is.FirstPage}		 
   {$PageList.LastPage}                        {$Is.LastPage}		 
                                                				 

   {$PageList.PageCount}                       {$Count.Pages}	  
   {$PageList.GroupPageCount}                  {$Count.GroupPages} 
   {$PageList.GroupCount}   		       {$Count.Groups}	

  I'm not sure I like the 'Page' prefix, but 'Cur' just
seems lame.  Any other suggestions?  Is there any reason to
keep the stict namespace separation with the 'PageList'
prefix, or is it simply overkill?
  

  After this I would add all the stats available within the
page array.  I might then suggest something like:

   {$Page.LastModified.Time}
   {$Page.LastModified.Host}
   {$Page.LastModified.Author}
   {$Page.LastModified.Agent}

   {$Page.Title}   
   {$Page.TitleSpaced}
   {$Page.Revision}
   {$Page.Version}
   {$Page.Size}
   {$Page.Targets}

with 'Prev' and 'Next' versions for all of these, of course.  
  
  Any other stuff I should include?  What about
authorization data?  I know Patrick has created a summary
page with authorization. data, but this could easily be done
with this recipe if the data is available.  I haven't looked
into it yet so I don't know where I would get the
authorization data.  If anyone wants this and wants to point
me in the right direction, I will look into adding it.

  All feedback appreciated,


  -Martin






More information about the pmwiki-users mailing list