Loading...
 
Features / Usability

Features / Usability


[SOLVED] Does 'Tracker Field Rules' work on Wiki Pages?

posts: 162 Ukraine

Hi,

I'm testing out https://doc.tiki.org/Tracker-Field-Rules and it works in the Tracker back-end, but could not get it to work on Wiki pages via PluginTracker.

In the PluginTracker GUI I see two fields have been added referring to this but could not find any documentation: - in

Screenshot From 2021 02 22 19 13 06

I think for the first field, 'Use field rules' I have the correct input: 'Yes' with a big letter 'Y' (so similar to the other dropdowns where you can choose 'Yes' or 'No')

But I can't seem to get the 2nd one to work, 'Field rules parent selector' - it sounds like the name of the 'parent' field needs to be entered here. I tried the 'fieldId', field name and permanent name, but none worked.

1st field (dropdown) is 'Type' (f_69, perm. name 'tType') - 4 options:

  • consulting,freelance,vendor,sub-contract,other

Here is how I set up the 'Rules':
Screenshot From 2021 02 22 19 25 44

(I don't know or understand what the 'Required' is for but it was used in the example on https://doc.tiki.org/Tracker-Field-Rules so followed this example - I tested both with and without this 'Required' rule and both work correctly in the Tracker Back-end)

2nd field (text), or the 'Conditional' field is 'Sub-Contractor' (f_197, perm. name 'tSubContractor').

Any help would be great, than I could add this info to this 'Docs' page.

br,
Mike

posts: 126731 United Kingdom
Mike Finko wrote:
But I can't seem to get the 2nd one to work, 'Field rules parent selector' - it sounds like the name of the 'parent' field needs to be entered here. I tried the 'fieldId', field name and permanent name, but none worked.


Hi Mike

Did you try it empty? The "parent selector" is a css/jquery selector for which element in the DOM to show of hide. If you're using a normal tracker edit or plugin without a pretty tracker template then you should leave this blank.

It is described a bit on https://doc.tiki.org/plugintracker#Parameters (as rulesparent)

posts: 162 Ukraine

Hi Jonny,

sorry, I forgot to include in my previous post that the first time I tried using PluginTracker on a wiki page, no tpl (after testing the Rules in the Tracker back-end) I did leave these fields empty, only because I did not even know they were in the GUI. I only looked for them after the conditional field (Sub-Contractor) would not display when choosing 'sub-contracted' from the dropdown of 'Type'.

I tried both without the conditional field in the PluginTracker and with it (in which case, it was visible all the time).

br,
Mike

posts: 162 Ukraine

Hi Jonny,

I tested again, with a new Tracker and got Tracker Field Rules to work on a wiki page.

First mistake, I was using a wiki page template, but currently do not know how to correctly configure the second field ('Field Rules Parent Selector'), so will attempt this another time.

So I left this second configuration option empty ('Field Rules Parent Selector') and only added a 'y' to first option 'Use Field Rules' (maybe good someday to make this a dropdown, 'yes/no' with default 'no' for consistency throughout PluginTracker?)

When I tried with just Plugin Tracker on a wiki page, I found that the field Id does need to be included/listed and Tracker Field Rules correctly hides it until meeting the criteria of the Rules. Optionally, you could not fill in the PluginTracker param 'fields' and all the fields will be displayed by default, and the 'Rules' would work, though I have found in practice you loose a lot of flexibility (sorting the order of the fields, not listing irrelevant fields, etc.)

Solved in 20 days from my original post! Most of that time was 'time away' from the problem to get a 'fresh' look at it.

br,
Mike

posts: 126731 United Kingdom

Good news, well done Mike - lots more documentation is needed i know!

Regarding making it work on a custom "pretty" template form, the "Field Rules Parent Selector" is not so hard to work out, if you're even slightly familiar with your browser's DOM Inspector... i'll put a note on Tracker Field Rules.

Thanks also for pointing out the parameter inconsistency, will fix that when i'm next in the area mrgreen


posts: 126731 United Kingdom

Hi Mike

Sorry, can't visualise this from your description, can you set up a show instance, or a demo somewhere else if that's not working?

posts: 162 Ukraine

Hi Jonny,

As this Feature is clearly labeled 'Experimental', I understand and expect there could be issues.

I have no doubt it would work on a 'Show Instance', where all the settings/configs are ideally set-up for Tiki. I need to understand why it's not working on my 'real world' Tiki instance. So I just don't see the sense in creating a 'Show Instance'.

However, since you are the major contributor for this Feature - if you think it would be beneficial for this Feature to do a Jitsi screen share to better understand where there may be a configuration conflict, I would be happy to do this.

If you are too busy, I understand, I'll just try and add custom JQ to each page based on the info you and Victor shared in the past.

br,
Mike