With dynamic style plugins _and_ also with normal attribute-driven style property values ( ${field_whatever} ) we need to be able to reference all attributes in their non-rendered version too.

Instead, the attributes you pick as 'name' and 'description' become ${name} and ${description} and there's no equivalent
non-rendered version. So what usually happens is that you have ${name} as an HTML snippet ("output as link to node") and
you can't get to the actual value for, say, labeling.

I suggest all selected attributes remain in the JS attributes array, with ${name} and ${description} being a duplication
of whatever was choosen for that. Eventually, the popup/tooltip/whatever handler might grow up to be smarter and not
_require_ such-named attributes to exist at all.

Comments

strk’s picture

Status: Active » Needs review

The attached patch adds a checkbox in the Display settings to specify you want to retain the non-rendered version of fields used for name and description in the feature attributes table. Apply with 'patch -p1 < KeepNameDescription.patch' from within openlayers root.

This does the work, altought it'd be nice to be able to be even strictier in what one would want as feature attributes (which one rendered, which not) and also, it'd be nice for tooltips to be configured on a per-layer basis so to know which attribute to read for title and description rather than relying on existance of a 'name' and 'description' field (which forces duplication).

strk’s picture

StatusFileSize
new2.77 KB

The patch...

Status: Needs review » Needs work

The last submitted patch, KeepNameDescription.patch, failed testing.

tmcw’s picture

Is there any reason that this shouldn't be a default? The size of the data, I guess?

zzolo’s picture

Yeah, the better way to go is make this the default, then add the ability to take away the non-rendered version. Though in reality, with excluding fields, you can make the data pretty slim, so not sure if it is even necessary to have the option to remove non-rendered data.

strk’s picture

I kept old behavior as the default to be the least intrusive.

Personally I'd rather drop the forced {name} and {description} aliases and let tooltips/popups configurable
on a per-layer basis if to avoid redundancy, but that sounds even more drastic of a change.

strk’s picture

Status: Needs work » Needs review
StatusFileSize
new2.76 KB

If you're ok with it I'd commit this version, so nobody has anything changed by an upgrade.
I start having too many staging branches and conflicts start to arise...

Attached a version produced by 'git diff --no-prefix', which can be applied without -p1 switch to diff (hopefully makes the patch applier bot happy)

strk’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.