Field values depending on previous field
gerdami wrote on 28 Feb 2010 14:50
[[form]]
region:
label: Choose a wine region
type:select
values:
1: Bordeaux
2: Bourgogne
aoc:
label: Choose an AOC
type: select
values:
1:1: Medoc
1:2: Pauillac
1:3: St-Emilion
2:1: Cotes de Nuits
2:2: Cotes de Beaune
2:3: Chablis
[[/form]]
Comments: 10
page revision: 0, last edited: 28 Feb 2010 14:50
Pagepath works like this, only difference is - you cant place it in 2 separate lines.
Bartłomiej Bąkowski @ Wikidot Inc.
';.;' TeRq (Write PM)
Yes but…
[[form]]
fields:
wine:
label: Wine name
type: text
aoc:
label: Choose an AOC
type: pagepath
category: vineyard
[[/form]]
Let's take a glass of Chateau Latour:
France > Bordeaux > Pauillac
Currently, with ListPages I can only display the rightmost part of the path
%%form_data{wine}%%, %%form_data{vineyard}
will display Chateau Latour, Pauillac
but neither "France" or "Bordeaux".
Q: how can I refer to "France"
A: with %%form_data{vineyard}(1) ?
gerdami - Visit Handbook en Français - Rate this howto:import-simple-excel-tables-into-wikidot up!
Gerdami, I would also like this functionality. Thank you for explaining/requesting it.
I need a way to show not just the final option in the pagepath, but every option — in a similar way to how breadcrumbs works (except _root would not be displayed)
~ Leiger - Wikidot Community Admin - Volunteer
Wikidot: Official Documentation | Wikidot Discord server | NEW: Wikiroo, backup tool (in development)
You're welcome.
gerdami - Visit Handbook en Français - Rate this howto:import-simple-excel-tables-into-wikidot up!
Looks good, could be:
%%form_data{fieldname}(3)%% — select third element
%%form_data{fieldname}%% — select last element
%%form_data{fieldname}(n)%% — same as above
%%form_data{fieldname}(2..4)%% — select range
%%form_data{fieldname}(3..n)%% — select range up to last element
we surely back to this later with expansion of pagepath functionality.
Is it nice for you ??
Bartłomiej Bąkowski @ Wikidot Inc.
';.;' TeRq (Write PM)
http://projects.wikidot.com/thread:295
maybe a syntax like this
Okay for this we need the name-selector for listpages and a new page-variable %%breadcrums{n}%%
if n>0 then start at _root-level+1 until level n or less (last item)
if n<0 then start at last-level-n until last level or stop at _root-level+1
So imagen the pagepath would be
Europe —> Belgium —> Limburg —> Hasselt —> Somestreet
%%breadcrumbs{3}%% would give "Europe —> Belgium —> Limburg"
%%breadcrumbs{-3}%% would give "Limburg —> Hasselt —> Somestreet"
%%breadcrumbs{6}%% would give "Europe —> Belgium —> Limburg —> Hasselt —> Somestreet" = %%breadcrumbs{5}%% = %%breadcrumbs{-5}%%
A - S I M P L E - P L A N by ARTiZEN a startingpoint for simple wikidot solutions.
Breadcrumbs are not the same as data_form (pagepath field).
example (parent—child hierarchy):
page_A —> page_B —> _root —> pp_lvl_1 —> pp_lvl_2 —> pp_lvl_3
pagepath part is bolded
Bartłomiej Bąkowski @ Wikidot Inc.
';.;' TeRq (Write PM)
I realise, that's why I wrote "until _root - level+1", beeing "pp_lvl_1"
And this would also work fine for otherpages : IF also every normal page (page without a parent) would have the page sitename.wikidot.com / _root as his parent by default.
To calulate or display the breadcrumbs, you can go up untill you encounter a page called "_root".
A - S I M P L E - P L A N by ARTiZEN a startingpoint for simple wikidot solutions.
Please have a look at http://community.wikidot.com/celex2:_start , where I generate links to the law database, then at the bottom of this page http://www.ellispub.com/ojolplus/help/celex.htm
which shows that the document types depend on the sector.
With the current pagepath implementation, it is impossible to generate links part by part.
gerdami - Visit Handbook en Français - Rate this howto:import-simple-excel-tables-into-wikidot up!
As I already mentioned functionality of pagepath will be extended, but probably we will not use breadcrumbs name as alternative way to call specific form field (especially there could be few pagepath fields in one form). And 'n' in range is strange to, maybe it should be a '*' (all) like in other wikidot modules?
Bartłomiej Bąkowski @ Wikidot Inc.
';.;' TeRq (Write PM)