-
Posts
1,559 -
Joined
-
Last visited
-
Days Won
49
Everything posted by gebeer
-
Thing about country info is that it changes all the time. I find https://www.geonames.org/export/ws-overview.html a good resource for getting up-to-date country information. They have a JSON and an XML API. And the country info also available as CSV. You can query for all countries JSON with http://api.geonames.org/countryInfoJSON?formatted=true&username=gebeer&style=full (note my username. You'd have to create your own) I used this on a custom address field type that pulls in location data in real time while filling in an address https://github.com/gebeer/FieldtypeAddressGeonames Developed it for a course directory site where 1000+ users login from all over the world, to make sure the address info is as uniform as possible.
-
Inputfield::attr() won't set / general cart submission question
gebeer replied to cst989's topic in General Support
I think you need to return the modified argument $forms->addHook('FormBuilderProcessor::renderReady', function($e) { $form = $e->arguments(0); if($form->name != 'enquiry_form') return; $inputfield = $form->getChildByName('cart'); if($inputfield) { $cart = json_encode(wire('session')->get('cart')); $inputfield->attr('value', $cart); // you can try var_dump($inputfield->attr('value') here to see if the value was set } $e->arguments(0, $form); // this will return the modified form object to the hooked method }); -
Add New - The process returned no content - Unknown template
gebeer replied to Atlasfreeman's topic in General Support
Please provide some more information: - ProcessWire version - which site profile did you use on installation? - where did you try to add a new page in the page tree (Home or other page)? - which templates did you create apart from home and basic-page? - did you change the 'Family' settings of any of the templates? It is hard for us to guess all these things. This information will help us to help you.- 3 replies
-
- bug
- no content
-
(and 1 more)
Tagged with:
-
module FieldtypeImageFromPage pick an image from various sources
gebeer replied to gebeer's topic in Modules/Plugins
Thank you for testing! This is intended behaviour at the moment. But I am planning on incorporating an upload widget for the folder images, too. For uploading the page images the module uses the standard PW page edit feature. But since folder images are not linked to a page (at least not yet in the current version), I need to use a different solution here. I like https://uppy.io/ a lot and think I will implement it for managing images in the folder. I have merged all the features of this module into my ImagePicker module and will release a new version of that this week. -
This is basic PHP looping over an array. Since $blogimages is an array, you need to foreach over it to output every image in that array <?php $blogposts = $pages->find("template=blog-post"); foreach($blogposts as $blogpost){ $blogimages = $blogpost->images; foreach($blogimages as $image){ $imgthumb = $image->size(500, 300); echo "<img src='{$imgthumb->url}' alt='{$imgthumb->description}'>"; } echo "<h2><a href='{$blogpost->url}' >{$blogpost->title}</a></h2>"; echo "<p>{$blogpost->body}</p>"; echo "<br>"; } ?>
-
module FieldtypeImageFromPage pick an image from various sources
gebeer replied to gebeer's topic in Modules/Plugins
Glad you sorted it! This is on purpose. Otherwise the filename would overflow the background area, especially on not so wide previews. Doesn't look very nice as it is, I know. In the CSS I had hyphens: auto; before but that would break the filename to the next line too soon. So I decided to go for word-wrap: break-word; instead. -
module FieldtypeImageFromPage pick an image from various sources
gebeer replied to gebeer's topic in Modules/Plugins
Really sorry for the trouble. Maybe caching issue? The 2 modules were never supposed to be installed alongside each other and I didn't take that into account since it is planned to replace the 'old' ImagePicker module with this one. Added a warning to my post above so others won't fall into that pit. -
module FieldtypeImageFromPage pick an image from various sources
gebeer replied to gebeer's topic in Modules/Plugins
Sorry for that one. InputfieldImagePicker did not manipulate any other image fields. Was your field 'image' created from InputfieldImagePicker? If so, you need to remove it and the error should be gone -
module FieldtypeImageFromPage pick an image from various sources
gebeer replied to gebeer's topic in Modules/Plugins
regarding that error. Do you also have my module ImagePicker installed on that site? -
module FieldtypeImageFromPage pick an image from various sources
gebeer replied to gebeer's topic in Modules/Plugins
Thanks for reporting. I was thinking about that one, too. But then I decided to allow only one images field because it might confuse users. But then, if I allowed multiple fields, the user could upload to any images field and have them available for the picker. Think, finally I will add this. -
module FieldtypeImageFromPage pick an image from various sources
gebeer replied to gebeer's topic in Modules/Plugins
I have made good progress and have a working version now, that allows to pick an image from a predefined page (and optionally its children), a folder inside site/templates or the page that is being edited. The version is available in the branch 'allinone' on github. Install from URL https://github.com/gebeer/FieldtypeImageFromPage/archive/allinone.zip If you find the time, please do some testing and report your findings. Thank you. If you test, please uninstall previous versions and install this one. EDIT: Also uninstall InputfieldImagePicker if you happened to install it. My code does not cater fully for DB update, yet. And since I switched field value storage to json, atm this has to be installed from scratch. The module is still on that repository. But eventually I will publish it on the ImagePicker repository when I feel it is ready. One thing I still have to solve: ATM the field returns 2 different objects for rendering in templates, depending on where the image comes from. If it comes from a page, you will get a Pageimage object. If it comes from a folder inside site/templates, you will get a custom ImagePickerFile object. The latter one cannot be manipulated (resizing/cropping) like a Pageimage but has some similar properties. I still have to find a way how to turn images from a folder that is not connected to a page into Pagimage objects. This is quite tricky. I wonder if anyone who is reading this has evr tried to accomplish something similar. I really always want to provide a Pageimage object, no matter where the real image file lives so that it can be manipulated. Still scratching my head on that but hope I will find a solution. -
module installs new template and fields... example please!
gebeer replied to gunter's topic in Module/Plugin Development
You can have a look at my relatively new help videos module. Relevant code starts here. All the basics for creating fields and templates and pages are there. Should be easy to build upon. The uninstalling part goes in the ___uninstall() method. You basically need to keep track about what you installed (e.g. save this info to your module config data) and then remove that stuff. -
module FieldtypeImageFromPage pick an image from various sources
gebeer replied to gebeer's topic in Modules/Plugins
If you want to test it, you will have to use the branch jsonvalue from github. -
module FieldtypeImageFromPage pick an image from various sources
gebeer replied to gebeer's topic in Modules/Plugins
@adrian @eydun Made some progress and have a working version that is compatible with @Macrura's Settings Factory module. I switched to handling my field value as json. Haven't published the version yet as I'm planning on incorporating it into the yet to be developed new ImagePicker module. If you want to have a peek, I can publish it to a separate branch on github. Just let me know. First I was in doubt about using json for the field runtime value and for storage. But now I'm confident that this is the way I will go with the new ImagePicker module. So that one will be compatible with Settings Factory. The next days I will be working on combining this module and my ImagePicker (pick from folder) into one with the additional feature of letting the user choose an image from the page this field liveson. The resulting module will be released under the name ImagePicker. Hope I can get it out before Xmas. -
module FieldtypeImageFromPage pick an image from various sources
gebeer replied to gebeer's topic in Modules/Plugins
After giving it some more thought, I decided to merge the 2 modules and call the resulting ImagePicker. One thing I'm not sure yet how to best approach it: 1. should the options for choosing images from pages/folder/current page be exclusive, so that only 1 option can be set per field? Or 2. should it be possible to choose all 3 I guess, 2 makes more sense. The challenge will be to make the UI/UX of the inputfield lean, clear and easy to deal with. Instead of having the thumbnails underneath the preview image, I think with that many possible sources for images, it will be better to present them in a modal window. -
module FieldtypeImageFromPage pick an image from various sources
gebeer replied to gebeer's topic in Modules/Plugins
Makes sense. Only concern I have is that the field configuration options will grow to an extent which might overwhelm the user. This is why I had decided to make this a standalone fieldtype and leave the ImagePicker for picking from folders. I will contemplate some more and maybe combine the two. -
module FieldtypeImageFromPage pick an image from various sources
gebeer replied to gebeer's topic in Modules/Plugins
The use case you are describing does come up quite often. But I think this is going beyond the scope of this module. It advertises that you can pick images from predefined pages. And I don't really want to break out from that logic atm. But I'll put it on the wish list and see if I will add it as feature in a later version. -
module FieldtypeImageFromPage pick an image from various sources
gebeer replied to gebeer's topic in Modules/Plugins
I'm an idiot ? -
module FieldtypeImageFromPage pick an image from various sources
gebeer replied to gebeer's topic in Modules/Plugins
Thank you very much for taking your time and putting this visual together! I don't really want to have icons next to the preview image because in future I might support selection of multiple images. Larger icon near the thumbnails might be a good solution. Also please understand, that I do not want to make this a hybrid between native image fieldtype and my fieldtype. The fieldtype now advertises that you can pick an image from another page. If it would also allow to upload to the page it lives on, it might become confusing to the user. If you want to stay consistent with the UI, it has ? To me it looks odd having icons from different libraries on one page or even across pages. As long as there is an icon available for the framework I am using, I always prefer that one over an alien one. -
@szabesz had already mentioned it in this thread. But I think it is worth picking up again. I recently switched to https://vscodium.com/ and it is working absolutely great. It removes Microsofts branding and, more importantly usage telemetry. It is available for all platforms. Only drawback I could see is not having automated one-click updates. I'm all for open source and privacy. Microsoft's VS Code is based on the same codebase as VSCodium only MS adds their branding and collects lots of data because, well, that is just what they love to do. Being a Linux user for more than 15 years now, I really appreciate MS releasing this phantastic editor to the community. At least they are giving back a fraction of what they earned over the last decades with their half baked software which they make their beta testers pay a lot of money for. Ingenious concept, though...
- 246 replies
-
- 5
-
-
- visual studio code
- vsc
-
(and 2 more)
Tagged with:
-
module FieldtypeImageFromPage pick an image from various sources
gebeer replied to gebeer's topic in Modules/Plugins
Yes, I will maintain that one, too. But don't think I will add any more features in near future. I think it is quite stable and can go in the modules directory. I'd have to look at Settings Factory first. It's new to me. Will let you know. Originally I was storing as json {"pageid": 1234, "filename": "filename.png"}. But then I realised that searching for filenames via API would be harder to implement. So I refactored to use 2 separate fields in the DB. BUT the issue for storing multiple files will come up when I decide to support picking multiple files. Then JSON would be the way to go, I guess (but not sure). -
module FieldtypeImageFromPage pick an image from various sources
gebeer replied to gebeer's topic in Modules/Plugins
Thank you for taking your time! I am using UIkit icons to be consistent with the UIkit admin theme. But I could switch to fa icons for users that still have the default theme enabled. This is what it would look like with fa-upload -
module FieldtypeImageFromPage pick an image from various sources
gebeer replied to gebeer's topic in Modules/Plugins
-
module FieldtypeImageFromPage pick an image from various sources
gebeer replied to gebeer's topic in Modules/Plugins
Happy to receive suggestions with visuals ? Thanks for the idea. In my experience users hardly ever use image tags. They'd be a good way to categorize thumbnails, though. Will think about some more how to best implement this. Maybe automatically categorize if tags are there. Don't want to offer another option for this to avoid clutter in the field settings. You sure do love panels ? Thank you! I thought about this option. 2 things that kept me from using panels: First, they don't offer hooking into close events easily out of the box like pw-modal. Second, in my opinion for this use case it is cleaner to have an overlay over the whole page. It is more distraction-free. But thank you for taking the time and demonstrating! Interesting thought. I'd say for those cases also offer a normal image field and then in your template render only the one that has content. What you describe sounds like a hybrid between normal image field and my fieldtype. Actually I am thinking a lot about how to best present the input for my fieldtype. And I'd love to use the standard image input from PW. Basically make my inputfield extend InputfieldImage or InputfieldFile and modify according to the needs. Only had a quick look and it involves quite a lot of changes to the original classes. It is on my personal wishlist and I will fiddle with it and see if I can produce something that makes sense and is usable without being confusing. -
module FieldtypeImageFromPage pick an image from various sources
gebeer replied to gebeer's topic in Modules/Plugins
I saw that one. It would add an attribute to the wrapping inputfield which in my case is InputfieldWrapper which does not allow attributes. I'd need them on the InputfieldMarkup fields which inherit InputfieldWrapper. So no way. Anyways I found a workaround and attached my attribute in my markup.