Jump to content

tires

Members
  • Posts

    236
  • Joined

  • Last visited

Everything posted by tires

  1. Is there an easy way to echo the number of page edits / versions? Thanks!
  2. That's easy! Thanks a lot! $mypages= $pages->find("template=mytemplate, sort=mycomments.count, limit=10");
  3. Hi! I want to sort pages by the number of comments that where made to a page. $mypages= $pages->find("template=mytemplate, sort=mycomments, limit=10"); What is the best way?
  4. Thanks for your answer! I changed the .../site path just for the forum post. After restarting the browser (new session) the privace wire toolbar is shown up!
  5. I installed the module and the privacywire code (js and css) appears in my sourcecode (in the head) but the cookie toolbar insn't shown up. <style>.privacywire{position:fixed;bottom:-250%;left:0;right:0;box-shadow:0 -1px 3px rgba(0,0,0,.3);opacity:0;background:#fff;z-index:1;padding:1rem;transition:bottom .3s ease-in,opacity .3s ease}.show-banner .privacywire-banner,.show-message .privacywire-message,.show-options .privacywire-options{bottom:0;opacity:1}.privacywire-header{font-weight:700}.privacywire-ask-consent-blueprint,.privacywire button[hidden],[data-ask-consent-rendered="1"]{display:none}</style> <script>var PrivacyWireSettings={"version":1,"dnt":"0","customFunction":"","messageTimeout":1500,"consentByClass":"1","cookieGroups":{"necessary":"Necessary","functional":"Functional","statistics":"Statistik","marketing":"Marketing","external_media":"External Media"}};</script><script type='module' src='.../site/modules/PrivacyWire/js/PrivacyWire.js'></script><script nomodule type='text/javascript' src='/.../site/modules/PrivacyWire/js/ie_polyfill.js'></script><script nomodule type='text/javascript' src='.../site/modules/PrivacyWire/js/PrivacyWire_legacy.js'></script> Is there somethings missing or do i make a mistake? Thanks!
  6. Thanks a lot!!! It works ... after a while of thinking and testing! Here is the code of my ready.php (located in "site" directory). The module TextformatterProcessImages has to be installed. More Details about the module are here https://github.com/Toutouwai/TextformatterProcessImages/tree/7068b7864dd9e78c9cc4a76d6790957a41198dda <?php $wire->addHookAfter('TextformatterProcessImages::processImg', function(HookEvent $event) { // The Simple HTML DOM node for the <img> tag /** @var \simple_html_dom_node $img */ $img = $event->arguments(0); // The Pageimage in the <img> src, if any (will be null for external images) /** @var Pageimage $pageimage */ $pageimage = $event->arguments(1); // The Page object in case you need it /** @var Page $page */ $page = $event->arguments(2); // The Field object in case you need it /** @var Field $field */ $field = $event->arguments(3); // Only for images that have a src corresponding to a PW Pageimage if($pageimage) { // The original full size image $imgoriginal = $pageimage; // Small image with a width of 390 px $imgsmall = $pageimage->width(390); // Set the code for the lightbox link and image $img->outertext = "<a data-lightbox='image-1' title='zoom in' href='{$imgoriginal->url}'><img alt='{$pageimage->description}' src='{$imgsmall->url}' width='{$imgsmall->width}'></a>"; } }); ?> THANKS!!!
  7. Thanks a lot! I just don't understand, how i get to the original image. $img->outertext = "<a class='lightboxclass' href='MY FULLSIZE IMAGE'>MY SMALL IMAGE</a>"; Thanks!
  8. Any ideas? Or is this the wrong way to do it? Thanks!
  9. Ok, i gave it a try with not much success. Here is my textformatter so far. <?php namespace ProcessWire; /** * Wraps CKEditor image into a tag * eg <img src="/path/to/myimage_300.jpg"> * to <a href="/path/to/myimage.jpg" class="lightbox"><img src="/path/to/myimage_300.jpg"></a> */ class TextformatterLightboxImg extends Textformatter { public static function getModuleInfo() { return array( 'title' => 'Wraps img tag with a tag', 'version' => '1.0.0', 'summary' => "Wraps all img tags with a tag with class lightbox and links it to original image", ); } // public function formatValue(Page $page, Field $field, $value) { public function format(&$str) { $originalimg = $page->bild->url; $str = preg_replace("{<img\\s*(.*?)src=('.*?'|\".*?\"|[^\\s]+)(.*?)\\s*/?>}ims", '<a href="'.$originalimg.'" class="lightbox"><img $1src=$2 $3/></a>', $str); } } I get the error message "Notice: Undefined variable" for page, bild and id. Could you give me an advice? Thanks!
  10. Hi! I want to add an automatic lightbox function to my page. Therefore i want to wrap all my "img" tags (from all image and textarea/ckeditor fields) into an "a" tag that is linked to the original image. In the end this: <img src="/path/to/myimage_300.jpg"> should look like this: <a href="/path/to/myimage.jpg" class="lightboxclass"><img src="/path/to/myimage_300.jpg"></a> What is the best way to archive this? Thank!
  11. In the info for the last Drupal (8/9) core update was mentioned that there is an error in the CKEditor library. https://www.drupal.org/sa-core-2021-003 Does this error could have an effect to the CKE in Processwire? Is there a also a threat for Cross Site Scripting?
  12. Hi Folks! After a few years went by, i still ask myself if there is an easy way to set a default text/values for text/textarea fields? What do you think? Or am i the only one who needs something like that?
  13. Is there a way not to show the last level (last child page) in the navigation? In this case the parent of this last child page should have the "current_class" ... Thanks!
  14. Hi! Great module! But is it GDPR compliant? Is the module uses any js or cookies? Or is it just based on php? It is possible to xxx the last part of the ip adress (after checking the location)?
  15. Great Website!!! It needs to be listed in the processwire-showcase https://processwire.com/sites/
  16. Ok. So it is not intended to do this in the template settings?
  17. Hi! Is there a way to give a user the permission to move pages (in the page tree) only for one template? I just find a way to give the permissions to all templates. Thanks!
  18. Hi! I inserted {name} {modified} in the field "List of fields that is displayed in the page list at backend" (in german "Liste der Felder, die in der Seitenliste im Admin-Bereich angezeigt werden") at advanced tab in the template settings. The page are now displayed as: mypage 123 1598443140 What do i have to insert to get a formatted date like 9.2.2021? Thanks!
  19. Isn't it the proper way to use the repeater in this way? Is there a better way or module to create subpages from there parent (without leaving the parent page)?
  20. Thanks! This seems to work pretty well. But its a big module for such a little problem ...
  21. Hello! I got a bunch of repeater items on a page and want to offer a pagination so you may click through them (10 items per "page"). Is this possible? Or is there a better way to handle this? Thanks & greets!
  22. Do i have to throw the autosize.min.js manually into the "site" folder? Or into the sites/templates? Or the root of the site?
  23. Thanks! But it works with neither with the dot . nor with the arrow -> $file->download() The download of the first file start immediately ...
×
×
  • Create New...