Jump to content

Juergen

Members
  • Posts

    1,423
  • Joined

  • Last visited

  • Days Won

    18

Everything posted by Juergen

  1. Ok, I have created a new image field and now everything works fine. So it seems that there was a problem with my old image field.
  2. Strange behavior, I have to investigate further. What I also have discovered is that the duplicate action is no longer present in the dropdown.
  3. I use 7.0.27. I have croppable image installed too. My first thought was that there is an interference between the default image field and croppable image 3.
  4. The image is there and now I get the focus coordinates if I remove the brackets. This works: print_r($child->singleimage->focus); but this not: print_r($child->singleimage->focus());
  5. Great addition, but I have problems focusing images via $page->children call. Description: If I output the image on the same page the focus works, but if I call it from another page I cannot get the focused image. Focus is centered in this case. foreach ($page->children as $child) { $image = $child->myimagefield; print_r($image->focus()); } This will lead to following error message: Call to a member function focus() on null. Can someone confirm this behaviour? Best regards
  6. Yes, if you use my code a view posts above. It works as a textformatter and adds the class automatically on the frontend everytime you use the blockquote tag. You have only to click once on the blockquote button.
  7. You can also use the following code in your site/ready.php: <?php if($page->template->hasField('name-of-your-ckeditor-field')){ $string = $page->name-of-your-ckeditor-field; //create string replace for blockquote $string = str_replace('<blockquote>', '<blockquote class="blockquote">', $string); //here you can add further manipulations.... //.............. //finally set the value back with manipulations $page->name-of-your-ckeditor-field = $string; } Replace "name-of-your-ckeditor-field" with the name of your field. In this case you can use the default blockquote button from CKEditor. Best regards
  8. Hello thuijzer, I always get this error message after calling echo $page->field_name[1]->entries[0]->getFrom()->format('H:i'); in template: Cannot access private property ProcessWire\BusinessHoursDay::$entries Best regards
  9. Thank you. I didnt know this. Now it works
  10. Hello Adrian, I want to use the shortcut syntax $page->fieldname->formattedNumber on a file outside of the template folder (in my case a simple template which will be loaded via an Ajax call). But this doesnt work! In opposition $page->fieldname as standalone works. So the formatting object "formattedNumber" is not callable outside of the template folder. The file where I want to use it is located in /site/ajax/nameofthefile.php (outside of the template folder). I use the bootstrapping technique to get field values outside of PW templates folder. Is there a possiblility to load the module inside this template file so I can use formatted and unformatted numbers? Best regards
  11. SEO and image cropping is also what I find very useful. In addition to image manipulations it would be great to add a feature that makes the scaling of images to FIT/FILL bounding boxes possible. Take a look at http://a32.me/2012/06/scale-images-to-fit-fill-bounding-box-in-php-using-gd/ for a detailed example. This is useful if you have images with different proportions fitting in a box (fe. logos of different partners, product images). Best regards
  12. No, unfortunately not. The module cache is not responsible, also not the template cache. I have a lot of custom hooks inside my ready.php. Maybe one of them interferes with your code and prevents the adding of the js file. If no one other has to deal with this problem so it must be on my side. Its not a relevant issue for me at the moment. I guess I will find the reason - some day, some time
  13. I dont know if I miss something, but the module only works in backend in my case. I have checked the loading of the js files in the frontend, but they are not there, if I am logged in as superuser. Is there something else that I have to do?
  14. I am seeing this too.
  15. Yes this was the issue. I followed your instructions and now it works as expected.
  16. Would be great if the image field restriction also works with the croppable image field. At the moment it fetches all images which are of the croppable image fieldtype independent of the image field selection.
  17. Using namespace Processwire in both files solves the problem. A writing mistake leads to that this approch did not work on the first attempt.
  18. Or is there a possibility to use namespace in the _functions.php (inside templates folder) and no namespace in the file outside the template folder (emailvalidation.php). Something like "use \Processwire" at the beginning of emailvalidation.php?
  19. Yes, that was one part of the problem. Including the same namespace in the file outside the PW folder removes the previous error messages, but the function do not work. Maybe I should remove the namespace in the _functions.php?
  20. Hello @ all, I have a general function file which is located in site/templates/ directory (path: site/templates/_functions.php). This file includes several functions which will be used across the site. It will be loaded in site/templates/_init.php with the following command: require_once('./_functions.php'); This works. Now I want to use a function of this file outside the templates folder. This folder is located in site/ajax directory (path: site/ajax/emailvalidation.php). To use variables from PW outside the templates folder I bootstrap the index file like this: include("../../index.php"); //bootstraping index.php So this works, but unfortunately the _functions.php will not be fetched. So I have tried to include it via include but then I always the following error message. Cannot redeclare ProcessWire\debug() (previously declared in /home/.sites/24/site1275/web/site/templates/_functions.php:59) So it seems that _functions.php will be loaded. But if I remove this line than I get an error message that the function is unknown???? Call to undefined function _t(), did you mean _()? So how can I use a function of a file inside the templates folder outside the templates folder. In this case it is a function for translateable strings. Best regards
  21. A big thanks to Ryan! He has included this feature request in PW 3.0.85 Read more
  22. I mean on production sites. I always use local stuff on development. In the past I have loaded files from different CDNs (Google, Jsdelivr,...). So I could use parallel downloads instead of serial, which should make the site faster. My strategy was always to load a JS from CDN if possible. If not than fallback to the local version on the server. This needs to look manually if a specific or newer version is available on the CDN. So I am interested in how others deals with this issue and I have read a lot of interesting thoughts here.
  23. Hello @ all, I have included all my external JS files via npm which makes updating of every script very easy. A lot of these JS-libraries are also available on a CDN. My thought was to load the scripts from a CDN if they are present, otherwise load it from my local folder. There are some scripts such as steal.js (https://stealjs.com/docs/StealJS.loading-from-cdn.html) which can be used, but I want to know how others deal with this issue. The best would if the version of the local npm-folder (fe. jquery 2.1.0) would be checked and then the same version would be loaded from the CDN if present, so the local and the CDN version are always the same. Most of the solutions need a hardcoded CDN version that should be fetched. I dont know if this scenario is possible, but maybe someone come up with a good solution. Best regards
  24. Changing from UIKit 2 to 3 - in the previous version they use the data prefix, but now.... more than strange
  25. I agree
×
×
  • Create New...