codefog / contao-social_images Goto Github PK
View Code? Open in Web Editor NEWEnable the images on your website for the social portals like Facebook or Google+
License: MIT License
Enable the images on your website for the social portals like Facebook or Google+
License: MIT License
It would be very helpful if this extension could be used with Contao 5.
I have been wanting to try this extension for quite a while -- thanks for the good work!
Anyway, I just installed it and it works fine. However, here are a few thoughts about how IMHO this extension could be significantly enhanced:
Contao 5.3.3
Social Images 4.1.2
usage in events on detail-event-site:
modified event_full.html5
<div class="col-lg-8">
<div class="entry-image mb-5">
<?php if ($this->addImage): ?>
<?php $this->insert('image', $this->arrData); ?>
<?php endif; ?>
</div>
<?php if ($this->details): ?>
<?= $this->details ?>
<?php else: ?>
<div class="ce_text block">
<?= $this->cspInlineStyles($this->teaser) ?>
</div>
<?php endif; ?>
</div>
og:image
is generatedog:image
with default social image is generatedog-image
for teaser-image at Events setting will be not generated.
og-image
, set in 'Social Image' at Events setting will be not generated
If there are content elements set at event » those images will be generated as og:image
If you allow pretty large images in your Contao installation and an editor happens to use a large image (eg. 5568x3712), Facebook for example might not use the image:
Provided og:image URL, https://example.org/files/content/foo.jpg could not be downloaded because it exceeded the maximum allowed sized of 8Mb.
To counter act such instances it would make sense to provide an image size setting or simply a maximum size setting (in addition to the minimum size setting) in the page layout, so that the image can be downscaled automatically.
First thx for the great plugin :)
I've wondered why my social image on the root page didn't append to the page. The bug is in file SocialImages.php on line 57
if ($objTrail->socialImage && ($objImage = \FilesModel::findByUuid($objPage->socialImage)) !== null && is_file(TL_ROOT . '/' . $objImage->path))
instead of $objPage in the findByUuid method this should be $objTrail
if ($objTrail->socialImage && ($objImage = \FilesModel::findByUuid($objTrail->socialImage)) !== null && is_file(TL_ROOT . '/' . $objImage->path))
// Skip small images
if ($width < 200 || $height < 200)
{
continue;
}
please, add config width, height (in backend)
for example
width = 100
height = 100
I think it would be useful to have the ability to disable the functionality for certain pages in the site structure.
In my case I created a landing page where I moved $this->head;
in fe_page.html5
from the <head>
to the end of the <body>
to prevent JS-files from blocking DOM rendering. This leads to having <meta>
tags in the body. I know this is an edge case but maybe it could be useful in other scenarios too.
The extension doesn't seem to respect the values of the files and assets urls entered in the site structure. Is it possible to build the path to the images in regard to the external urls given for files and assets?
Since the news modules already provide the actual path to the image file via the singleSRC
variable of the template, a small optimization can be done in collectNewsImages
:). This code:
$objFile = \FilesModel::findByPk($arrData['singleSRC']);
if ($objFile !== null && is_file(TL_ROOT . '/' . $objFile->path))
{
$GLOBALS['SOCIAL_IMAGES'][] = $objFile->path;
}
could be replaced by
if (is_file(TL_ROOT . '/' . $objTemplate->singleSRC))
{
$GLOBALS['SOCIAL_IMAGES'][] = $objTemplate->singleSRC;
}
and thus saves a database query.
I think it would be useful if the extension also supported taking the page image defined by the pageimage
extension, when present. This image could be put in front of the other collected images, but after the news teaser image in the images array. So the order in the array would be
I have tried with 2 different Contao versions and I do not see the "Social images" entry under "Themes » Calm » Page layouts » Edit layout ID 30".
Version 3.4.0 and 3.4.4
Can someone reproduce this, or are there some settings I need to adjust?
Today I updated my site http://pmueller.de from Contao 3.2.9 to 3.2.12.
After the update some content elements did not show up in the frontend:
Maybe this has something to do with one of the closed issue #3. My blog disappeared too as it is included as a content element "module".
I have currently uninstalled [social_images], but I can reproduce the error. If I install the extension, my blog disappears and my homepage looks like this:
I really love the extension's simplicity of use and find [social_images] very useful in spreading blog posts on the various media, so I would really appreciate if this could be looked into or ideally fixed ;-)
The extension should not override Image class to collect the images. It should rather use hooks:
Hi there,
We have used this package on a website and ran into an interesting situation. Although things worked as expected for Facebook, Twitter would not grab the correct image. After looking into it our best guess was that although there is an image linked in the og:image tag there was no twitter:image tag.
Although I am not a fan of this, I modified https://github.com/codefog/contao-social_images/blob/master/src/ImageGenerator.php and copied line 91 and just changed og:image to twitter:image and now the twitter card is displaying the correct image.
Is it possible to add support for this natively? Either a checkbox to choose to use OpenGraph, Twitter cards or both? Just brainstorming.
It not really bad, but that typo just jumps right into your face ;-)
https://github.com/codefog/contao-social_images#social_iamges-contao-extension
Hello, we have the problem, that News-Messages from Contao also need this (ever changing) og:image Meta-Description in layout_full-View. Example:
http://evpzh.ch/aktuelles/lesen/rathaus-news-darum-ging-es-heute-u-a-im-kantonsrat-kopie-186.html
How can we get the actual News (Teaser) Image to show up as og:image-Meta-Tag?
It would be nice if the meta tag thumbnail <meta name="thumbnail" content="https://www....">
is not filled in automatically. Here I would like to store a different graphic with 100x100 pixels (https://support.google.com/programmable-search/answer/1626955?hl=de) especially for Google.
Hi there!
I installed the extension in Contao 4.4.55 (https://www.weiterbildungsinstitut.de), enabled social media images in the page layout (number of images: 1) and chose one image (for all pages) in the website root (https://www.weiterbildungsinstitut.de/files/wbi/bilder/social-media/wbi_lehrgaenge.jpg 1000 x 667px).
The extension now creates the right code on every page of the site:
<meta property="og:image" content="https://www.weiterbildungsinstitut.de/files/wbi/bilder/social-media/wbi_lehrgaenge.jpg">
<meta property="og:image:width" content="1000">
<meta property="og:image:height" content="667">
Facebook: if I want to post a link of one of the following pages the correct image is suggested. And if I post "https://www.weiterbildungsinstitut.de/index.html" it also works ...
Only if I want to post "https://www.weiterbildungsinstitut.de" - without "index.html" - another image is suggested (https://www.weiterbildungsinstitut.de/files/wbi/bilder/standorte/dortmund/standort_dortmund.jpg). WHY?
I more like the look of an index URL without "index.html" ...
Do you habe any tips or suggestions?
Thanks and best wishes ... Tanja
Hi,
very nice extension. But Google+ displays the temporary images from contao. Every time I empty the cache, the images on the wall are disappearing.
Is it possible to change the og:image source to the original in the file store and not to the cached one in assets/images?
Rolf
Contao 4.8.4
codefog/contao-social_images 3.5.5
There is only the default image generated, choosen in site structure. If you don't choose one, there's no og:image generated.
Other images are not collected and generated as og:image in
the extension is activated in page layout.
this is both in a regular page an in the news page
when updated 2.1.0 to 3.0.0 -> missing news (contao 3.2)
(newsarchive)
If the path to the social image is
files/content/FALTER_Scheckübergabe 2018 (c) Karin Wasner.jpeg
for example, the resulting og:image
URL will be
https://example.org/files/content/FALTER_Scheck%25C3%25BCbergabe%25202018%2520%2528c%2529%2520Karin%2520Wasner.jpeg
i.e. the URL is double encoded. The correct URL would be
https://example.org/files/content/FALTER_Scheck%C3%BCbergabe%202018%20%28c%29%20Karin%20Wasner.jpeg
Tested in Contao 4.4.13 with Social Images 3.5.2.
When a content is shared on Facebook for the first time, the share dialogue won't show the og:image
right away. There are two ways to make Facebook show the share image even when the URL is shared for the first time: https://stackoverflow.com/a/30361572/374996
Within Contao it probably makes sense to take the second approach, i.e. generating og:image:width
and og:image:height
.
Note: I realize your extension allows for more than one og:image
to be present for legacy reasons. May be this feature should be dropped? I don't think there is any reason anymore to have more than one og:image
defined.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.