gsuez / master-bootstrap-3

Joomla 3.x Template with Bootstrap 3
https://www.masterbootstrap.com/
142 stars 90 forks source link

Changed info in Open Graph for Master Bootstrap #50

Closed brettvac closed 6 years ago

brettvac commented 6 years ago

Hi, I accidentally left info for my personal site in the file defaut.php. I've changed it to include information specific to masterbootstrap. This way people can customize it more easily :)

gsuez commented 6 years ago

ok Brett, thank you! You have a little tutorial for "how does it work" this feature? I would like to add it. Regards

brettvac commented 6 years ago

Hi Gonzalo, I pretty much followed the instructions on this website https://www.collectiveray.com/joomla/joomla-tutorials/add-facebook-open-graph-and-twitter-cards-to-joomla.html.

For the open graph cards to be customized, you need to set the following lines in default.php

<meta property="og:email" content="info@masterbootstrap";/>

This is where you would replace the masterbootstrap defaults with your name and your twitter handle. Maybe there is a way of adding this to the template options instead of having the user directly edit the default.php file?

For the image to work you need to add an intro image to your article and it will show up on the card.

The intro text is generated automatically from the article text. But the intro text can be a bit long if you don't use a "read more" line because it will copy the whole article. Maybe adding this to limit the length of the open graph description is a good idea: <meta name="twitter:description" content="'.mb_strimwidth(strip_tags($this->item->introtext),0,45).'"/> or <meta property="og:description" content="'.substr(strip_tags($this->item->introtext), 0,45).'"/>

Anything else please let me know!

Kind regards, Brett