[pmwiki-users] Pagelist problems (pretty advanced)
Crisses
crisses at kinhost.org
Sat Oct 14 10:44:32 CDT 2006
Another problem --
When a field has a period in it, and I need to make the data part of
a pagename... (this MAY be related to the problem I originally posted).
[@
[[#othercatlist]]
(:if expr ( ! equal "{Data-{=$BaseName}$:Year}" "{Data-{<$BaseName}
$:Year}" ) || ( ! equal "{Data-{=$BaseName}$:Work}" "{Data-{<
$BaseName}$:Work}" ) || ( ! equal "{Data-{=$BaseName}$:WAuthor}"
"{Data-{<$BaseName}$:WAuthor}" ) :)
* [[ Category/Title-{Data-{=$BaseName}$:Work} | {Data-{=$BaseName}
$:Work} ]] - [[Category/Author-{Data-{=$BaseName}$:WAuthor} | {Data-{=
$BaseName}$:WAuthor} ]] - [[ Category/Year-{Data-{=$BaseName}$:Year}
| {Data-{=$BaseName}$:Year} ]]
(:ifend:)
[[#othercatlistend]]
@]
Long story short, the WAuthor field sometimes has a period (or two)
in it. This obviously won't work to create the Category/Author-Name
link.
Category/Author-{Data-{=$BaseName}$:WAuthor}
For example: if $:WAuthor contains a Jr. in the name, an initial like
C.S. Lewis, etc.
I had to strip .'s out when creating category links when I had the
pages written -- is there any way to process the variables and strip
out the periods? i.e. I can make custom markup to create the
category links... it would save a LOT of typo errors.
Thoughts?
Crisses
On Oct 14, 2006, at 11:15 AM, Crisses wrote:
> I've defined the following pagelist:
>
> !!!fmt=#periodcatlist
>
> For the Period category pages.
>
> [@
> [[#periodcatlist]]
> (:if expr ( ! equal "{Data-{=$BaseName}$:Year}" "{Data-{<$BaseName}
> $:Year}" ) || ( ! equal "{Data-{=$BaseName}$:Work}" "{Data-{<
> $BaseName}$:Work}" ) || ( ! equal "{Data-{=$BaseName}$:WAuthor}"
> "{Data-{<$BaseName}$:WAuthor}" ) :)
> * [[ Category/Year-{Data-{=$BaseName}$:Year} | {Data-{=$BaseName}
> $:Year} ]] - [[ Category/Title-{Data-{=$BaseName}$:Work} | {Data-{=
> $BaseName}$:Work} ]] - [[ Category/Author-{Data-{=$BaseName}
> $:WAuthor} | {Data-{=$BaseName}$:WAuthor} ]]
> (:ifend:)
> [[#periodcatlistend]]
> @]
>
> in other words:
> If the year changes, OR the title of the "work" (book) changes, OR
> the Author's name changes:
> spit out another header of category links to specific pages
>
>
> The problem is probably in the "order". This pagelist format is
> called from Category/GroupFooter with:
>
> (:if name Category.Period-* :)
> (:pagelist link=Category.{$Name} group=Simile fmt=#periodcatlist
> list=normal order=$:Year,$:Work,$:WAuthor :)
> (:ifend:)
>
> Something's wrong with the sort order:
>
> http://similepedia.com/index.php/Category/Period-20thCentury
> yields:
> 1939 - The Grapes of Wrath - Steinbeck, John
> 1937 - Of Mice and Men - Steinbeck, John
> 1939 - The Grapes of Wrath - Steinbeck, John
> 1930 - As I Lay Dying - Faulkner, William
> 1939 - The Grapes of Wrath - Steinbeck, John
> 1930 - As I Lay Dying - Faulkner, William
> 1939 - The Grapes of Wrath - Steinbeck, John
> 1930 - As I Lay Dying - Faulkner, William
>
> When I would be expecting:
>
> 1930 - As I Lay Dying - Faulkner, William
> 1937 - Of Mice and Men - Steinbeck, John
> 1939 - The Grapes of Wrath - Steinbeck, John
>
> Anyone know what I did wrong this time? Does the pagelist sort
> handle alphaNUMERIC sort? Years, I expect, will always be 4 digits,
> so I don't need a sophisticated numeric sort...
>
> Crisses
>
> _______________________________________________
> pmwiki-users mailing list
> pmwiki-users at pmichaud.com
> http://www.pmichaud.com/mailman/listinfo/pmwiki-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: /pipermail/pmwiki-users/attachments/20061014/9189cec9/attachment.html
More information about the pmwiki-users
mailing list