Update: most of the design specified here has been implemented, and so I'm freezing this page, and the discussion, and starting a new page for improvements to what we have already made. — Pieterh 2009-09-24
ListPages is one of the key modules but needs polishing and extension. This design sketch is for a set of incremental improvements to ListPages and related modules. Normal indicates functionality already present; bold indicates functionality scheduled for next delivery; italics indicate functionality not yet scheduled.
Standard selection
Applies to ListPages, CountPages:
- Select by category: category="category-selector"
- Select by tag: tags="tag-selector"
- Select by date: created_at="created-at-selector"
- Select by parent: parent="parent-selector"
- Select by page type: pagetype="pagetype-selector"
- Select by range: range="range-selector"
- Select by author: created_by="created-by-selector"
- Select by offset: offset="offset-selector"
- Select by rating: rating="rating-selector"
- Select by backlink: backlink="backlink-selector"
Category selector:
- "." means current category (default)
- "*" means all categories
- else, a list of space/comma delimited categories
- categories are by default additive (category OR category OR category)
- "-category" means exclude pages in this category (AND NOT)
Tag selector:
- "-" means pages with no tags, visible or invisible
- "=" means pages with any of the same visible tags as this page
- "==" means pages with the exact same visible tags as this page
- else, a list of space/comma delimited tags
- tags are by default additive (tag OR tag OR tag)
- "-tag" means pages without the tag (AND NOT)
- "+tag" means pages with the tag (AND)
Created-at selector:
- "=" means created on same day as current page
- "yyyy" means specified year
- "yyyy.mm" means specified year and month
- "last n unit" where 'n' is a count (defaults to 1) and unit is "day", "week", or "month"
- optionally prefixed by ">", "<", "=", "<=", ">=", "<>" (default is "=")
- selector takes into account UTC+- site settings (new site manager setting)
Created-by selector:
- "=" means by created by author of current page
- "-=" means by not created by author of current page
- else, a single user name
Parent selector:
- "-" means pages with no parent
- "=" means siblings of current page (same parent)
- "-=" means with different parent than current page
- "." means children of current page (parent is this page)
- else specifies a single full page name
Page type selector:
- "normal" means pages without underscore in name (default)
- "hidden" means pages starting with underscore
- "*" means all pages, with or without underscores
Range selector:
- "." means current page
- "before" means pages up to but not including current (in order after sorting)
- "after" means pages after current page (in order after sorting)
- "others" means pages except current page (replaces old skipCurrent)
Offset selector:
- "n" means do not show the first n pages (default is 0)
Rating selector:
- "n" means pages with rating equal to n
- "=" means pages with same rating as current page
- optionally prefixed by ">", "<", "=", "<=", ">=", "<>" (default is "=")
Backlink selector:
- "-" means pages with no backlink (i.e. orphaned pages)
- else specifies a list of space/comma delimited category:page values
Standard sorting
Applies to ListPages:
- specify order criteria: order="order-criteria"
Order criteria:
- property name
- optionally followed by " desc" meaning "descending"
- optionally followed by " desc desc" meaning "ascending", which makes "desc" safe to add after any sort order
| Property | Meaning |
|---|---|
| name | Order by page name (numeric if autonumbered) |
| fullname | Order by category and page name |
| title | Order by page title |
| parent | Order by parent name |
| created_by | Order by author screen name |
| created_at | Order by date created |
| updated_at | Order by date updated |
| commented_at | Order by date of last comment |
| size | Order by number of size |
| rating | Order by rating |
| revisions | Order by number of revisions |
| children | Order by number of children |
| comments | Order by number of comments |
| watchers | Order by number of watchers |
For example to order by rating in descending order:
order="rating desc"
Passing arguments by URL
An advanced use of ListPages lets you create variations of a single list using specially constructed links (consisting of the page link followed by arguments and values. These are mainly useful to invoke new selectors, and change the ordering or display.
You can pass any arguments in the URL by specifying argument="@URL|default-value" as the argument value and then appending "/name/value" to the URL used to invoke the page. If the URL does not contain a value for the argument, the default is used. Arguments that do not have @URL in their value cannot be set via the URL. The default value is optional: if you use only {{argument="@URL"} and do not provide a value on the URL, then the argument behaves as if it was not set.
The two main ways of using arguments-by-URL are (a) to create links to a page explicitly, on another page and (b) to generate links within the ListPages itself, so it will reshow itself with different configurations. Here is a simple example:
[[module ListPages category="@URL|design"]]
%%name%% in category %%category%%
[[/module]]
Output order
By default pages are output in the sort order. To reverse the order use:
- reverse="yes" — outputs pages in reversed order
Page properties
These page properties would be available both in ListPages content, and in live template content:
| Property | Meaning |
|---|---|
| Page lifecycle | |
| %%created_at%% | Date page was created |
| %%created_by%% | User who created page |
| %%created_by_linked%% | Icon and link to user who created page |
| %%updated_at%% | Date page was updated (edited, tagged, parented) |
| %%updated_by%% | User who updated page |
| %%updated_by_linked%% | Icon and link to user who updated page |
| %%commented_at%% | Date of last comment |
| %%commented_by%% | User who made last comment |
| %%commented_by_linked%% | Icon and link to user who made last comment |
| Page structure | |
| %%name%% | Page name without category |
| %%category%% | Page category if any |
| %%fullname%% | Page name with category if any |
| %%title%% | Page title |
| %%title_linked%% | Link to page showing title as text |
| %%parent_name%% | Parent page name without category |
| %%parent_category%% | Parent page category if any |
| %%parent_fullname%% | Parent page name with category if any |
| %%parent_title%% | Parent page title |
| %%parent_title_linked%% | Link to Parent page showing title as text |
| %%link%% | URL pointing to page |
| %%content%% | Page content |
| %%content{n}%% | Numbered content section |
| %%summary%% | Short content, first paragraph |
| %%tags%% | Page visible tags (not starting with underscore) |
| %%tags_linked%% | Page visible tags linked to system:page-tags/tag/{tag} |
| %%tags_linked|link_prefix%% | Page visible tags linked to link_prefix{tag} |
| %%_tags%% | Page hidden tags (starting with underscore) |
| %%_tags_linked%% | Page hidden tags linked to system:page-tags/tag/{tag} |
| %%_tags_linked|link_prefix%% | Page hidden tags linked to link_prefix{tag} |
| %%field{name}%% | Field value from page data form |
| %%field_display{name}%% | Displayed field value if different |
| Page reporting | |
| %%children%% | Number of child pages |
| %%comments%% | Number of comments on page |
| %%views%% | Number of times page has been viewed |
| %%watchers%% | Number of watchers on page |
| %%size%% | Number of characters in page |
| %%rating%% | Page rating value |
| %%revisions%% | Number of revisions to page |
| %%index%% | Page index in ListPages output + offset (1 to %%total%%) |
| %%total%% | Total number of pages in ListPages output (highest %%index%%) |
| %%history%% | Summary of last edits to page |
| Current context | |
| %%site_title%% | Title of current site |
| %%site_name%% | Wikidot Unix name for site |
| %%site_domain%% | Active domain name of current site |
| %%user%% | Current logged user name if any, else "anonymous" |
| %%user_linked%% | Icon and link to current logged user, if any |
| %%user_status%% | Returns anonymous, member, moderator, administrator or master-administrator |
| %%now%% | Current date taking into account site UTC +- settings |
Property selection:
- %%property-name{n}%% - when the property occurs more than once, selects instance 'n', where '1' is the first instance. Applies to content.
Output formatting:
- %%property-name(n)%% - truncates the property to a maximum of 'n' characters. Applies to all string properties.
- %%property-name?value%% - provide default value if property name is empty. Applies to all string properties.
Date formatting:
- All _at fields are dates and allow a custom format via the |format specifier.
Tag linking:
- If no link_prefix is specified, tags link to system:page-tags/tag/name-of-tag
- If link_prefix is specified, tags link to link_prefixname-of-tag (colors irrelevant)
- Examples
| if syntax is: | "shiny" tag will link to: |
|---|---|
| %%tags_linked%% | /system-page-tags/tag/shiny |
| %%tags_linked|system-page-tags/tag/%% | /system-page-tags/tag/shiny |
| %%tags_linked|interesting-list/category/%% | /interesting-list/category/shiny |
| %%tags_linked|player:%% | /player:shiny |
| %%tags_linked|very_%% | /very_shiny |
| %%tags_linked|http://myothersite.wikidot.com/see-also/tag/%% | http://myothersite.wikidot.com/see-also/tag/shiny |






Pieter, it should be et al, not et all…
The trouble with the world is that the stupid are cocksure and the intelligent are full of doubt. Bertrand Russell
Strange, I know this. Thanks for pointing it out.
The Wikidot Blog | My other works
Why is it that when range="others" or skipCurrent="true" is used simultaneously with separate="false" that the current page is still part of the list?
Why does it matter if you separate the pages or not for this to work?
λ James Kanjo | blog | photos | contact
It's a bug IMO. Reported, will check.
The Wikidot Blog | My other works
I can't reproduce this, though, do you have a live example of this wrong behavior?
Piotr Gabryjeluk
visit my blog
Yes, I do:
This page has a table that says “Also on this day:”. The first option in the list is its own page.
λ James Kanjo | blog | photos | contact
I recently noticed, the code for range="others" is slightly broken and instead it requires range="other". The fix is already scheduled. In the meantime, try to reproduce this problem with skipCurrent="true".
Piotr Gabryjeluk
visit my blog
skipCurrent="true" works fine now… That's a funny bug!
The fix is scheduled, but when it's released, will we need to edit/save our pages for it to take effect?
λ James Kanjo | blog | photos | contact
ListPages is generated independently from pages, so you don't have to edit&save them. But as the results are cached for some time, you may to wait some time after the fix is there.
Piotr Gabryjeluk
visit my blog
In a _template I wanted to pass %%tags%% to module FlickrGallery just like this:
It failed because %%tags%% are separated by spaces while the module expected commas.
Do you have idea if at Flickr, tags contain spaces?
Piotr Gabryjeluk
visit my blog
I just tried at flickr: space is actually a delimiter.
Gabrys has all right: by default space is a delimiter when entering Flickr tags but you enter "tags like this" between double quotes.
Yes, they can, so we must keep the syntax for FlickrModule.
Piotr Gabryjeluk
visit my blog
Are you sure?
I think you can remove the comma delimiter as Gerdami wants. I looked closer at Flicker and while they do allow tags to be created with spaces, you must surround them with double quotes. Flicker then strips out the space(s) when forming the URL.
The Flickr tag :"still life" becomes "stilllife":
http://www.flickr.com/photos/tags/stilllife/
Here is a test page showing that "still life" and "stilllife" tags produce the same results.
http://myfamilyphotos.wikidot.com/sandbox:flickr-tags
As long as we know to tag our pages in a "Flickr friendly" way, we can use %%tags%% with the Flickr module if you change the code to support space-separated tags rather than comma-separated tags.
-Ed
Free Wikidot Applications · Your Shared Photo Gallery · Your Personal Blog
Module FlickrGallery can stay like it is.
However, ListPages could render %%tags%% with commas in between tags, or let us choose the delimiter.
Good point. It would be nice if there was consistency between all modules on how tags are handled when passed as a parameter. I generally prefer comma-delimited simply because it's what I'm used to from the majority of other software packages I use. Plus, I think it's easier to read the code.
-Ed
Free Wikidot Applications · Your Shared Photo Gallery · Your Personal Blog
As many of you complain about the new passing arguments by URL, which overrides what you have defined in your modules, we decided to put the @URL thing back, but allowing a default value in case you don't have the corresponding /name/value in the URL. The new syntax would be (compatible with old), for example:
meaning: take category from URL, if not there, use "design".
means take category from URL, if not there use the default value.
This should work for every ListPages and CountPages parameter.
I will be updating this page shortly. Page updated. See the "Passing argument by URL" section.
Piotr Gabryjeluk
visit my blog
If I understand how this works correctly, that will be very useful! :)
Currently I have this on my page to set up the default values:
This would mean that I can remove the redirect module =)
— Shane | Blog | CycloDS Revolution | Compatibility List | Want me to manage your next wiki? | XBL: leiger40
Automatic code replacement — Rate it up!
@gabrys, thanks for this. It's a good improvement.
The Wikidot Blog | My other works
I would like to display a list of the most recent pages created in a particular category in order of newest first WITh the date it was created. BUT I would like the date to be shorter than "25 Aug 2009, 00:32 GMT+1000" perhaps just "25 Aug 2009", what is the best way to code that?
ALSO, I always get confused, acs = oldest to newest desc = newest to oldest, in my example?
The syntax is:
This gives you the date as 17 Sep 2009. A list of the date formats is at http://community.wikidot.com/howto:frontforum-date-variable
I couldn't get the created_at sort order used in your example to work but it appears to default to desc (i.e. newest to oldest). By the way it is asc not acs for ascending.
Order by ascending is the default — there is no “asc” attribute. If you really must have some sort of way to determine it's not descending, then just:
which essentially turns into ascending.
λ James Kanjo | blog | photos | contact
Thanks guys, all sorted now. :)
Are you sure? Last night I left out the sort order from the attributes and it came back in descending order. In fact it's still there at the bottom of my page here and it's definitely in descending order.
I think you misunderstood me. If you specify an order, the default is “ascending” unless you add “ desc” to it.
All of those above examples are in ascending order (oldest to newest, lowest to highest).
However, if you fail to specify an order:
Then the order will be automatically set to order="created_at desc"
λ James Kanjo | blog | photos | contact
Thanks, now I understand.
Me too.
However, I don't think it's clever to have 2 default orders.
Which module should be used for Page reporting part?
I assume this is the statistics for a certain page, but it does not work (or i don't know how to use it).
For example, I want to use this one:
%%views%% Number of times page has been viewed
And I put it like this:
But I dont get anything…
Here: http://istorijska-biblioteka.wikidot.com/sandbox:sandbox
The trouble with the world is that the stupid are cocksure and the intelligent are full of doubt. Bertrand Russell
It would work like this I'd expect:
Or if you were to put it into a template:
— Shane | Blog | CycloDS Revolution | Compatibility List | Want me to manage your next wiki? | XBL: leiger40
Automatic code replacement — Rate it up!
This does not work…
http://istorijska-biblioteka.wikidot.com/sandbox:sandbox
http://istorijska-biblioteka.wikidot.com/sandbox:_template
PS: As a matter of fact, I do not understand what's this for. Is this to list all pages with the number of views for each one, or to have at each page the number fo views for that particular page?
The trouble with the world is that the stupid are cocksure and the intelligent are full of doubt. Bertrand Russell
@Brunhilda: views is not implemented yet. All italic text in the design page is unimplemented. I've created a new ListPages documentation that should be more clear.
The Wikidot Blog | My other works
Ups! So that explains everything! :D Thanks, Pieter!
The trouble with the world is that the stupid are cocksure and the intelligent are full of doubt. Bertrand Russell
Instead of %% something_linked%%, why not just %%something_link%% ?
That way it's consistent with %%link%%
Just as %%parent_title%% is consistent with %%title%%
λ James Kanjo | blog | photos | contact
Good idea… though if you'd have mentioned this before the changes were made to the ListPages module….. xD
— Shane | Blog | CycloDS Revolution | Compatibility List | Want me to manage your next wiki? | XBL: leiger40
Automatic code replacement — Rate it up!
Actually %%link%% is not linked, so there's no inconsistency.
Piotr Gabryjeluk
visit my blog
So we need a %%link_linked% then? =) This could get confusing…
— Shane | Blog | CycloDS Revolution | Compatibility List | Want me to manage your next wiki? | XBL: leiger40
Automatic code replacement — Rate it up!
Well, if you really need something like [http://your-site/some-page http://your-site/some-page], I would call this %%link_linked%%. But who needs this?
Piotr Gabryjeluk
visit my blog
Exactly right :)
No, it's not needed as it can be done exactly as you've described. I was half joking / sarcastic. Sorry :)
— Shane | Blog | CycloDS Revolution | Compatibility List | Want me to manage your next wiki? | XBL: leiger40
Automatic code replacement — Rate it up!
Yes, yes! A thousand times, yes!
(weneed:100) a %%index%% 1, 2, 3, ... to be used by ListPages when listing results
^^^ Everyone vote that one up!
For consistency with major programming languages, starting at zero (0) might be a better idea, although that might lead to some confusion for newer users. Then again, will new users be using this feature?
My interpretation of this is something along these lines:
Something like iterator support would lead to very powerful uses of ListPages. The above example could be used to sort data evenly into two columns (odd results in left, even results in right).
Or, much more simply:
Maybe I'm a bit ambitious, but…
Great idea gerdami!
— Shane | Blog | CycloDS Revolution | Compatibility List | Want me to manage your next wiki? | XBL: leiger40
Automatic code replacement — Rate it up!
I am personally against starting with 0. As programmers, you and I think that makes sense. As normal users… It wouldn't be pretty. Just keep it starting with one.
"But sanctify the Lord God in your hearts, and always be ready to give a defense to everyone who asks you a reason for the hope that is in you, with meekness and fear;" ~ 1 Peter 3:16
I agree. Though zero is the first number, it doesn't make sense to use it anywhere else but programming.
λ James Kanjo | blog | photos | contact
0 is nothing. That is , a lack of anything, doesn't exist.
1 is something. it exists. it lives!
If only my bank manager would agree. Actually he thinks zero would be an improvement!
Rob
I added %%index%% to this page a few days before Gerdami made the weneed. Great minds think alike, or as my mum used to say, "fools seldom differ".
There is no way in Wikidot to do complex logic in page processing (if else etc.) because this makes a mess of caching and without caching, everything stops. This is one of the realities we work with.
So %%index%% would not be usable for splitting into odd/even, calculations, etc. Won't happen. But at least, for numbering, it will be useful.
The Wikidot Blog | My other works
I would like to see a “reverse” option in the order of ListPages.
Basically, the ListPages behaves as normal by listing the 5 pages. But if the reverse operator is set, then the list is simply turned upside down.
This would be useful, for example, with the Chatroom application.
λ James Kanjo | blog | photos | contact
I'm confused… doesn't created_at (on its own) do that?
— Shane | Blog | CycloDS Revolution | Compatibility List | Want me to manage your next wiki? | XBL: leiger40
Automatic code replacement — Rate it up!
No, but I can see the confusion.
Look at these pages. Let's assume that each of these pages were created on the month that they are named:
I want those pages, but in the reversed order:
λ James Kanjo | blog | photos | contact
Ah, that makes sense. I think pieter mentioned something like created_at desc desc somewhere else. On the forums, maybe.
— Shane | Blog | CycloDS Revolution | Compatibility List | Want me to manage your next wiki? | XBL: leiger40
Automatic code replacement — Rate it up!
http://forum.wikidot.com/thread:scrollbar-and-order-of-threads-in-this-forum/comments/show#post-583460
λ James Kanjo | blog | photos | contact
For the tags selector:
For the Iron Giant site, the template uses this code…
… which shows a list of pages with similar tags (therefore, similar content). However, hidden tags (_concept, _stable, etc) are also included in this and as a result some completely unrelated templates are showing up as being "similar".
A way to do this without including hidden tags would be great.
— Shane | Blog | CycloDS Revolution | Compatibility List | Want me to manage your next wiki? | XBL: leiger40
Automatic code replacement — Rate it up!
IMO "=" should ignore hidden tags. I'll make that change to the specs.
The Wikidot Blog | My other works
I've noticed that if you use %%commented_at%% and the listed page doesn't have any comments, it prints out the raw substitution code. See http://sandbox.wikidot.com/ashe:listpages.
Would it be possible to fill with %%created_at%% in such cases?
Similarly, %%created_by%% as the fallback for %%commented_by%% when there are no comments?
Sounds good.
But — is there any situation in which someone would want it to print "no comments for this page"1 instead ?
— Shane | Blog | CycloDS Revolution | Compatibility List | Want me to manage your next wiki? | XBL: leiger40
Automatic code replacement — Rate it up!
@leiger: note that we changed this, and an empty tag string is now just empty.
The Wikidot Blog | My other works
Didn't realise that! Thanks
— Shane | Blog | CycloDS Revolution | Compatibility List | Want me to manage your next wiki? | XBL: leiger40
Automatic code replacement — Rate it up!
Nice idea. Noted. Vetoed by Michal, correctly. It would be incorrect to show created_at as default for commented_at. Rather, we need to be able to set default values, so %%commented_at?%%created_at%%%%.
For a page with no comments, one can simply print 'Comments: %%comments%%'.
The Wikidot Blog | My other works
rating: attribute
Can we have a rating attribute? Accepted parameters would be:
Why would this be useful? If a commenting system is developed using only pages and not the forum, then each comment can have a rating. If a rating for a comment is less than zero, then it should be treated differently. Perhaps even the same way as YouTube treats negative-rated comments.
Reason I ask instead of just adding it : Will this cause too much server stress?
rating: similar to iftags
An ifrating option would be useful too, similar to iftags :)
— Shane | Blog | CycloDS Revolution | Compatibility List | Want me to manage your next wiki? | XBL: leiger40
Automatic code replacement — Rate it up!
You mean a rating=">something" selector?
Rating comments would be useful. I'd probably want a ListComments module that lets us play with things like depths… doing things like [[ifrating]] would however mean cache invalidation each time someone rates a comment (this already happens when we rate pages but it's relatively rare).
We need to discuss how to show comments in a wiki-only world separately.
The Wikidot Blog | My other works
Yes, and rating="<something" as well.
As you might remember, I cloned the forum template a while back with this idea in mind. Due to lack of time I haven't even started looking at it though. Might be a good idea for the community to work on.
— Shane | Blog | CycloDS Revolution | Compatibility List | Want me to manage your next wiki? | XBL: leiger40
Automatic code replacement — Rate it up!
Yes. Your idea was to create each comment as a page, attached to the parent. It needs a stand-alone proof of concept. Advantages:
Disadvantages:
I'm making a site http://pagetree.wikidot.com to act as sandbox for this. Goal is to make a workable forum with no Comments module :-)
The Wikidot Blog | My other works
I'm using order="name desc" as part of the changelog documentation pages, and it seems to be ordering by page title instead.
The changelog category is autonumbered, but name desc makes 1 appear at the top of the list (shouldn't it make 2 appear before one?)
Page 1 : starts with A
Page 2 : starts with C
Therefore, name desc is currently sorting by title and is making the second page appear first on list as C comes after A in the alphabet.
— Shane | Blog | CycloDS Revolution | Compatibility List | Want me to manage your next wiki? | XBL: leiger40
Automatic code replacement — Rate it up!
Shane, I had a look at the page and saw a different problem.
The order="name" is working fine, however the functions are incorrectly reversed:
Just in case somebody missed that… PAGES ARE BEING ORDERED IN THE OPPOSITE ORDER!!!!!
EDIT: Hmm, maybe it's just an autonumbering problem????
This page renders fine
λ James Kanjo | blog | photos | contact
Can you point me to a reproducible case where the ordering is wrong?
Thanks.
The Wikidot Blog | My other works
The changelog documentation page
λ James Kanjo | blog | photos | contact
OK, I've made some tests on the page (see) and am reporting this bug to Michal.
The Wikidot Blog | My other works
And… fixed! You like the new turnaround time on bugs? (Apart from the 9,000 existing ones, which will have to wait a while longer).
The Wikidot Blog | My other works
Yes :D
What was the problem, by the way?
Is this something the programming community can help out with?
λ James Kanjo | blog | photos | contact
Yes, probably, but much of the code is complex due to Wikidot's use of caching. It's in git and that means we can accept patches.
Personally, I'm ecstatic enough with the help we get from the Wikidot community in other areas. Speaking of which, I moved that themes sandbox cover to the main page. It's not perfect but already pretty nice and the themes site is now much more fun to navigate IMO.
The Wikidot Blog | My other works
Aha james… I think you were probably right. Having only made two pages I didn't really pay attention to what the problem was, it just looked like it might be using title instead. Good pick.
Haha, yes.. good turnaround :)
— Shane | Blog | CycloDS Revolution | Compatibility List | Want me to manage your next wiki? | XBL: leiger40
Automatic code replacement — Rate it up!
:-)
If you wanted to have a nice border for the hover image:
λ James Kanjo | blog | photos | contact
I keep hoping we'll use the forum (hint hint) for discussions of our various projects but in this case it was me that jacked the thread. :-(
Anyhow, CSS is applied and the result is nice!
The Wikidot Blog | My other works
Is there a way to display on a page the current selected tag ?
Example: On page http://community.wikidot.com/start-featured/tag/game-development I would like to display
"Filtered by game-development"
You can do this now in a very very hacky way using very custom CSS, tables and PagesByTag module.
See: http://chaber.art.pl/system:page-tags/tag/karneol
Piotr Gabryjeluk
visit my blog
You might create a set of (empty) pages in a separate (autonumbered, if you like) category (e. g. called “tag”) where each page is tagged with one of the tags that you want to show as “Filtered by …”
Then on your landing page, use:
Working on my photo site tonight, I had an idea and as I worked it through I really wished I had access to %%image_first%% or %%image_random%% in my live template. The reason is that I'd like to use a random image from my page as the background for a div block. I then want to overlay a "frame" image on top of that section. You can see the effect I'm going for here:
http://myfamilyphotos.wikidot.com/photos:1
My workaround for the moment is to have the user select one of the images to display in the "slide mount" div by uploading or renaming an image to favorite.jpg.
The code in my live template looks like this:
If I could change it so this worked:
it would allow for creating some very dynamic page content!
We have the ability to list random pages. How about adding a way to get a random image? If that's too complicated, maybe an %%image_first%% solution would be easier since it's already part of the image module.
-Ed
Free Wikidot Applications · Your Shared Photo Gallery · Your Personal Blog
I'd actually defined %%image{n}%% for this, took it out after discussion with the team, will now put it back. 'n' could well be 'random'.
The Wikidot Blog | My other works
Parent selector:
…
Q1: Do you mean siblings ?
Q2: How do you emulate ChildPages, i.e. with parent equal current page, without passing the argument via a _template ?
Yes, this was meant to be siblings. I can see it's confusing. To emulate ChildPages we'd need a specific syntax, since there are no symbols except in templates or ListPages.
Am making those changes now…
The Wikidot Blog | My other works
When a module is signaled as deprecated in the doc, it might be useful to give the code to achieve the same or a similar result.
I propose that pagename in %%_tags_linked|pagename%% and %%tags_linked|pagename%% be defined as follows:
This would allow to provide any additional parameters needed for ListPages (which is the most probably target for %%tags_linked%%.
As another example /pagename/destination/ would allow linked tags to effectively become links to pages of the same name (in this case the target page wouldn't use ListPages but Redirect with destination dynamically specified on the URL).
We might drop the leading “/” in the two proposed specifications, if in the current implementation pagename is supposed to only support unixified page names (i. e. page names may not include slashes).
I would say, the %%tags_linked|pagename%% should work as a prefix, i.e. the default is:
%%tags_linked|system:page-tags/tag/%%
This can be used to create links to pages in custom category:
%%tags_linked|player:%%
And this let's you pass additional parameters:
%%tags_linked|some-target/category/some-category/tags/%%
So I would prefer this syntax:
%%tags_linked|link_prefix%%
which means tags linking to: {link_prefix}{tag_name} (curly brackets added as decorative part). Link_prefix could even start with http:// to allow other weird kind of stuff.
Piotr Gabryjeluk
visit my blog
Feel free to fix-up the design above, I've started with Erich's suggestions but am going to have to put the kids to bed, and after about 14 hours of Wikidotting, my brain is getting fuzzy. :-)
The Wikidot Blog | My other works
OK, updated.
My solution is very similar to Erich's, only his had magic addition of /tag/, mine has explicit. I hope it's OK for anyone to write these 5 more letters and thus to gain better understanding of how this mechanism works.
Piotr Gabryjeluk
visit my blog
As of 8 Sep 09, 6:04 GMT, %%tags_linked|pagename%% only works when pagename is actually the name of the page, not the fullname .
Examples that don't work:
Same question for Select by date-till: till="date-selector"
since= and till= aren't implemented yet, I've marked them in italics. Actually, I'm wondering if the names are accurate. This is a selector on the created date. Perhaps we need a more generic date selection: on created_at, updated_at, commented_at, and the three options, equals, before, after.
The Wikidot Blog | My other works
Technically you could achieve that with 3 operators, not 4. I mean, if you want to include pages from January 2010 onwards, rather than date=">=2010.1.1", you could write date=">2009.12.31"
Or instead of date="<=last 28 days", you could write date="<last 27 days"
If the “skipCurrent” option, which includes the current page or not within the results, didn't exist, then there would be a need for 5 operators. But it does exist, so there's no particular need for the extra two.
Hmm, a thought. Instead of "last X days", what if scheduled blog posts could be displayed with "next X days" ???
λ James Kanjo | blog | photos | contact
Yes, but it's clumsy to have to write ">2008.12.31" instead of ">=2009".
The Wikidot Blog | My other works
I agree, I was just thinking of the extra effort from a developer's perspective.
Hmm, I made a typo. It should have read '5', not '4'
PS. I like the new DP !
λ James Kanjo | blog | photos | contact
Oups, I just forgot the 6th operator "<>" !
And generally, why don't we have a NOT operator:
Ex: ListPages category="blog" created_by="-pieterh, -squark"
Ex: ListPages category="blog" created_by="-#marketing"
… where #marketing is a group of users … when groups management is implemented.
Good question.
The Wikidot Blog | My other works
And the answer is that we don't have operators in general at all. I've made some changes to the yet-to-be-implemented selectors to start to introduce more consistent operators.
The Wikidot Blog | My other works
Just a few general questions…
1) Do the former syntaxes, like %%page_unix_name%% and %%author%%, still work?
2) Do the delimiters without spaces still work, like order="titleDesc" vs. order="title desc"?
3) Does the category selector allow for @URL?
— Blog ~ Life's Handbook
I'm not sure about the category selector, try it and I'll update the doc if that is missing. I assume it does work but don't have the code at hand.
Questions 1 and 2: yes, the existing syntax all still works, we did not break anything except %%tags%%.
The Wikidot Blog | My other works
No, the @URL doesn't work with category. It assumes you mean the category "url".
— Blog ~ Life's Handbook
I tied this code here in a live template but if you look here you can see that it only lists the current page.
Any ideas?
**EDIT**
What I'm trying to achieve is, to list all pages created by a particular user, using a live template
This particular selector does not yet work (it is marked in italics on the design page).
I'm updating the docs right now.
The Wikidot Blog | My other works
Ah, I see. I'd better get my eyes tested. lol ~©¿©~
It will be VERY useful when it is working!
I would like to be able to ListPages, let's say the first n results, then the next ones with a second ListPages (and a shorter displayed format).
Example:
Nice idea. I've added that.
The Wikidot Blog | My other works
What is the format for our URL if order allows a space?
-Ed
Free Wikidot Applications · Your Shared Photo Gallery · Your Personal Blog
I assume, %20 in place of the space. This would apply to all special characters passed in URL arguments (%nn, where nn is the hex value of the character). If this does not work, we'll make it work.
The Wikidot Blog | My other works
What does 'system default' mean in 'Page visible tags linked to system default'?
I meant 'system:page-tags', the same as clicking on the tags shown at the bottom of the page. Will fix this.
The Wikidot Blog | My other works
What I would like to see is a way to have a listed tag act like a link to a page of the same name. For example, the tag 'blog' acting as if you'd written [[[blog]]]. Or, the set 'blog wikidot forum' behaving like '[[[blog]]] [[[wikidot]]] [[[forum]]]'.
Interesting. What's the use case for this?
The Wikidot Blog | My other works
I help maintain a companion website for a text-based RPG, and one thing we are looking at doing is overhauling our system for posting scenes. We can't completely automate it without the ability to custom-set page creation dates (because RP doesn't always happen in real-world chronological order), but tagging log pages with participant names and then being able to use %%tags%% to generate the list of participants in any situation with links to their individual character pages would be extremely useful. We currently do page links manually, and we could still do that using a content separator, but it would be very elegant (centralize several steps, be more inherently flexible) if it worked just by tags.
(Tangentially this is also why I asked for capitalized tags on the 'We Need' list, but I think the crosslinks are actually more important.)
An example of the current system is here: http://string-theory.wikidot.com/logs:september09
And an example of what I would eventually like to implement is here: http://rhapsody.wikidot.com/logpage:august09
…though you really need the template to see the code: http://rhapsody.wikidot.com/logpage:_template.
Characters also generally have a personal timeline on their own pages, with similar crosslinks to the pages of others who participated in any given scene.
It's very interesting, but quite rare situation. You can do similar thing, with [[iftags]] in your template. So if page has tag blog, it also shows a link to page blog, etc.
Piotr Gabryjeluk
visit my blog
@Gabrys:
We have reported (ticket:350) that the [[iftags]] statement does not work within ListPages, when separate="no" is specified, as Ashes proposes to use in http://rhapsody.wikidot.com/logpage:_template.
Iftags won't work with separate="false", because in separate="false" mode wiki source is parsed after joining all results, so the context for every syntax token like image, iftags, etc is page the ListPages in on and not each matched page. But iftags with no separate="false" works OK.
@Ashe: solution to your problem can be using some customization to system:page-tags page, for example:
if "gabrys" is a player in your game and as participant he tags some pages with his name, there are pages tagged "gabrys". You want to show "player:gabrys" page when clicked on "gabrys" tag. You can do something like this:
On page system:page-tags replace the module TagCloud and module PagesByTag with:
You would need to also tag player:gabrys page with "gabrys" tag, so that clicking on a tag takes you to system:page-tags, which in case a page in player category is also tagged with it, shows you mainly the player page followed by other pages tagged by his tag (in this example his games).
Piotr Gabryjeluk
visit my blog
@Gabrys' first post:
I could do that for the simple 'blog wikidot forum' example, yes, but on a site with something like 175 different individual character pages it becomes quite prohibitive to make an iftags for each one.
Although as I think about it, there might be a workaround I can try. The only problem is that, as Gerdami said, iftags doesn't work with separate=false. But I'll take your suggestion and go play with it.
Yes, my application is a niche use, but I think if the capability was there it would be used for others I can't imagine offhand also.
@Gabrys' second post:
I'm not sure you're following what I want to do with the links, or else I'm not following your proposed solution at all.
I want to take a ListPages-generated table that has among its columns one called 'Participants'. In each 'Participants' cell I want a list of names, such as might be generated by %%tags%%, and each one of those names to link directly to the corresponding character wikipage. I don't want to involve the system:page-tags intermediate step at all.
I think that I could actually generate this list of links with ListPages and iftags code, but that requires recursive function.
Read the second suggestion. The only thing you would need to change is tagging all player:XXX pages with corresponding XXX tags and the system:page-tags page (or you can create a custom one using my suggestions and use the new %%tags|tag-target-page%% syntax where you want to use it).
Piotr Gabryjeluk
visit my blog
I edited my previous post to include a reply to that one.
I don't understand what you're suggesting, I'm afraid. Can you point me to an example?
Let's make this really really simple.
Let's use tags ONLY for players. Tag = player.
Player page = page in player category, for example:
Make then page called player with the following content:
This page will show player's page. It's not the same as player:name, but almost the same. It will display page in category player which has tag that is passed in URL, for example yoursite.wikidot.com/player/tag/gabrys will make ListPages display only "player:gabrys" page (as long as "player:gabrys" page is tagged "gabrys".
Now, replace %%tags_linked%% in your templates with %%tags_linked|player%% and you're done.
If some page was tagged gabrys, gabrys will appear in %%tags_linked%% and will link to yoursite.wikidot.com/player/tag/gabrys. The page will display the only page in category player that is tagged "gabrys", the "player:gabrys" page. There will be the title, the content and edit link. The only thing really different would be the URL, which will be player/tag/gabrys and not player:gabrys. The rest is cosmetical and can be tuned with CSS.
I hope you understand now.
(The only requirement for this setup to work is tagging each player's page with their name).
Piotr Gabryjeluk
visit my blog
That is doable, but it only works to generate a ListPages block. So to go from a general list of pages, you would get to a list of player pages, and from there to the specific player page. What Ashe wants is that from a ListPages block we can jump straight to the player pages.
Now it may be more flexible (e.g. you can tag several pages with the same player tag) but it's unintuitive (obviously, given the difficulty in understanding).
I'd prefer that such functionality be explicit. So, if we want tags to link to pages with the identical names, we need to specify:
For me, it is in fact unnecessary to link to an intermediate page at all, because any "list of pages with this tag" I can generate using ListPages.
So, here is an idea. If the tag is formatted as a category:pagename ("state:_open", "player:gabrys") then the %%tags_linked%% will automatically link to that page instead of the intermediate page.
The Wikidot Blog | My other works
I like that idea, and the flexibility in that not all tags would have to link.
Shouldn't the property "name" be "page_unix_name" & "full_page_name" for consistency?
http://www.wikidot.com/doc:templates
— Shane | Blog | CycloDS Revolution | Compatibility List | Want me to manage your next wiki? | XBL: leiger40
Automatic code replacement — Rate it up!
We're changing it to 'name' and 'fullname' so we can do 'parent_name' and 'parent_fullname' for consistency. The old names will remain but be deprecated and removed from the documentation.
The Wikidot Blog | My other works
I would like to see it expanded with the function to order by %%content{x}%%…
@ James order="content{x}Asc" and if I could give content{x} a name it would be "my order" of "my key". But since Pieter could understand me… maybe next time ask for more info in stead of saying that I don't make sense.
For example: I wish to generate a list of links to pages in the side menu. But I want to decide the order… not alphabetically, not by creation, not by… BUT My order. If I would use pagetree it will order them alpabetically by pagetitle… wich is maybe to long for a menu and not the right order.
In addition, but this is off topic. I would like to be able to [[include (category:)pagename content=3]], so that if I made some page using a :_template I could select a part of that page. To do this now you need to do complicated stuff with the remark syntax. It is possible at this moment if i use the listpages, but since it can not be used recursively the NEW include would be a better option
I'm afraid you're not making any sense. Order by… My order?
You should give a fictional syntax example to demonstrate a functionality that doesn't exist. If I wanted another order variable, it would be order="nameAsc" for the page's UNIX name (not page title, the page's URL name).
λ James Kanjo | blog | photos | contact
Steven means, "order the way I want, using any arbitrary value from the page". I.e. %%content{2}%% could be the zip code.
The problem, Steven, is that it can become very expensive to resort long lists like this. We may implement that when we have forms, but there would be restrictions. Either, you'd need to define the field as a key beforehand, or else the maximum length of the ListPages would be limited.
The Wikidot Blog | My other works
Pieter you understand me. I understand that this can cause problems for your servers. So yes your proposition is a good one and I can live with it. Why don't we include a %%content{key}%% field wich can only hold 10 or 20 characters and is maybe delimited with "_ _ _ _" in stead of "===="… No maybe even better… If you indicate the field with "_ _ _ _" the parser knows that the following field is an "order by"-field, so he makes an extra field in the wikidot-database (wich is a key-field) an inserts the first 20 characters of this field.
So a template and a page like this would become the following
http://ordermystuff.wikidot.com/adress:_template
http://ordermystuff.wikidot.com/ardess:Arnold_Schwarzenegger
this would become something like
The ListPage statement could become
We're working on a forms system that will do this, but properly.
The Wikidot Blog | My other works
I do not dare to ask but will ListPages be recursively in the future?
Yes, this is one of our goals. All modules to be nestable where it makes sense. We'd also like to simplify the syntax so it becomes [[ListPages ...]] without the 'module' keyword.
The Wikidot Blog | My other works
OK, the range selector is now implemented live. I'm going to use this in the template sites where we now use NextPage and PreviousPage.
The Wikidot Blog | My other works
So… basically it's just ListPages, limit=1, range=before / range=after ?
— Shane | Blog | CycloDS Revolution | Compatibility List | Want me to manage your next wiki? | XBL: leiger40
Automatic code replacement — Rate it up!
That's it. You can see that in http://issuetracker-template.wikidot.com/issue:_template. Lets us do next/previous but properly filtering on tags, parent page, etc.
Which reminds me, we can now make the forum next/previous work properly as well.
The Wikidot Blog | My other works
Pieter, can we extend the range selector (“before,” “after,” “others”) to “current” which would just list the current page? This would help in building a navigation: listing all pages before the current page, then the current page — probably highlighted, and all pages after the current page.
That's kind of redundant: just use %%title%% etc. You are already on the current page.
The Wikidot Blog | My other works
%%title%% etc. work in a live template only, not on any specific pages (e. g. nav:side)
An example of the usefulness of range="current" would be a “This page was last updated on date/time” remark on a page.
This can now be done only through a live template (which means you can't use it inline with page content) or by tagging the current page with a unique tag.
Yes indeed. This would effectively be the long-desired “universal page variables” that we've been wishing for.
λ James Kanjo | blog | photos | contact
This is really useful for numbered pages! For example, with the design for Wikidot calendars, we wouldn't be able to list all events in the chronological time-line order that they happen (we are limited to ordering by creation/title, and the title is useful for other things).
λ James Kanjo | blog | photos | contact
would it be possible to allow for ordering by content? for instance, in pages whose contents are items in a bibliographic entry, I would like to be able to list pages by author (content{1}), title (content{2}), year (content{3}), etc. Does anybody else think this would be a useful feature?
Eduardo R. Ribeiro
Macro-Jê linguistics, &c.
Useful, yes, but problematic with the current content sections. Sorting large numbers of pages is expensive (slow). We're working on a data forms functionality which lets you define named values in the page, more fun for things like bibliographic entries. And we should be able to sort on specific fields, afterwards.
The Wikidot Blog | My other works
I'm really looking forward to the forms funcionality! Any chance it will come out this year? And will it allow for file attachments?
Eduardo R. Ribeiro
Macro-Jê linguistics, &c.
We'll see. Making promises is always asking for trouble.
The Wikidot Blog | My other works
Select by date. Fine but which one ? Creation_date or Last_edit_date ?
Both should be selectable.
Just come back from a search test: same issue: the search doc says
the date criteria is actually the creation date (doc should tell this)
Note the difference of date format when compared to the one proposed above for ListPages
There's an %%editor%% and %%editor_linked%% up there.
Just thought I'd point out that when using templates, %%author_edited%% is used to represent the name of the last person to edit the page. This is similar to %%author%%, the page creator.
Instead of using %%editor%%, shouldn't it be %%author_edited%% ?
— Shane | Blog | CycloDS Revolution | Compatibility List | Want me to manage your next wiki? | XBL: leiger40
Automatic code replacement — Rate it up!
%%date%% i.e. creation date and time
%%date_edited%% i.e. last edit date and time
%%editor%% the last guy who edited the page
%%editor_linked%%
I've opened the page to editing, so feel free now to add these in.
The Wikidot Blog | My other works
ex1: order="date desc, page_name asc", with date = date (without time)
ex2: order="rating desc, author asc",
… and a groupBy="date", which would add a break (blank line or whatever) between groups
Question about: "name Order by page name" : is name the current %%page_name%% ?
I originally wrote the proposal with multiple sorting criteria and then removed it, out of pity for the database engine.
The Wikidot Blog | My other works
ListPages uses tagTarget=landing-page
while
TagCould uses target=landing-page
=> inconsistency to be resolved, thanks.
Ack. Shorter is sweeter.
The Wikidot Blog | My other works
… and also PageCalendar which currently supports startPage or targetPage
Done.
The Wikidot Blog | My other works
> Category selector … "." means current category (default)
> Tag selector … "=" means pages with same tags as this page
If a tag selector uses “=” to signal “same,” then the category selector should also use “=” to do so.
I agree. Didn't notice that earlier! :)
— Shane | Blog | CycloDS Revolution | Compatibility List | Want me to manage your next wiki? | XBL: leiger40
Automatic code replacement — Rate it up!
Maybe. The dot means "current" whereas the equals means "any of the same as". Not quite the same semantics and I don't like using the same syntax. For example we might want to add 'tags="."' meaning "exactly the same tags".
The Wikidot Blog | My other works
Wow. First, I'm glad I'm not the only person here who is traumatized by the number 72. Do 8 and 30 also make you shift in your seat?
The summary should just work properly: limit to N chars and be cleanly formatted as one paragraph. Preview is a hack and should IMO be removed.
The Wikidot Blog | My other works
Reason: sometimes, ListPages displays unwanted stuff such as [[include sentence]], not rendered, or stuff from the _template.
Can you show me an example of this? It sounds like a bug,
The Wikidot Blog | My other works
With ListPages : http://babel-template.wikidot.com/system:page-tags/tag/_system
With Pages : [[module Pages preview="true"]]
Look for the page "Page Tags" for example in http://handbook.wikidot.com/system:list-all-pages
We need showHidden="true" for both ListPages and CountPages
— Shane | Blog | CycloDS Revolution | Compatibility List | Want me to manage your next wiki? | XBL: leiger40
Automatic code replacement — Rate it up!
I wish to retrieve the parent name of a page … with the order function of the listPages Module, this is not yet possible I believe (for now I hope). Because with the listPages-module you can only get properties from the page itself, because there is no "y" in the column from "done".
Comments is also not fully working I believe. I use
And it does not order them by comments (right column @ http://ethischforum.wikidot.com/stelling:1-1-1-1 for example) I must say I use comments on page… so this is not a forum page !!
http://www.wikidot.com/doc:listpages-module
Allowed values for the order attribute are as follows:
— Shane | Blog | CycloDS Revolution | Compatibility List | Want me to manage your next wiki? | XBL: leiger40
Automatic code replacement — Rate it up!
Sorry, the above list is not documentation of what exists but what I'd like to get. The 'Done' column is what's already present. I could add a second column to show whether the orderBy is already done or not.
The Wikidot Blog | My other works
I read in the above list that
'Done' means it's already there, 'Key' means the orderBy argument would accept this property name.
I also read "4 - ListPages" as title
Hence my conclusion:
There exists a module called listPages with wich one can order a list of pages. A page from that list could have a comment (on page) and since %%comments%% is marked as "key" and "key" means "the orderBy argument would accept this property name", I would assume that the page with the most comments (on Page) would be on top of the list.
I tried this, but it does not seem to work your honor. Here for I introduce exibit A
Futhermore I wish to know whether my client has a parent. Naturally everybody has two parents but since my client is a wikidot-page it can only have one, so dear members of the jury, to find out wich page that would be should not be a very difficult job.
If one would order the possible pages by "parent", wich is possible the defence says - what would this order be? pages with parents on top and orphant-pages at the bottom?
Please help me members of the jury and give my client his rightfull parent back and a list of popular comments
:-) The defendant is found guilty of being far too funny for a summer weekend. Sentenced to hard labor writing Wikidot syntax with no wysiwyg editor.
Yeah, you're not the only person who wants ordering by comments. Adjourned!
The Wikidot Blog | My other works
Definitely got a laugh out of that =)
Unfortunately the Key column is for what the orderBy argument would accept once this is implemented, and not what it does accept already.
— Shane | Blog | CycloDS Revolution | Compatibility List | Want me to manage your next wiki? | XBL: leiger40
Automatic code replacement — Rate it up!
hahaha! =)
As for the table … I don't understand what the "Key" column is for?
And why are some marked as " - " for both Done and Key ?
— Shane | Blog | CycloDS Revolution | Compatibility List | Want me to manage your next wiki? | XBL: leiger40
Automatic code replacement — Rate it up!
In a relational database system, when a field is set as a key, it allows to retrieve and sort database records very quickly.