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.

Yes. I just need to look at Rob's code again and learn how to strip out the Jb-type....
  • ODiN Mayland's Avatar
  • ODiN Mayland
  • LIfetime Developer - Big Bamboo
  • 818 posts
  • 10 Thanks
  • Karma: 8
The administrator has disabled public write access.
Thanks - best of luck with it

Cheers
Paul
  • manh's Avatar
  • manh
  • Moderator
  • 45248 posts
  • 2106 Thanks
  • Karma: 603
The administrator has disabled public write access.
robwent wrote:
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

I am still struggling with this. Can you help me with specific code OR give me a link to a way for me to learn the correct code?
  • ODiN Mayland's Avatar
  • ODiN Mayland
  • LIfetime Developer - Big Bamboo
  • 818 posts
  • 10 Thanks
  • Karma: 8
The administrator has disabled public write access.
Try this:
$doc = JFactory::getDocument();
$title = preg_replace('#{jb_icon-(.*?)}(.*?){/jb_icon-(.*?)}#s', '', $this->title);
$doc->setMetaData( 'og:title', $title );

I think that should strip anything between {jb_icon-*} tags.
  • Robert Went's Avatar
  • Robert Went
  • Moderator
  • 2210 posts
  • 196 Thanks
  • Karma: 90
The administrator has disabled public write access.
I tried that but it didn't work:
// Create shortcuts to some parameters.
$doc = JFactory::getDocument();
$title = preg_replace('#{jb_icon-(.*?)}(.*?){/jb_icon-(.*?)}#s', '', $this->title);
$doc->setMetaData( 'og:title', $title );

File Attachment:

File Name: default.php.zip
File Size: 4 KB
  • ODiN Mayland's Avatar
  • ODiN Mayland
  • LIfetime Developer - Big Bamboo
  • 818 posts
  • 10 Thanks
  • Karma: 8
Last Edit: 7 years 8 months ago by ODiN Mayland.
The administrator has disabled public write access.
Hi Jeff,

Could you try attaching the file again, the zip seems corrupt.

Is there a page where we can see the output?

Regards,

Rob
  • Robert Went's Avatar
  • Robert Went
  • Moderator
  • 2210 posts
  • 196 Thanks
  • Karma: 90
The administrator has disabled public write access.
Typical article page: transitionconsultants.com/practices-for-sale/medical-practices/619-primary-care-internal-medicine-practice-for-sale-new-york-ny
JHtml::addIncludePath(JPATH_COMPONENT . '/helpers');

// Create shortcuts to some parameters.
$doc = JFactory::getDocument();
$title = preg_replace('#{jb_icon-(.*?)}(.*?){/jb_icon-(.*?)}#s', '', $this->title);
$doc->setMetaData( 'og:title', $title );
$params  = $this->item->params;

File Attachment:

File Name: default.php_2016-08-23.zip
File Size: 4 KB
  • ODiN Mayland's Avatar
  • ODiN Mayland
  • LIfetime Developer - Big Bamboo
  • 818 posts
  • 10 Thanks
  • Karma: 8
Last Edit: 7 years 8 months ago by ODiN Mayland.
The administrator has disabled public write access.
Try changing the title line to:
$title = preg_replace('#{jb_icon-(.*?)}(.*?){/jb_icon-(.*?)}#s', '', $this->item->title);

This strips everything between the jbtype tags though, so you would need to change the title to move the text out of the brackets:
PENDING
  • Robert Went's Avatar
  • Robert Went
  • Moderator
  • 2210 posts
  • 196 Thanks
  • Karma: 90
The administrator has disabled public write access.
{ jb_icon-time }{ /jb_icon-time }PENDING

Without the spaces :)
  • Robert Went's Avatar
  • Robert Went
  • Moderator
  • 2210 posts
  • 196 Thanks
  • Karma: 90
The administrator has disabled public write access.
The attached should strip any jbtype tags but leave the text in the middle, so you don't need to edit any titles.
Attachments:
  • Robert Went's Avatar
  • Robert Went
  • Moderator
  • 2210 posts
  • 196 Thanks
  • Karma: 90
The administrator has disabled public write access.
Unfortunately, I am not having any luck.

I uploaded your php file here: /templates/zenbase/html/com_content/article/default.php
Cleared all cache
But the title is now only showing the shortcode: transitionconsultants.com/practices-for-sale/medical-practices/619-primary-care-internal-medicine-practice-for-sale-new-york-ny


ScreenShot2016-08-23at10.38.14AM.jpg
  • ODiN Mayland's Avatar
  • ODiN Mayland
  • LIfetime Developer - Big Bamboo
  • 818 posts
  • 10 Thanks
  • Karma: 8
Last Edit: 7 years 8 months ago by ODiN Mayland.
The administrator has disabled public write access.
Hi Jeff,

Can you open a ticket with ftp details so I can take a look?

Looks like the full title is still there but it's breaking to 2 lines.
  • Robert Went's Avatar
  • Robert Went
  • Moderator
  • 2210 posts
  • 196 Thanks
  • Karma: 90
The administrator has disabled public write access.
SUPPORT-93V3VV457R
  • ODiN Mayland's Avatar
  • ODiN Mayland
  • LIfetime Developer - Big Bamboo
  • 818 posts
  • 10 Thanks
  • Karma: 8
The administrator has disabled public write access.
Thanks
  • 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