Jump to content

gebeer

Members
  • Posts

    1,489
  • Joined

  • Last visited

  • Days Won

    43

Everything posted by gebeer

  1. Thanks for posting the solution to your problem! To test if a full page object was returned by $pages->get() you can use if($category->id) {...} This is usually enough. When PW doesn't find a page it returns an object NullPage. This NullPage object returns null for id. So the simple test above is sufficient. Since you get your category and subcategory names from the urlSegments, you could test earlier in your code if these exist. If there is no urlSegment(1), $categoryName = $sanitizer->pageName($input->urlSegment(1)); will return an empty string. So you could test for that. I can recommend to start early on using the fabulous debugger module TracyDebugger. It makes dev life easier and can save a lot of time. I use it on every project. Also it is always goo to have the API reference open in a separate tab or browser window ?
  2. Hello and welcome to the forum! Glad you figured it out. Would be nice if you could also share what the problem was, so that others can learn from it. Was it this line?
  3. Media Library uses pW image fields behind the scene. So in Setup->Fields you can search for the field which has the label 'MediaImages'. In the field settings, you can add 'svg' to the allowed file types. That should do the trick.
  4. I'm not talking about the field settings. I mean the inputfield itself. Where you have all the options 'Choose an Image from...'. There will be a new option 'Choose an image from any page' This one will give you a PagelistSelect. After selecting a page you will be presented with thumbnails of all images from that page and can pick one. Clear now? Edit: The screenshot in your post is not from my inputfield, right?
  5. Updated the field settings. Before you had to choose the image fields both for the page you defined and for the optional edit page. I unified these into one setting. Images will be pulled from these fields for all relevant pages (if one of the fields exists on a page)
  6. This is the way that InputfieldMarkup behaves inside an InputfieldWrapper. At least in my case. I amended it with some custom CSS. It's in the new master. ATM it only shows thumbnails for the page you define in the settings (and its children). What I mean, is a new option that allows you to pick images from any page on the site. So there would be an InputFieldPagelistSelect to select a page. Once selected, you get thumbnails for that page and can pick one. Just like in the pwimage plugin for CKEditor
  7. I also came from Joomla and was so happy to discover ProcessWire. It was a game changer for me. The good thing about PW is, that you can have all these things on demand as modules. So it is up to the developer to choose features they want to include on a site.
  8. New v1.1.3 is out. Following @adrian's request, in the field settings you can now choose multiple image fields to get images from. The tooltips on the thumbnails and the info below the preview image show the field name that this image belongs to.
  9. Just an idea: when you insert images into CKEditor with the pwimages plugin, you can choose an image from the page you are on but also from any other page of the site. Do you think this could be a useful feature for ImagePicker?
  10. @kongondo all is good! That ___getSelectorInfo() method was exactly what I needed. It is already live on github
  11. Big thanks for this one. I'll give it a shot. This I already covered. Got it from the Map Marker example module ? EDIT: New v1.1.2 went out just before I read this. Will update soon.
  12. I just released v1.1.2 which has all the same features but removes dependency from MySQL >= 5.7.8 and fixes some minor issues. The module can now be used on any MySQL setup. You can update to or install from scratch the latest master version. If you run into problems, please report here or open an issue on github. Thank you.
  13. Testing right now and it is working. One thing boggles me. In Pagefinder, when selecting Subfield, I cannot select filename as subfield, only pageid. I had this with another custom fieldtype and always wondered how to have the alias for data show up here.
  14. I had kicked data alltogether until I realized that a search for none empty returnes SQL error. Now I added it back in and will use it for the filename. Then everything should work, I guess...
  15. @kongondo is the data column mandatory? I get strange results for searches.
  16. Thank you for the info. That is exactly what I am going to do now. Up to the point where I started developing this module, I was not really familiar with how field values travel through a live cycle. But meanwhile I realized, that the return value of wakeupValue() is what gets passed to the inputfield. I am returning json here already. And now that I decided to kick the JSON data column altogether, the redundancy will be gone ?
  17. Problem is, that you cannot predict which names people use for languages. So you cannot rely on a specific standard here. If someone installs your module who has named the German language 'german' and not 'de_DE', the module author has no way to reliably map translation files to country names.
  18. Once you want to translate your module, go to Setup->Languages->yourlanguage, choose to translate your module files, do the translation in the interface and then download the resulting json. That should be it.
  19. As far as I understand it, you could bundle language translation json files with the module, let's say in a module folder 'translations'. They won't be installed automagically, though. But in the language edit interface, you can add these json files manually to the 'Site Translation files'. Or am I wrong here?
  20. Just wanted to follow up on this. In the current master (v1.1.1) I changed the logic loosely following adrian's approach. This is working fine now. Also it removed an issue that occured with my previous approach. I still need the virtual page, though, to instantiate the Pageimages object. But now my virtual page doesn't need a real images field anymore ?. It is working with a virtual Field now. Code is here.
  21. May I ask for the reason behind this? Ryan mentions some advantages of InnoDB over MyIsam in this blogpost. The good news for you: next version (v1.1.2) of the module will revert back to not using MySQL native JSON data type so it will be compatible MyIsam.
  22. Yes, I have a 'double storage' at the moment. Because I had not finally decided how to handle this. So atm there is redundant data. Main reason for adding that JSON column was so I can support SettingsFactory which only can store text values. Also, after switching to JSON storage, I left pageid and filename columns so that in the Pagefinder you can choose these as subfields. Do you know a better way to handle this? Anyways, I will be going to set data column as a text in the next version to avoid the MySQL >= 5.7.8 requirement and amend the query logic to query pageid and filename columns instead of doing the JSON_SEARCH() on the data column.
  23. Sorry, that was the only thing I figured could be wrong. Maybe someone else can jump in?
  24. Just noticed, that the $field->setImportData($fieldData) method is not documented at https://processwire.com/api/ref/field/
×
×
  • Create New...