Last week I wrote that we had a feature release planned for the holiday season. Some of you guessed it would be data forms support in the ListPages module. Looking at the top wishes it was quite a probable guess, and it was correct!
We have just deployed the improved version of ListPages with support for selecting pages by custom fields defined via data forms. We have chosen a simple syntax for querying but we are already thinking about extending it and adding more operators. The today's release should however provide you tools to play with and test our implementation.
Take a look at an example. Suppose we have a "band" category populated with entries for music bands defined by the data form:
[[form]]
fields:
type:
label: Music type
type: select
values:
0: Classical
1: Country
2: Folk
3: Indie
4: Jazz
5: Pop
6: Rock
default: 6
bandwebsite:
label: Band website
type: url
rating:
label: My rating
type: select
values:
0: Terrible
1: I have seen worse
2: Better than Justin Bieber
3: Got used to it
4: Cool
5: Awesome
6: Cannot live without it
[[/form]]
Now, to select music bands that only play folk we can use:
[[module ListPages category="band" _type="2"]]
<format>
[[/module]]
Note the underscore in front of the selection parameter — it denotes that the field is a custom one, defined by the data form.
You can mix several selection parameters, both custom fields and all previously supported ones. Criteria will be joined by the and operator, as previously.
Custom fields can be also used for sorting. To sort all bands by rating starting from the best to worst we can use:
[[module ListPages category="band" order="_rating desc"]]
That's it! We will update the documentation later on, but the above examples show it all.
Now here is a word of warning. Although this feature looks like a piece of cake, it was not that easy to implement. We hope it will work well for your sites (we have put it through thorough tests), but please treat it as a "beta" which can be changed or even pulled back if we discover serious issues.
Performance might not be super-stellar but is sufficient for sets up to thousands pages. We will work on improvements once we receive more feedback. Until then please use data form selectors on large categories carefully, especially when using multiple modules on a single page.
I hope you will like this new feature. What's more important, I believe it will enable you to build even greater sites and applications. Take care!
Yes!!! This is brilliant, thank you. It will save workarounds with iftags and make the ListPages module and our dataform applications even more powerful. Off to do some testing. A good day!
Rob Elliott - Strathpeffer, Scotland - Wikidot first line support & community admin team.
Amazing. I'll start using it today!
WikiWealth.com - Stock, Fund, Commodity & Currency Research | SWOT Analysis, WACC
Thankyou!!! Just what I needed for my current project!
Cool stuff!
Awww yeah! This will prove super duper useful for one of my age old ideas! Thanks Wikidot :D
Timothy Foster - @tfAuroratide
Auroratide.com - Go here if you're nerdy like me
THANK YOU MICHAL!!!!
Wikidot just became amazing! This is the best feature ever to bring to Wikidot!
You just made my holiday!
CEO of Icon Deposit
Take a look at me via Twitter, Dribbble, and Google +
I am working on http://genealogy-template.wikidot.com/ with a database alike structure
( look at Albert Einstein (1879-1955) )
and you will see I have to use a lot of tags with the pagepath fullnames duplicated..
It would be very helpfulll if this new dataform fields search/selection in the ListPages would have the same velocity in finding the pages as over the tags ( which are using a second index I assume - the dataform fields are not using an index ?)
Therefore I would prefer a selection on the "fullname" ( a direct read in a ListPage module of ONE page by the fullname ).
Anyway - I have to test the results in differfent listpages and a lot of pages…
But Thank you for the opportunity!
Service is my success. My webtips:www.blender.org (Open source), Wikidot-Handbook.
Sie können fragen und mitwirken in der deutschsprachigen » User-Gemeinschaft für WikidotNutzer oder
im deutschen » Wikidot Handbuch ?
Great news (and perfectly timed). Thank you.
This is just great - the new functionality makes it easy to create Dynamic Listpages that need just a single ListPages module to show different lists depending on what the user chooses from a dropdown selection. Using the example of bands that we have in the documentation you can display a list of rock bands or folk bands or country bands etc all with just one ListPages module.
The key point is that you don't need to hard-code the selection parameter but can use %%form_raw{field}%% to select it on-the-fly.
A working example of this is at http://vineyard.wikidot.com/bands:main which is unrestricted so you can try this out and see the code both there and on the bands:_template page.
When creating a band in the band category there is a select field called type for the type of music. I have also put that same field into the bands:_template page so we can use a dropdown list to select the type of band. The bands:_template page also holds the ListPages module:
I have then just put an edit button on the bands:main page which opens the dataform, you select the type of band you want, save the page and the new list is displayed.
I'll add something to the documentation about this when I get a chance.
(Edit: an example of this in action on a live site is at http://marblesprings.wikidot.com/humans-connect:page)
Rob Elliott - Strathpeffer, Scotland - Wikidot first line support & community admin team.
Thank you Michael! We look forward to implementing it.
Ye Olde - Creator and Chief Admin of www.music-industrapedia.com (Global Music Industry Directory & Encyclopedia) hosted on Wikidot.