Coder Social home page Coder Social logo

contao-pageimage's People

Contributors

aschempp avatar bekanntmacher avatar fritzmg avatar lionel-m avatar mdevster avatar michelbalzer avatar qzminski avatar richardhj avatar toflar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

contao-pageimage's Issues

SVGs auswählen

Hi,
kann man es irgendwie möglich machen auch SVGs als pageimage auszuwählen? Mit einer einfachen Anpassung per dcaconfig á la:

$GLOBALS['TL_DCA']['tl_page']['fields']['pageImage'] = array
(
'label' => &$GLOBALS['TL_LANG']['tl_page']['pageImage'],
'inputType' => 'fileTree',
'exclude' => true,
'eval' => array('fieldType'=>'checkbox', 'orderField'=>'pageImageOrder', 'multiple'=>true, 'files'=>true, 'filesOnly'=>true, 'extensions'=>'jpg,jpeg,gif,png,svg', 'isGallery'=>true),
'sql' => "blob NULL",
);

kann ich zwar eine svg auswählen, sie kommt aber nicht im FE an.

Page image Error - mit neue Contao 4.11

[2021-02-23T12:51:49.316887+01:00] request.INFO: Matched route "tl_page.2.root". {"route":"tl_page.2.root","route_parameters":{"_token_check":true,"_controller":"Contao\\FrontendIndex::renderPage","_scope":"frontend","_locale":"de","_format":"html","parameters":"","pageModel":{"Contao\\PageModel":[]},"_route":"tl_page.2.root","_route_object":{"Symfony\\Component\\Routing\\Route":[]}},"request_uri":"http://mywebsite.com/","method":"GET"} [] [2021-02-23T12:51:49.344184+01:00] security.INFO: Populated the TokenStorage with an anonymous Token. [] [] [2021-02-23T12:51:49.409114+01:00] request.CRITICAL: Uncaught PHP Exception LogicException: ""contao.fragment._contao.frontend_module.pageimage" has no container set, did you forget to define it as a service subscriber?" at /www/htdocs/mywebsitepath/vendor/symfony/framework-bundle/Controller/ControllerResolver.php line 39 {"exception":"[object] (LogicException(code: 0): \"contao.fragment._contao.frontend_module.pageimage\" has no container set, did you forget to define it as a service subscriber? at /www/htdocs/mywebsitepath/vendor/symfony/framework-bundle/Controller/ControllerResolver.php:39)"} []

-webkit-min-device-pixel-ratio wird immer ausgegeben

bei Verwendung des mod_pageimage_background.html5 wird der Wert "-webkit-min-device-pixel-ratio" mit ausgegeben ("../contao-pageimage/src/Controller/PageimageController.php" zeile 132).

Auch wenn ich bei den Bildgrößen (Themes > Bildgrößen) bei den Media-Querys keine Pixeldichte angebe, wird "-webkit-min-device-pixel-ratio" IMMER ausgegeben ...(?) ähnlich wie hier:

@media screen and (max-width: 2600px) and (-webkit-min-device-pixel-ratio: 2560w), screen and (max-width: 2600px) and (min-resolution: 2560wdppx) { html { background-image: url("assets/images/../****.jpg"); } }

Diese Angabe macht in meinem Szenario die kompletten @media Anweisung unbrauchbar und haben somit keine Auswirkungen mehr. Auch wird diese explizit als non-standard bei https://developer.mozilla.org/en-US/docs/Web/CSS/@media/-webkit-device-pixel-ratio deklariert

Wieso ist diese zusätzliche Angabe enthalten?

Ich habe die Ausgabe über eine eigene Schleife gelöst (ähnlich @DanEi75) wo die "-webkit-min-device-pixel-ratio" nicht mit ausgegeben wird und es funktioniert einwandfrei.

Originally posted by @albirs in #40 (comment)

Would be nice to link to an external url

It would be nice, to have an Field for external URL's. With this it would be possible to link to a News ore something else. At the Moment there is only an internal Page possible.

regards

Datenbank-Änderungen können nicht ausgeführt werden

Nach einem Update auf 4.13 und PHP 8.1 können die Datenbank-Änderungen nicht ausgeführt werden.

Bei Klick auf "Ausführen" erscheint immer wieder der gleiche Screen:

Datenbank-Migrationen
Runonce file: system/modules/pageimage/config/runonce.php

screenshot

Example template with image loop, for custom slider etc.

The file picker in the backend supports multiple files (#25). I'm wondering how to access all images in a loop, to create a custom slider. Inside the templates/ directory are to example files, I think it would be great to have a third with an loop over all selected images as reference for custom implementations.

I'm using Contao 4.5.4 with PageImage 3.3.1.

fallback for alt-attribute

In page structure you can enter an alt-text for the page image. We maintain the alt-text in the file system, but the extension don't fall back to the information in file system. When I don't enter an alt-text in page structure, no alt-text will be served.

Could you make a fallback using the alt-text from file system if the field for alt-text in page structure is empty?

img title wird nicht ausgegeben

Der Bildttitel aus der Dateiverwaltung fehlt im Template. Hier scheint es nur linkTitle zu geben. Wie bekomme ich den title in:

<?php $this->insert('picture_default', $image['picture']); ?>

ausgegeben?

Vererbung deaktivieren

Es wäre überaus praktisch wenn die Vererbung pro Unterseite deaktiviert werden könnte.

Undefined array key "hasLink"

Fehler : Undefined array key "hasLink"
im Debug-Modus

PHP 8.1.2
Contao: 4.12.7
contao-pageimage: 4.1.3

Hier der Stacktrace

ErrorException:
Warning: Undefined array key "hasLink"

  at vendor/terminal42/contao-pageimage/contao/templates/mod_pageimage.html5:6
  at include('/mnt/web023/d3/57/5890957/htdocs/bws-contao4/vendor/terminal42/contao-pageimage/contao/templates/mod_pageimage.html5')
     (vendor/contao/core-bundle/src/Resources/contao/library/Contao/TemplateInheritance.php:111)
  at Contao\Template->inherit()
     (vendor/contao/core-bundle/src/Resources/contao/library/Contao/Template.php:300)
  at Contao\Template->parse()
     (vendor/contao/core-bundle/src/Resources/contao/classes/FrontendTemplate.php:45)
  at Contao\FrontendTemplate->parse()
     (vendor/contao/core-bundle/src/Resources/contao/classes/FragmentTemplate.php:36)
  at Contao\FragmentTemplate->compile()
     (vendor/contao/core-bundle/src/Resources/contao/library/Contao/Template.php:327)
  at Contao\Template->getResponse()
     (vendor/contao/core-bundle/src/Resources/contao/classes/FrontendTemplate.php:87)
  at Contao\FrontendTemplate->getResponse()
     (vendor/contao/core-bundle/src/Resources/contao/classes/FragmentTemplate.php:25)
  at Contao\FragmentTemplate->getResponse()
     (vendor/terminal42/contao-pageimage/src/Controller/PageimageController.php:59)
  at Terminal42\PageimageBundle\Controller\PageimageController->getResponse()
     (vendor/contao/core-bundle/src/Controller/FrontendModule/AbstractFrontendModuleController.php:40)
  at Contao\CoreBundle\Controller\FrontendModule\AbstractFrontendModuleController->__invoke()
     (vendor/symfony/http-kernel/HttpKernel.php:152)
  at Symfony\Component\HttpKernel\HttpKernel->handleRaw()
     (vendor/symfony/http-kernel/HttpKernel.php:74)
  at Symfony\Component\HttpKernel\HttpKernel->handle()
     (vendor/symfony/http-kernel/HttpCache/SubRequestHandler.php:86)
  at Symfony\Component\HttpKernel\HttpCache\SubRequestHandler::handle()
     (vendor/symfony/http-kernel/Fragment/InlineFragmentRenderer.php:80)
  at Symfony\Component\HttpKernel\Fragment\InlineFragmentRenderer->render()
     (vendor/symfony/http-kernel/Fragment/FragmentHandler.php:85)
  at Symfony\Component\HttpKernel\Fragment\FragmentHandler->render()
     (vendor/contao/core-bundle/src/Fragment/FragmentHandler.php:84)
  at Contao\CoreBundle\Fragment\FragmentHandler->render()
     (vendor/contao/core-bundle/src/Resources/contao/modules/ModuleProxy.php:61)
  at Contao\ModuleProxy->generate()
     (vendor/contao/core-bundle/src/Resources/contao/library/Contao/Controller.php:421)
  at Contao\Controller::getFrontendModule()
     (vendor/contao/core-bundle/src/Resources/contao/pages/PageRegular.php:200)
  at Contao\PageRegular->prepare()
     (vendor/contao/core-bundle/src/Resources/contao/pages/PageRegular.php:65)
  at Contao\PageRegular->getResponse()
     (vendor/contao/core-bundle/src/Resources/contao/controllers/FrontendIndex.php:339)
  at Contao\FrontendIndex->renderPage()
     (vendor/symfony/http-kernel/HttpKernel.php:152)
  at Symfony\Component\HttpKernel\HttpKernel->handleRaw()
     (vendor/symfony/http-kernel/HttpKernel.php:74)
  at Symfony\Component\HttpKernel\HttpKernel->handle()
     (vendor/symfony/http-kernel/Kernel.php:202)
  at Symfony\Component\HttpKernel\Kernel->handle()
     (web/preview.php:33)                

No background images in Contao 4.4.14

Hi, I tried to put in background images as a module to my page layout. Unfortunately it didn't work. Normal page images are displayed correctly. Could it be a problem with Contao 4.4.14 or a general bug?

Background: if ($this->useCss)

useCss seems to be a flag in the template mod_background_image.html5.
If true, a simple CSS-style is used, otherwise a javascript-solution for positioning and sizing the image.

How is this flag set? I cannot find it in the module configuration.

Unterstützung von mehreren Bildern

Es wäre gut, wenn die Erweiterung mehrere Bilder unterstützen würde. Dadurch könnte bei Bedarf z.B. eine Slideshow einfach realisiert werden.

In der 3.x Version scheinen ja schon Vorkehrungen dafür gemacht worden zu sein:

public static function getMultiple(...

Ist hier vielleicht schon zeitnah mit einer Umsetzung zu rechnen?

Inheriting page image setting

To me it seems as though pageimage 3 in Contao 3.2 does not inherit the page image from any parent page except the root page if no image is set on a page. The page "Contact" in this example has the red image, although it should be the green one:

  • Root page (image red set in tl_page)
    • About company (image green set in tl_page)
      • Contact (no image set in tl_page)

Improve HEAD CSS

Hallo Andreas, im Template mod_background_image https://github.com/terminal42/contao-pageimage/blob/master/templates/mod_background_image.html5#L3-L9 hast du dieses CSS.

html {
  background: url("<?php echo specialchars($this->src); ?>") no-repeat center center fixed;
  -webkit-background-size: cover;
  -moz-background-size: cover;
  -o-background-size: cover;
  background-size: cover;
}

Damit kann man aber kein background-color und andere background-Eigenschaften für HTML mehr aufsetzen. Könntest du dies wie folgt abändern? Die Präfixe sind IMHO mittlerweile auch überflüssig.

html {
  background-image: url("<?= specialchars($this->src) ?>");
  background-repeat: no-repeat;
  background-position: center;
  background-attachment: fixed;
  background-size: cover;
}

Danke.

Bildgrössen bei Background-Darstellung

Hallo

So wie es scheint, werden definitierte Bildgrössen nicht berücksichtigt, wenn die Darstellung als Background-Image gewählt wird. Bei der Einbindung als normales Bild hingegen schon. Ist das nicht möglich oder hat man es vergessen (kein Vorwurf :-)), dies dort auch zu berücksichtigen?

Thx

findOne vs getOne in replaceTags

In the PageImage.php at line 42 (https://github.com/terminal42/contao-pageimage/blob/develop/PageImage.php#L42) there is a static call to the method "findOne". However, the Class PageImage does not have a function called "findOne", it does have a function called "getOne" though.

I am guessing this is a small error? It seems to break the insert tags: https://community.contao.org/de/showthread.php?53896-pageimage-Bild-im-Meta-Tag&p=347639&viewfull=1#post347639 (haven't tested myself).

Fehler seit Contao 3.2

In Contao 3.2 funktioniert pageimage nicht mehr. Liegt offensichtlich am Datenbank-Feld. Ändere ich den Typ in binary, geht's.

CREATE TABLE `tl_page` (
  `pageImage` binary(16) NULL,
  `pageImageJumpTo` varchar(255) NOT NULL default '',
  `pageImageAlt` varchar(255) NOT NULL default '',
  `pageImageTitle` varchar(255) NOT NULL default '',
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

Allerdings funktioniert die Vererbung auch nicht mehr.
Ich hatte aber leider noch keine Zeit zur Recherche.

Insert tag not working

The insert tag {{pageimage::*}} is not working. The problem is in these lines of code of PageImage.php:

if (null === $arrImage || !isset($arrImages[$strKey])) {
    return '';
}

return $arrImages[$intIndex][$strKey];

$arrImages is not a valid variable in the function's context. Even if you use static::$arrImages instead, there is no variable $intIndex in the function's context. The lines should instead say this:

if (null === $arrImage || !isset($arrImage[$strKey])) {
    return '';
}

return $arrImage[$strKey];

However, then there is another problem. $strKey will default to 'src' when using the insert tag {{pageimage::*}}. But there is no array key named 'src' in $arrImage. The contents in $arrImage come from the \FilesModel. The path to the image is actually in the array key 'path', not 'src'. So line #34 should probably be changed to

$arrTag[0] = 'pageimage_path';

or later on pageimage_src should be transformed to pageimage_path for example.

Nach Update auf Version 4.1.0 keine Bilder mehr im Frontend

Nach dem Update von Version 4.0.1 auf 4.1.0 sind bei mir alle Bilder im Frontend verschwunden.

Erst nachdem die Option: "Generiert alle Bilder der aktuellen Seite." aktiviert wird, erscheinen die Bilder wieder.
Ist das so beabsichtigt?

screen-20210623_fDo5udvX

Mehrfachauswahl im File-Picker gewollt?

Es führt bei unerfahrenen Redakteuren schnell zu Fehlern, dass hier mehrere Bilder ausgewählt werden können... Sollte hier nicht besser die Einfach-Auswahl aktiviert werden?

"Filemount"-Ausschnitt im Dateiwähler nicht veränderbar

Hallo nochmals Andreas,

wo ich das Modul für einen Kunden gerade noch fertig eingerichtet habe, fällt mir auf, dass es anscheinend ein Problem mit dem Dateiwähler gibt:

Im Dateiwähler kann man ja normalerweise (genauso wie in der Dateiverwaltung) den sichtbaren Ausschnitt ("Filemount") des Ordner-Baumes verändern; indem man auf einen Ordnernamen klickt, bzw. über die "Breadcrumbs" im gelben Feld oben diesen dann auch wieder zurück-erweitert...

Dabei fiel mir jetzt folgendes Phänomen/Problem auf:

Zunächst hatte ich (egal ob als Admin oder "Redakteur") keine Möglichkeit den (zu diesem Zeitpunkt) eingeloggten Ausschnitt im Pageimage-Dateiwähler wieder auf die Mutterknoten zu erweiteren. Im Dateiwähler eines Content-Elements aus einem Artikel sah ich, dass dort der selbe Ausschnitt aktiviert war. Dort konnte ich allerdings die Übersicht wieder komplett (bis in den Datei-Root) öffnen. Beim Zurückkehren in einen Pageimage-Dateiwähler war die Übersicht dann auch wieder komplett geöffnet. Irgendwie scheinen die beiden Module da also gekoppelt zu sein. Jedoch kann ich im Pageimage-Dateiwähler den sichtbaren Ausschnitt nach wie vor nicht verändern; bei Klick auf einen Ordnernamen passiert also nichts...

Ne Idee was das sein könnte? Kann ich meinem Kunden so natürlich nicht abliefern...

Viele Grüße, Hendriks

Mehrere Bilder (für Slider) mit picture-Template

Ich erzeuge mit dem folgenden Code das Markup für einen Slider wenn mehrere Bilder pro Seite ausgewählt werden. Wie kann ich das Contao-Picture-Template nutzen, um auch die responsive Größen mit im Markup zu haben? Hier ist es ja nur das einfache img-Tag.

<?php
global $objPage;
$collection = \FilesModel::findMultipleByUuids(deserialize($objPage->pageImageOrder)); // oder ->pageImage ohne Sortierung
?>
<?php if (count($collection) > 1): ?>
	<?php foreach($collection as $image)
		{
			echo '<div><img src="'.\Image::get($image->path, 300, 300, 1).'" alt=""></div>';
		}
	?>
<?php else: ?>
...
<?php endif; ?>

no support for webp?

It seems, that I cannot choose a webp-image in the pageimage-feature. How can I change that? I added webp to allowed file types in Contao settings.

replaceTags not working

I have Contao 3.2.14 installed.

I needed to rewrite the whole function replaceTags to make insert tags work.

public static function replaceTags($strTag) 
{ 
    $arrTag = trimsplit('::', $strTag); 
    $strKey; 
    switch($arrTag[0]) 
    { 
        case 'pageimage': 
        case 'pageimage_src': 
            $strKey = 'path'; 
            break; 
        case 'pageimage_alt': 
            $strKey = 'name'; 
            break; 
        case 'pageimage_title': 
            $strKey = 'name'; 
            break; 
        case 'pageimage_href': 
            $strKey = 'path'; 
            break; 
        default: 
            return false; 
    } 

    global $objPage; 
    $arrImage = static::getOne($objPage, (int) $arrTag[1]); 
    if (null === $arrImage || !isset($arrImage[$strKey])) { 
        return ''; 
    } 
    return $arrImage[$strKey]; 
} 

img class wird nicht ausgegeben

Wenn im Modul eine definierte Bildgröße ausgewählt wird, bei der eine CSS-Klassen für den img-Tag angegeben wurde, wird die Klasse nicht mit ausgegeben. Auch in den Template-Variablen ist die Klasse im img Array nicht vorhanden.

Individuelles Template nicht auswählbar

Themes › Hanika › Frontend-Module › Modul ID 33 bearbeiten - Contao Open Source CMS 2019-09-26 10-21-47

Es sind zwei Templates angelegt. mod_pageimage.html5 und mod_pageimage_home.htm5.
Jedoch ist es nicht möglich eines der Templates dem Modul zuzuweisen.
Contao 4.4.43

inheritance problem

It seems that pageimage has a slight problem inheriting parent images in Contao 3.3.4. It does not inherit the page image from any parent page. The page "B" in this example has no image, although it should get the one from "A":

  • Root page "A" (image set)
    • Child page "B" A (no image set)

Contao 5.1.x

Frage: Wird es für die Contao-Erweiterung "Pageimage" in Absehbarer Zeit einen Fix für Contao 5.1.x geben? Ich würde mich sehr darüber freuen.

Question: Will there be a fix for Contao 5.1.x for the Contao extension "Pageimage" in the above future? I would be very happy about it.

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.