Support Forum

Please note that this forum is only available to you in read only mode. In order to contribute to this conversation you will need to renew your subscription.

do not show shortcode icons in share title

zentoolsIf you use Zentools please post a review at the Joomla! Extensions Directory.

I am using ReReplacer to replace NEW with { jb_icon-bullhorn}NEW{ /jb_icon-bullhorn}

The social sharing is from sh404sef.

Is there a way to not show the shortcode when people share the page?


I have also tried not using ReReplacer, but just typing in the code manually still gets shared as code. { jb_icon-bullhorn}New{ /jb_icon-bullhorn}

Example page:
transitionconsultants.com/practices-for-sale/medical-practices/619-primary-care-internal-medicine-practice-for-sale-new-york-ny


ScreenShot2015-12-03at8.04.47AM.jpg


ScreenShot2015-12-03at8.04.24AM.jpg
Attachments:
  • ODiN Mayland's Avatar
  • ODiN Mayland
  • LIfetime Developer - Big Bamboo
  • 818 posts
  • 10 Thanks
  • Karma: 8
Last Edit: 4 years 6 months ago by ODiN Mayland.
The administrator has disabled public write access.
Hi Jeff,

I'm pretty sure this is down to the plugin you are using to do that.

The plugin is grabbing the title of the page before jb type is getting processed so the tag is getting included.

