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

Add data-key and data-value to HTML elements #91

Open
h-e-l-l-o-w-o-r-l-d opened this issue May 3, 2023 · 0 comments
Open

Add data-key and data-value to HTML elements #91

h-e-l-l-o-w-o-r-l-d opened this issue May 3, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@h-e-l-l-o-w-o-r-l-d
Copy link

h-e-l-l-o-w-o-r-l-d commented May 3, 2023

Hi,

I would like to style the metamagik information in the card footer and tables. For example hide key x, or set background color for value y or add an icon before value y via CSS :before and so on. Right now this is not possible with plain CSS and I don't want to use JS. It would be possible by adding a lowercased data-key (for title and value) and data-value (for value) to the html elements in these files:

https://github.com/creecros/MetaMagik/blob/761e6d373258e21df7a6a93fae393525853e999f/Template/task/meta_footers.php
https://github.com/creecros/MetaMagik/blob/761e6d373258e21df7a6a93fae393525853e999f/Template/task/metatable.php

So instead of

<span class="metamagik-footer-title"><strong> <?= $custom_field['beauty_name'] ?>: </strong></span>

go with

<span class="metamagik-footer-title" data-key="<?= $custom_field['machine_name'] ?>"><strong> <?= $custom_field['beauty_name'] ?>: </strong></span>

and instead of

<span class="metamagik-footer-value"><?= $this->task->taskMetadataModel->get($task['id'], $custom_field['human_name'], '') ?></span>

go with

<span class="metamagik-footer-value" data-key="<?= $custom_field['machine_name'] ?>" data-value="<?= strtolower($this->task->taskMetadataModel->get($task['id'], $custom_field['human_name'], '')) ?>"><?= $this->task->taskMetadataModel->get($task['id'], $custom_field['human_name'], '') ?></span>

Same for other span elements of course (textarea, number, date...) and in metatable.php accordingly.

The changes would be very small but making the plugin more flexible and nothing would break. ;o)

Thanks in advance and thank you for this very useful plugin.

@h-e-l-l-o-w-o-r-l-d h-e-l-l-o-w-o-r-l-d changed the title Add data-value to HTML elements Add data-key and data-value to HTML elements May 3, 2023
@creecros creecros added the enhancement New feature or request label Apr 17, 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