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

Feature request: Allow callable fallbacks for $smtgTagsProperties #61

Closed
alex-mashin opened this issue Sep 9, 2020 · 5 comments
Closed

Comments

@alex-mashin
Copy link
Contributor

Proposal: if $smtgTagsProperties['tag name'] or $smtgTagsProperties['tag name'][some index] is callable, call it, passing OutputPage &$out and perhaps ParserOutput $parserOutput to it, and assign the return, if it does not evaluate to false, to the meta tag.

Reason: property values are not always set, but a non-semantic fallback can often be found. However, this fallback value should usually depend on the current page and localised messages, and trying to access both from LocalSettings.php gives horrible results, to the point of effectively breaking MediaWiki.

This feature can totally replace $smtgTagsStrings, also resolving #60.

@alex-mashin alex-mashin changed the title Allow callable fallbacks for $smtgTagsProperties Feature request: Allow callable fallbacks for $smtgTagsProperties Sep 9, 2020
@kghbln
Copy link
Member

kghbln commented Sep 9, 2020

Thanks for creating the issue.

also resolving #60.

This assumes that something is set to the meta element, e.g. description, I guess. Thus I still need to set it somehow?

@alex-mashin
Copy link
Contributor Author

alex-mashin commented Sep 9, 2020

I am not sure if I understand your question correctly. An example of a callback "property" assigned to a metatag can be seen in the commit message to my pull request #62, which you are kindly invited to review. A callback function can return string constants as well, making $smtgTagsStrings redundant, and, in combination with the $smtgTagsPropertyFallbackUsage = true setting, it can achieve your goal in #60.

@alex-mashin
Copy link
Contributor Author

Is this extension still maintained?

@alex-mashin
Copy link
Contributor Author

Anybody at home?

JeroenDeDauw added a commit that referenced this issue Sep 18, 2020
This change addresses the feature request #61.
kghbln pushed a commit that referenced this issue Sep 21, 2020
* This PR is made in reference to: #61

It documents the changes introduced by #62.
@kghbln
Copy link
Member

kghbln commented Sep 21, 2020

@alex-mashin Will do a release soon, probably later this day. Thanks a lot!

@kghbln kghbln closed this as completed Sep 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants