Actually I got the idea from here: https://www.drupal.org/project/glossify/issues/3269949 ✨ Add in a synonyms feature Needs work
Here is what is said there:
With my patch, both "President of the United States" and "POTUS" are candidates to be glossified. Since my sites require only the first found match be glossified, if one term is glossified then the other will not be, regardless of which one occurs first.
But may be we can add a configuration option to behave differently.
Looks like it should be done with plugins rather than hooks.
Fix was released in version 4.2.0-alpha6 → .
Looks like some unit tests would be really welcome.
@sirclickalot problem identified and fixed.
Looks like we didn't need to escape HTML when reinjecting in the DOM using nodeValue.
Could you test this issue's one line fix and tell me how it goes on your side?
Ok, I can reproduce the problem, will investigate.
Do you know at which alpha release version the problem appeared?
Do the single or double quotes have to be in the glossary terms or not?
@sirclickalot the hook signature will slightly change (for the good) in this issue: 📌 New term_data alter hook and term_match hook signature change Active .
You will get in the second parameter the whole term data array instead of just the idea.
And you will be able to customize that term data array with a new hook term_data_alter
coming in the same issue.
Released in 4.2.0-alpha5 → .
MR pushed.
List is restricted to multivalued string fields.
That will be something like this, is it ok?
I think it could be done rather easily, we could a minima use a simple text field in the configuration screen.
@sirclickalot Are you interested in testing such a configuration option?
Never used the Synonyms module → , so can't say if its integration would have some interest.
But thanks for sharing.
Hi @danny-englander, thanks for your MR 👍
Let's wait for some user confirmation that there isn't any undesirable side-effect to this patch and then we should be able to merge it.
mably → created an issue. See original summary → .
mably → created an issue.
Thanks a lot @anybody!
mably → created an issue. See original summary → .
mably → created an issue.
A new hook have been added for blocks:
hook_better_social_sharing_buttons_block_items_alter
@sirclickalot it's fixed in related issue: ✨ Add new setting for jQuery UI Dialog minimum height Active
@sirclickalot would you be interested in having a min-height
setting for the jQuery dialog?
It could reduce the small display glitch we get with the resize in auto mode.
Hi @anybody, we have made quite a few improvements to the Taxonomy Term Glossary module on the recent weeks.
Would you mind adding a link to our module on the Glossify module home page as we just did on ours?
Fixed in 4.2.x dev branch.
Ok, let's force it to auto
on mobile (width < 500px)
It should be custom_drupal_overrides_term_glossary_term_match_alter
, you miss the match in your hook name.
Here is what I get locally:
@sirclickalot This issue's MR adds a new hook that should solve your problem.
You just need to add this hook in your theme or a custom module:
/**
* Implements hook_term_glossary_term_alter().
*/
function my_module_term_glossary_term_alter(&$term_tag, &$term_id, &$term_value) {
// Here alter the term button HTML render array.
$term_tag['#attributes']['data-bs-toggle'] = 'tooltip';
$term_tag['#attributes']['data-bs-placement'] = 'bottom';
$term_tag['#attributes']['fallbackplacements'] = '["top", "left", "right"]';
$term_tag['#attributes']['data-bs-delay'] = '{"show":1000, "hide":100}';
$term_tag['#attributes']['data-bs-html'] = 'true';
$term_tag['#attributes']['data-bs-title'] = 'Pop up a term definition.';
}
Tell me how it goes.
@niharika.s have you successfully tested it? Are you 100% sure it works?
I guess that would be a breaking change if this template is overridden in some custom site theme...
But may be we can make that change in 4.2.x...
May be we could add a hook to allow altering the HTML of the found glossary term. Will see what I can do. Then the tooltip addition could be done in a submodule or a custom module.
@sirclickalot is not a maintainer of this module.
@vinayakmk47 your commit was not working and clearly not tested so we cannot give credit for that.
Thanks @irinaz, let's merge it then!
Thank you @sirclickalot 😊
mably → created an issue.
Is there a particular reason why the code is using window.location.href
instead of the page_url
variable?
If not, it should be modified to use the same URL than the other buttons.
Can work on a fix if some are interested.
@atowl you would probably use that hook in your custom module like this:
/**
* Implements hook_better_social_sharing_buttons_node_view_alter().
*/
function my_module_better_social_sharing_buttons_node_view_alter(&$items, &$node) {
$config = \Drupal::config('my_module.settings');
if ($config->get('preferred_url')) {
$url = $node->get($config->get('preferred_url'))->value;
if (isset($url)) {
$items['page_url'] = $url;
}
)
}
mably → created an issue.
Not sure it could be merged as is. It should probably be done in another module.
But I like the idea of having the possibility to use a different or modified url than the current page URL.
I will have to think about it.
We could then add a hook that would allow other modules to generate that substitute URL as they like...
Fix has been released on 4.2.x dev branch.
@sirclickalot it has been merged in dev branch 4.2.x, should be easier to deploy.
@sirclickalot 500px are the new default width and height for the dialog. It can be changed.
Will be fixed in 💬 Allow for customisation of width of pop-up dialog Active .