Git Product home page Git Product logo

contao-social_images's People

Contributors

aschempp avatar fritzmg avatar qzminski avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

contao-social_images's Issues

Skip small images

// Skip small images
            if ($width < 200 || $height < 200)
            {
                continue;
            }

please, add config width, height (in backend)

for example
width = 100
height = 100

Contao 4.8 - not all possible og:image are generated

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

generating og:image not working

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>
  • activated in page layout » no og:image is generated
  • set default image in site structure » og:image with default social image is generated

og-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

Various content elements "disappear" when [social_images] is installed

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:

  • Headline (if used as part of ce_text headlines are okay)
  • HTML
  • Module

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:

pmueller-socialimages-kaputt

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 ;-)

Could twitter:image support be added?

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.

image URL is double encoded

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.

Extension creates correct og:image but facebook takes another image (only on index)

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

Plugin not visible in the Back-End

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?

Generate og:image:width and og:image:height

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.

Tried to use your extension with Contao 4

There is no field in the page layout settings to activate this extension.

bildschirmfoto 2017-05-10 um 21 57 37

I could enable it in the root page of the site structure and choose the image.

No output in the head-section of the front end.

Disable for individual pages

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.

Bug in "walk the trail" finding parent file by uuid

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))

CDN use

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?

support for terminal42/contao-pageimage

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

  1. news teaser image
  2. social page image
  3. pageimage
  4. content element images

Cached images

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

Small optimization in collectNewsImages

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.

ver. 3.0.0

when updated 2.1.0 to 3.0.0 -> missing news (contao 3.2)

(newsarchive)

Rework the extension

The extension should not override Image class to collect the images. It should rather use hooks:

  • getContentElement (ce)
  • parseArticles (news)
  • getAllEvents (events)

A few suggestions

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:

  • Why only make it possible to add a social image to the root page? Why not give the option of adding individual images to potentially every page? So, that if you selected an image for a subpage it would overwrite the og:image that was selected for the root page. Otherwise, if no social image has been selected for a subpage, it could just "inherit" the next social image further up in the page tree. Because, as nice as it is to have semi-individual og:images by activating the current feature in the page layouts, it often is not ideal because the images one uses to be displayed in the frontend aren't necessarily optimized for the dimensions that Facebook etc. requires to generate a preview. Currently it's alway a bit of a lottery if an image will still look good the way Facebook crops it (approx. 16:8,4) but if you give the option of adding individual social images to every subpage one could optimize the og:images ...
  • As far as I can tell, if you activate social images in a page layout, this extension checks for any embeded images in the sequence of how the different modules etc. are placed in the page layout. So first in the #header section and last in the #footer section. My problem: In the contao page layout, the right column (#right) always is placed before the main column. Even if I re-sort the frontend modules manually in a page layout -- as soon as I hit save, it sorts the right column modules above the main column:
    image
    However, in my case, I only use the right column for secondary information and therefore the images that are placed there aren't at all useful for og:image (and it just happens to be that I have a video in the header instead of an image).
    So, what I would like to suggest, would be to be able to determine or even to limit which layout sections should be used for social images -- and/or that one can determine in which order the extension should check for images in the layout (e.g. 1. #header, 2. #main, ✖ #right, ✖ #footer)
  • It's great that one can determine minimum width/height for images. But I think it would be even better if one could limit the image ratio as well. Basically it would be enough to have a checkbox with the option "Don't use images in the portrait format (height > width)". Because (at least for Facebook) you will usually want to have preview images in the landscape format.

maximum image size setting

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.