shondalai / cjblog

CjBlog is a free Joomla! component for creating awesome community blogs

Home Page:https://shondalai.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Custom tag for Social Media buttons

Ruud68 opened this issue · comments

commented

In version 1.4.2 we added a custom tag (e.g. {jssocials}) as Social Media buttons provider.

Issue

Version 2.0 handles the placement of Social Media buttons via corejoomla plugins that are triggered on onSocialsDisplay. One plugin is provided as part of the cjlib package.

Expected result

It should be possible to configure a custom tag (text field) that will be displayed and rendered as part of the content plugins to add the possibility of adding other (existing / non corejoomla plugins) to add Social Media buttons.

Proposed solution

There are two solutions:

  1. Preferred (for me :) > add in the plg_corejoomla_socials.zip an extra text field 'custom tags'
    return the contents of that text field if not empty. Tested this and it works)

  2. Create a new plugin that triggers on onSocialsDisplay and that returns the configured text field.

Next step

I can do both preferred changes for you (not via PR as these plugins are part of cjlib which is not on github).
Easiest would be to make the change for the plg_corejoomla_socials plugin as this will then be automatically be part of the cjlib package.

Did you mean a content plugin which replaces the tag and display the social buttons?

commented

I have created my own content plugin for putting Social Media buttons on pages: https://onlinecommunityhub.nl/joomla-extensions/jssocials
It can put them automatically on articles, but it can also put them in articles (and modules) by adding {jssocials} to the text.

In proposed solution 1 I will change the plg_corejoomla_socials to allow for a custom text. This will be a text field.
The value of the field should (when filled) be returned by the plg_corejoomla_socials.

So if I configure the custom tag (text) {jssocials} the plg_corejoomla_socials will not output the build-in Social Media sharing buttons, but the text {jssocials}.

My own content plugin will then replace the {jssocials} tag with the configured social media sharing buttons. That way I can configure the social sharing buttons in a consistent way over my site (including other components like e.g. Kunena).

In cjblog version 1.4.2 this was build in the component [Social Buttons] tab
image

If you have your own plugin to replace the shortcode, I believe you don't need to use this plugin at all. You can simply modify your plugin code to add the social buttons to the article by default without checking for any short code (just want cjsocials plugin does). Why do you need two plugins for the same task?

commented

agree for my plugin, but this will open up all plugins that use a tag.
It is then not only limited to social media buttons, but you can even insert snippets, articles, adds, etc.
Trying to look further then my own plugin :)