Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Customisable placeholders in attributions #289

Open
RobQuincey-DC opened this issue Jul 23, 2024 · 0 comments
Open

Customisable placeholders in attributions #289

RobQuincey-DC opened this issue Jul 23, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@RobQuincey-DC
Copy link
Contributor

RobQuincey-DC commented Jul 23, 2024

Attributions currently have a single available placeholder value of {{CURRENT_YEAR}}, which replaces the token with the current year. We would like the ability to have custom placeholders, and perhaps make attributions customisable per version.

Reason for feature

In some cases, the licence number for a particular layer will be different depending on the version being used, but in order to display this different licence number, a whole new layer/basemap source will need to be created with a different attribution. If we had configurable attribution placeholders, we could keep the same layer/basemap and just have parts of the attribution be configurable.

Examples

DB Structure

Attribution_Placeholders

ID Placeholder Default
1 {{OS_Licence_Number}} AC1010101010
2 {{Something_Else}} A default value

Version_Attribution_Placeholders

VersionID PlaceholderID Value
5 1 AC99999999
5 2 A different value

Example attribution with placeholder

Take the following attributions

Name AttributionHTML
1 Crown Copyright and Database Rights OS AC1010101010
2 Copyright Dorset Council. OS Licence Number AC1010101010

Both these attributions have the same licence number. If we were to be given a new licence number, we would have to find all attributions containing that number and change them, which is open to mistakes. New attributions requiring this same number would also need to be manually entered. We could replace these attributions with the following

Name AttributionHTML
1 Crown Copyright and Database Rights {{CURRENT_YEAR}} OS {{OS_Licence_Number}}
2 Copyright Dorset Council {{CURRENT_YEAR}}. OS Licence Number {{OS_Licence_Number}}

And then the OS_Licence_Number would be defined in Attribution_Placeholders and easily replaced.

Example attribution with version specific override

The next level to this is to then override a placeholder at a specific version level. This would allow attributions to change depending on the version they are displayed in. Taking the above examples, by default, the OS_Licence_Number would be AC1010101010, but in the version with ID 5 it would be AC99999999.

Possible simplification

A starting point would be just to add the basic placeholder configuration, without the per-version overrides, as these may be unnecessary, particularly if #290 is implemented as well

@RobQuincey-DC RobQuincey-DC added the enhancement New feature or request label Jul 23, 2024
@VulpesFerrilata VulpesFerrilata self-assigned this Jul 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants