Jump to content

gebeer

Members
  • Posts

    1,559
  • Joined

  • Last visited

  • Days Won

    49

Everything posted by gebeer

  1. It doesn't matter whether you create the folder before or after. The module will pick it up once it is there. If it is not there yet, you will get a warning. Once it is there, the warning normally goes away. If it is empty, you will get a warning to upload images. Can't reproduce your problem here on PW 3.0.145 PHP 7.2 But versions really shouldn't matter in that case. Did you install latest master? EDIT: just tested this on PW 3.0.149 and PHP 7.3.2 without problems. Where did you create the folder? It needs to be either in /site/assets/ or /site/templates/. Please try and comment out line 680 in FieldtypeImagereference.module and see if the warning message persists. I attached the error to both the field and globally so it is shown at the top of the page when you save the settings. Maybe this is the culprit in your case?
  2. I think, what you might be looking for is the 'Family' settings for templates. Here you can define, what child templates are allowed for a parent page with a specific template. So, for example, your parent page 'Blog' for your blog items might have the template 'blog' and the child pages (your blog entries) have the template 'blog-item'. In the template's 'Family' settings for template 'blog' you can define to only allow template 'blog-item' as child template. And in the template 'blog-item' you can define to only allow template 'blog' as parent template. Now when an editor adds a page to 'Blog' in the page tree, the new page will automatically get template 'blog-item' assigned.
  3. New version v2.1.2 is out on github. This version fixes a problem with images inside a folder that have names not conform with file naming conventions. When the module loads images from a folder, it converts them to Pageimage objects. When images are added to a Pageimages object file names get sanitized automatically by PW. In my case this resulted in different file names inside the Pageimage object and on disk. Consequently, thumbnails and previews for those images could not be loaded. I fixed this by automatically renaming all folder images to match the sanitized name versions inside a Pagimage object. This version also adds the ability to set values to this field via API. You can now do something like this to set a Pageimage object as new value to this fieldtype via API $p = $pages->get(1001); $image = $p->image; // returns a Pageimage object $p->of(false); $p->set('imagereference', $image); // sets the Pageimage object to the ImageReference field. This gets converted to a JSON string internally for storage $p->save();
  4. This does the job perfectly, indeed. Thanks a lot for that simple yet elegant solution. So all you need to add to site/api/events.php is public function findOne($selector, $options = array()) { return $this->pages->findOne($selector, $options); }
  5. I know this is an old thread. But just had a similar problem. You added the $events instantiation code to your _init.php which, most likely, is in site/templates/. But this code needs to go in site/init.php as stated in the tutorial. Then everything works as expected. The $page object inside template file site/templates/event.php is of Type Event and not Page. Sometimes it's the little details that matter. Posting this info mainly for my own reference. But maybe someone else might find it useful, too :)
  6. The findOne() method is defined in Pages (wire/core/Pages.php). Since your custom Events class extends PagesType, there is no findOne() method available out of the box. You can add one, though. I did this and it worked for me. Here is my site/api/events.php I basically just copied it over from wire/core/Pages.php Since the findOne() method makes use of $this->loader, we need to make sure that the loader is available in our custom class Events. So I added the loader var at the beginning of the class definition and in the construct() method, I instantiated it. Just did this right now to see if it works. In my case I now get a result for $events->findOne("date_publish_start<=now");
  7. Images from cloud storage providers could be added via URL with this module. I agree that it would be awesome to have all these options available in the core image field. Maybe file a feature request? EDIT: But that would add too many setting options to the core field that most of the users won't need. The image field is extendable via hooks and class inheritance. So other modules can add that functionality to the core field on demand.
  8. Hello, and welcome to the forum. This is not really a ProcessWire specific question. You might get advice or even find a solution on stackoverflow.com. And http://youmightnotneedjquery.com/ also might have some useful info.
  9. So true. I share your frustration. If it was for me, I wouldn't care (as you can see on my website, if you speak German). But what to do if clients are pushing? I'd like to see a reliable source for that, too. The thread @szabesz linked to, contains a link to Art. 6 GDPR. But like with all legal texts, as a layman it is hard to interpret them correctly. And even if you ask 3 lawyers you might get 3 different answers... In this thread @ceberlin links to an article on a well known German site for legal advice. I'm no subscriber to that site, so cannot access that information. The whole topic remains mysterious and frustrating. At least clients pay for cookie consent implementation. But I'd rather spend my time with more thrilling tasks...
  10. Hello all, I'm in the process of updating some websites to comply to the new GDPR opt-in regulations. Doing some resarch, I found this open source tool: https://klaro.kiprotect.com/ It looks quite promising and implementation seems quite easy. Have you used this tool? What is your experience so far? I saw that @Jens Martsch - dotnetic made some comments to the klaro GH issues. Did you implement this with PW?
  11. First off, big thanks to all authors for this module! There's a lot of changes going on regarding the legal situation of cookie consent management. The latest requirements for opt-in don't seem to be covered by this module. I tried latest dev version and also @joshua's fork. When clicking on Manage Cookies, I only get 2 options: I consent, I do not consent. There is no list of individual tracking cookies with checkbox to opt-in. I understand that implementing this can be a fairly complex task. Clients in Germany pushing quite hard to have compliant cookie management on their websites. This module does not seem to fulfill this need at the moment. Or am I missing something? Wordpress has paid plugins to accomplish this. But there are open source tools available, that can help to manage cookies compliant to GDPR and ePrivacy laws: https://klaro.kiprotect.com/ and https://www.oiljs.org/ both look promising. Do you have any plans for implementing a similar solution into this module in the future?
  12. I just installed v1.0.0 on PW 3.0.142 and seeing a problem with german umlauts in The Google preview and inherited title. The site has Language Support installed, just to have the backend translated to German. No additional languages. Field title is of type Page Title with textformatter HTML Entity Encoder (standard setting). umlauts.mp4 The title is saved in DB field_title as 'Über uns'. Removing the Entity Encoder Textformatter doesn't help. EDIT: page title is also rendered in the wrong format: Can anyone reproduce this issue? A fix would be greatly appreciated. EDIT: This solution from github issues fixed it for me.
  13. What do you mean by frontend companion? Should frontend vistors be able to choose widgets? Most of the times I don't really need a sophisticated widget system. So far working with page fields solved my needs. In my widget templates I have select fields for the widget position. You'd need a repeater field to define different positions on different pages. To pack the positions into your inputfield would sure be difficult while having good UX at the same time. The widget management module would definitely be very useful to get an overview. That should do it.
  14. I like that approach. Looks great and quite intuitive for the user. Reminds me of old Joomla days. There is a similar page-tree style thing that lets you choose where widgets (in Joomla speak: modules) should show. It would be great if the user could also choose on every page which widgets to show. Like a 2-way thing: in the widget you choose the pages. In the page you choose the widgets. That way you don't have to jump around the page tree to select widgets for pages. I'd definitely be interested in such a inputfield (combination).
  15. Thank you anyway. I have managed to fix this problem. See my post above.
  16. New minor version v2.1.1 with fix for error when using field inside RepeaterMatrix is on github. This was a strange error and, honestly, I still don't quite understand the root cause. When trying to add a new repeatermatrix item with this field inside, I got the error Field [fieldname] is not saveable because it is in a specific context Google brought me to this closed issue in the processwire-issues repo. The issue was related to FieldTypeFile. I just applied the fix for it to my fieldtype module and it worked. But I'd like to understand the underlying problem. So if anybody has any clue, please let me know. Thank you.
  17. The RestAPI part in particular would be very interesting. I know there are some modules/site profiles already. But since you seem to do that quite frequently, you sure have some nice tips/concepts to share.
  18. New version v2.1.0 is available on github. New features: Images in folders can now be uploaded and deleted from within the input. I am pretty excited about this feature. It gives you an image field that holds images independent of a page where images can be edited (upload/delete) and outputs PageImage objects in the frontend that can be cropped and resized. EDIT: forgot to mention that the module install 2 permissions imagereference-folder-upload and imagereference-folder-delte. Any non-superuser role needs those. Short preview edit-folder-images.mp4 Also now you can have the folder under either site/templates/ or site/assets/. The module will find it in both locations. If you have folders with same name in both locations, it will pick the one in site/templates/ The module is almost ready to go. One major thing, I need to fix, though, is getting it to work inside RepeaterMatrix fields. It is working fine inside normal repeaters. But eventually I will get there. Feel free to grab a copy and do some tests. Your feedback is much appreciated.
  19. @benbyf Thanks a lot for sharing! That makes sense. This should be possible with gridstack.js, as suggested by @szabesz If someone wanted to wrap this into a portable inputfield module, they could create an module which extend InputfieldTable class and add the logic there. ?
  20. This looks really useful. Might still be a bit cumbersome for editors with all those start end rows columns. But nice how you made changes reflect instantly in the preview. Mind to share the code? ? What do you need the row settings for, Couldn't you act on drag&drop of the rows themselves inside the table field?
  21. I am totally fine with paying money for that extra functionality. PW has so many great features already in the core. And I am happy to support Ryan with a ProFields subscription. Looking at how many great tools you get in that bundle, the price is more than fair.
  22. You can always add a custom class to the button and style it according to your needs.
  23. Today I discovered that it doesn't work inside RepeaterMatrix fields, yet. If you have a chance to test this, please report. Thank you.
  24. New version v2.0.2 is available from github. This version fixes the problems with getting thumbnails displayed via ajax. At least in my extensive testing everything was working. @LMD can you please give it a try now? While trying to fix the ajax issue, I was running in circles for hours on end. Tried various methods I found in the forum and @bernhard's hook. I always got it working as superuser but got very strange results when logged in as an editor user with page edit permissions. Until I discovered that the problems were due to my module not always loading for ajax requests. I added 'autoload' => 'template=admin' to my module info and suddenly all was working as expected. Still scratching my head why a module's init() method would get called when logged in as superuser but not when logged in as editor. Any ideas here? New in this version is the feature for uploading files to the predefined folder from within the inputfield. Here's a short preview of that feature. uploadtofolder.mp4 Now that this is working, I'm thinking about adding the ability to delete them from within the inputfield, too. As always, I shall be happy to receive your comments and issue reports ?
  25. Yep, will change it. Thanks for that hint. Will give it a try.
×
×
  • Create New...