lucid-fox / social-magick

An Open Graph Image generator plugin for Joomla 3 and 4
GNU General Public License v3.0
15 stars 1 forks source link

Now Social Magick has to be enabled on each menu item. Suggestion would be to have an option to enable it by default #28

Closed woluweb closed 3 years ago

woluweb commented 3 years ago

What is the use case of your proposed feature?

As it is now Social Magick has to be enabled on each menu item. This has two disadvantages:

  1. This can be quite cumbersome to edit each and every menu item "just" to enable
  2. And over time when users will create new menu items they are likely to forget about enabling Social Magick

Describe the solution you'd like

So my suggestion would be something which is hopefully

Namely:

(fyi: this kind of "default setting" is implemented for example with this SocialMeta plugin: https://github.com/vistamedia/socialmeta)

nikosdion commented 3 years ago

I'll go ahead and mark it as invalid because this is what the “Generate Open Graph images by default” option in the plugin does.

The default state of the menu item's control for OG images is "inherited" which uses the plugin-level setting.

That's also why we have a “Default Template” plugin option so the plugin knows which template to use if it's enabled by default. Also remember that the default menu items options are to use the article title with a fallback to the browser page title and to use the full text image.

If you want all menu items of a category to have different settings you can override them in the category settings. Likewise, if you want specific subcategories or articles to have different preferences you can do it there as well.

The inheritance goes: menu item overrides article overrides category overrides parent category overrides plugin-level settings.

woluweb commented 3 years ago

Yes, actually I had written this just before installing beta3.

And the first thing I see when editing beta3 was... exactly that feature 😄

So that was quick: developed even before I asked for the feature ;)

More seriously: I have tested the "default" setting. There seems to be one little issue:

  1. you enable and configure the default at the plugin level
  2. then you see the og:image even for menu items which were never edited. Great.
  3. BUT the full_image is not taken into account...
  4. then you edit that menu item, you don't change anything but you save
  5. and then the og:image integrates indeed the full_image
nikosdion commented 3 years ago

Yup, there was a disparity between the defaults in the plugin's code and the defaults in the menu options XML form. Thank you for the heads up! Apparently this was the only disparity.