I wonder if it would matter if you changed the order of the plugins in the plugin manager? eg make sure JB Type is triggered first (dont recall if that means it's higher or lower in the order).

Otherwise I would have to see how the plugin is accessing the title for the page.

Thanks
  • Anthony Olsen's Avatar
  • Anthony Olsen
  • LIfetime Developer - Big Bamboo
  • 23925 posts
  • 788 Thanks
  • Karma: 433
The administrator has disabled public write access.
To test, I disabled sh404sef, the social sharing plugin, and simply pasted in the url to facebook. The code still does not render the icon.

Do you think that, for example, facebook will render the icon?
ScreenShot2015-12-03at9.08.19PM.jpg
  • ODiN Mayland's Avatar
  • ODiN Mayland
  • LIfetime Developer - Big Bamboo
  • 818 posts
  • 10 Thanks
  • Karma: 8
The administrator has disabled public write access.
I then disabled ReReplacer and manually typed in:
{ jb_icon-bullhorn}New{/jb_icon-bullhorn}Dental Practice for Sale - Mission Viejo, CA

transitionconsultants.com/practices-for-sale/dental-practices/619-dental-practice-for-sale-mission-viejo-ca

But still got the code:

ScreenShot2015-12-03at9.18.01PM.jpg
  • ODiN Mayland's Avatar
  • ODiN Mayland
  • LIfetime Developer - Big Bamboo
  • 818 posts
  • 10 Thanks
  • Karma: 8
The administrator has disabled public write access.
My assumption is to not allow Jb-type to get displayed when sharing the URL.

Is it just my site or if you put code in the article title does it also just show the code?
  • ODiN Mayland's Avatar
  • ODiN Mayland
  • LIfetime Developer - Big Bamboo
  • 818 posts
  • 10 Thanks
  • Karma: 8
The administrator has disabled public write access.
The icon wont show up on facebook even if the tag is converted. It has to do with the way the OG tags are created on the page.

Not sure what you mean by this:
Is it just my site or if you put code in the article title does it also just show the code?

Thanks
  • Anthony Olsen's Avatar
  • Anthony Olsen
  • LIfetime Developer - Big Bamboo
  • 23925 posts
  • 788 Thanks
  • Karma: 433
The administrator has disabled public write access.
I assumed that was the case.

Do you know of a way to not let the code be parsed when sharing?

Basically, how would you put icons in the article title that get rendered on the joomla website but do not show in facebook, linkedin, etc?
  • ODiN Mayland's Avatar
  • ODiN Mayland
  • LIfetime Developer - Big Bamboo
  • 818 posts
  • 10 Thanks
  • Karma: 8
The administrator has disabled public write access.
Hi Jeff,

As the plugin is taking the og meta directly from the database I think the only easy way to correct it would be by replacing the og title tag in a template override.

When meta is added to the head of Joomla, it will only show one version of the same tag, so if you override it it should replace the one added by sh404sef.

In the templates /html/com_content/article/default.php you could try something like this.
$doc = JFactory::getDocument();
$doc->setMetaData( 'og:title', $this->title );

The only issue might be that og tags use the 'property' attribute rather than 'name'. As 'property' is not part of the spec it's not part of Joomla's functions so sh404sef is probably not using it to add the tags.

ROb
  • Robert Went's Avatar
  • Robert Went
  • Moderator
  • 2210 posts
  • 196 Thanks
  • Karma: 90
The administrator has disabled public write access.
I need to revisit this issue.

Here is the source code that shows the meta that is being displayed on this sample page: transitionconsultants.com/practices-for-sale/medical-practices/635-selling-a-pain-management-practice-in-bay-county-michigan


ScreenShot2016-06-03at12.28.03AM.jpg


The "icon-bullhorn" does not appear in the DB.

I still have not been able to get the "icon-bullhorn" to not be inserted in the meta....
  • ODiN Mayland's Avatar
  • ODiN Mayland
  • LIfetime Developer - Big Bamboo
  • 818 posts
  • 10 Thanks
  • Karma: 8
Last Edit: 4 years 2 days ago by ODiN Mayland.
The administrator has disabled public write access.
Did you add code to override the og tag?
  • Anthony Olsen's Avatar
  • Anthony Olsen
  • LIfetime Developer - Big Bamboo
  • 23925 posts
  • 788 Thanks
  • Karma: 433
The administrator has disabled public write access.
  • ODiN Mayland's Avatar
  • ODiN Mayland
  • LIfetime Developer - Big Bamboo
  • 818 posts
  • 10 Thanks
  • Karma: 8
The administrator has disabled public write access.
Do you think this is an issue solely on my site? Or can you replicate the issue?
  • ODiN Mayland's Avatar
  • ODiN Mayland
  • LIfetime Developer - Big Bamboo
  • 818 posts
  • 10 Thanks
  • Karma: 8
The administrator has disabled public write access.
Hi Jeff,

The plugin code for any plugin is stored in the database in the same way that you type it into the editore, so you will not see html for the icons in the database. The plugin runs as the page is renered and picks out it's own plugin codes and converts them into the output they should have.

As sh404sef is taking the title directly from the database it is bypassing the plugin that renders the code, so it gets outputted directly without any conversion.

Even if the the plugin code was tuerned into html, you wouldn't get icons showing in facebook, since they require assets that are loaded by your site, but not by facebook. So the only option would really be to strip out any plugin code.

The code I gave above just grabs the title and puts it in a meta tag, without doing anything to it, so it would need to be modified to make it output the content you want.

Assuming that anything between {} is plugin code, you could try this
$doc = JFactory::getDocument();
$title = preg_replace('/{[\s\S]+?}/', '', $this->title);
$doc->setMetaData( 'og:title', $title );

You would also need to stop the sh404sef title tag loading.

If you are using standard Joomla articles, then it may just be easier to turn off the tags in sh404sef and add them all manually to the override.

Rob
  • Robert Went's Avatar
  • Robert Went
  • Moderator
  • 2210 posts
  • 196 Thanks
  • Karma: 90
The administrator has disabled public write access.
Please confirm that I placed in the right location:

ScreenShot2016-06-27at10.09.43AM.jpg
  • ODiN Mayland's Avatar
  • ODiN Mayland
  • LIfetime Developer - Big Bamboo
  • 818 posts
  • 10 Thanks
  • Karma: 8
The administrator has disabled public write access.
Looks right to me - if you have cache enabled you may need to clear your J cache. Let us know if that solves it.
Anthony
  • Anthony Olsen's Avatar
  • Anthony Olsen
  • LIfetime Developer - Big Bamboo
  • 23925 posts
  • 788 Thanks
  • Karma: 433
The administrator has disabled public write access.
All jcache and browser cache is cleared but on the example page:
transitionconsultants.com/practices-for-sale/medical-practices/619-primary-care-internal-medicine-practice-for-sale-new-york-ny

view-source:http://transitionconsultants.com/practices-for-sale/medical-practices/619-primary-care-internal-medicine-practice-for-sale-new-york-ny

I still get:
<meta name="twitter:card" content="summary" />
<meta name="twitter:site" content="@Med_Consultant" />
<meta name="twitter:title" content="PENDING
Dental Practice for Sale - Mission Viejo, CA" />
<meta name="twitter:description" content="PENDING
Dental Practice for Sale - Mission Viejo, CA" />
<meta name="twitter:url" content="transitionconsultants.com/practices-for-sale/medical-practices/619-primary-care-internal-medicine-practice-for-sale-new-york-ny" />
<meta property="og:locale" content="en_GB" />
<meta property="og:title" content="PENDING
Dental Practice for Sale - Mission Viejo, CA" />
<meta property="og:type" content="article" />
<meta property="og:url" content="transitionconsultants.com/practices-for-sale/medical-practices/619-primary-care-internal-medicine-practice-for-sale-new-york-ny" />
<meta property="og:site_name" content="Transition Consultants - Medical Practice Sales, Appraisal, Financing" /></head>
  • ODiN Mayland's Avatar
  • ODiN Mayland
  • LIfetime Developer - Big Bamboo
  • 818 posts
  • 10 Thanks
  • Karma: 8
The administrator has disabled public write access.
Hi Jeff,

I can see the og title on the page.

The code I gave was just really an example. You can now use it to strip anything out of the content.

Just to be clear, you need to strip out anything between {} ?

Rob
  • Robert Went's Avatar
  • Robert Went
  • Moderator
  • 2210 posts
  • 196 Thanks
  • Karma: 90
The administrator has disabled public write access.
Hi Jeff,

Hope above is ok

Is it ok if I pop you over an email? - we are looking at some front end editing functionality as a club release

I / Anthony was wondering if I could have a chat about it with you as I believe your clients do use front end editing (my apologies if I've got my wires crossed)

Cheers
Paul
  • manh's Avatar
  • manh
  • Moderator
  • 45248 posts
  • 2106 Thanks
  • Karma: 603
The administrator has disabled public write access.
Due to my management agreements, I do my best to not allow the clients to edit anything on their own. The ones that I had frontend access for, that did not want to use my management, I was forced to train them in the backend.
  • ODiN Mayland's Avatar
  • ODiN Mayland
  • LIfetime Developer - Big Bamboo
  • 818 posts
  • 10 Thanks
  • Karma: 8
The administrator has disabled public write access.
The following user(s) said Thank You: manh
ah thanks for letting me know :)

Are you having still having problems with forum question?

Cheers
Paul
  • manh's Avatar
  • manh
  • Moderator
  • 45248 posts
  • 2106 Thanks
  • Karma: 603
The administrator has disabled public write access.

zentoolsIf you use Zentools please post a review at the Joomla! Extensions Directory.

Happy Campers