• Content count

  • Joined

  • Last visited

Community Reputation

12 Good

About Sipho

  • Rank
    Jr. Member
  1. I gave Webpack another shot and I think i judged it too harshly. It actually works quite well, but it can take quite some time to set-up. For that reason I have created a boilerplate inspired by @heldercervantes's boilerplate: It's nothing fancy at the moment but I mainly made it for my own personal use. Thanks for the advice!
  2. This actually looks really good. That was another issue I was having; how to use processwire with git. It's pretty to similar to my current setup. Thanks! However I still want to use certain third party libraries just as you have jquery, modernizr and swiper without having to commit them to git. Committing to git works but I feels like this use case is exactly what package managers were invented for. I guess I will give webpack another shot, possibly using this laravel-mix wrapper you speak of. I guess that's why I was having trouble with it.
  3. What build tools do people use with processwire? Most build tools I have tried are either solely designed for single-page applications or don't support bundling npm packages. So far, I have been downloading third-party libraries and including them in my html. While this works, it isn't great when you want to update to a newer version. It also involves committing often hundreds of files not associated with the project when using git. For this reason, I would like to use a package manager to handle all of the updating for me and keeping my git directory nice and clean. After doing some research, it seems that npm is by far the most popular package manager. I find this strange considering it was designed for ndoe.js which is server side software but I can look past that. I have had some experience with webpack when I was learning how to use Vue.js for making single page applications. For that purpose, it worked pretty well but was also extremely confusing at first. Everywhere I go I see webpack being recommended as the number one build tool for front-end web applications. However, I have struggled to get it working with anything that isn't a single-page application. It seems to be designed to bundle everything into one or two js files. This doesn't really work in a setup like processwire. I would like to be able to import certain css and js into pages only as needed. For instance, if I only need a slideshow on one page, it doesn't make sense to include the code that does that on every page. That's not to say you won't have some global css and js. I additionally don't like how complicated it is to setup a webpack project and how webpack imports css inside js files. I decided to try Brunch which boasts being simpler than other build tools, including webpack. I must say, I am fairly impressed with it so far with it's ease of use. But I once again ran into the problem of it being designed for single-page applications. For example, I wanted to use lightbox on a few pages. After installing it from npm, I couldn't figure out a good way to include it's css. Brunch has a setting that let's you include styles from npm packages but it includes them globally. This means every single processwire page would have css for displaying lightboxes even when I don't need them. This would work but seems to go against the whole idea of being modular. I am also trying to use uikit as an npm package to no avail. I found somebody else with similar issues but was never answered: I noticed that ryan opted to just include a static version of uikit in AdminThemeUikit. Is this the recommended way of doing things? Have I got it all wrong? Doesn't this introduce pains whenever uikit needs updating? All I want is a better way to handle all my dependencies. I have been looking for the correct way to do this and it's beginning to drive me insane
  4. @Macrura Thanks! addBlankOption worked. I also managed to get the custom json working by hooking extendAttributes
  5. As a tangent question, is it possible to use InputfieldSelectize for non-page inputfields? So for example, using InputfieldSelect I can say: <?php $f->addOption("pie","Pie"); But using InputfieldSelectize I can't seem to figure out how to get the value in the itemDataArray. Is there a way to do this?
  6. Sorry I forgot to mention I am creating the inputfield from the API. Here is the code I am using to generate it: <?php $template = "family"; $label = "Family"; $f = $this->modules->get("InputfieldSelectize"); $f->name = $template; $f->label = $label; $f->required = true; $f->columnWidth = 33; $f->addOption(""); $f->set("itemDataArray", '$data = array("title" => $page->title);return $data;'); $f->set("renderOptionMarkup", "'<div class=\"item\"><span style=\"display:block;font-size:14px;font-weight:bold;\">' + escape(item.title) + '</span></div>'"); $f->set("renderItemMarkup", "'<div class=\"item\"><span style=\"display:block;font-size:14px;font-weight:bold;\">' + escape(item.title) + '</span></div>'"); foreach ($this->pages->find("template=".$template) as $p) { $f->addOption($p->id, $p->title); } $f->attr("value", ""); $form->add($f); I haven't included the whole form as I don't think it's relevant. I believe it would have to be InputfieldSelectizeMultiple for it to be set to multiple pages, so it's set to single pages. If I just change required to false, it behaves as expected. Maybe I am incorrectly using the API.
  7. @Macrura This is when using required InputfieldSelect: <select id="Inputfield_family" class="required" name="family" tabindex="5"> <option selected="selected" value=""></option> <option value="1084">Saturniidae</option> </select> This is when using non-required InputfieldSelect <select id="Inputfield_family" name="family" tabindex="5"> <option selected="selected" value=""></option> <option value="1084">Saturniidae</option> </select> This is when using required InputfieldSelectize: <select id="Inputfield_family" class="required selectized" name="family" tabindex="6" style="display: none;"> <option value="1084" selected="selected">Saturniidae</option> </select> This is when using non-required InputfieldSelectize <select id="Inputfield_family" name="family" tabindex="6" style="display: none;" class="selectized"> <option value="" selected="selected"></option> </select>
  8. @Macrura When I set an InputfieldSelectize to required, the first value is selected. Is there any way to prevent this? I wish to have it behave as it does when not set to required, the same way that InputfieldSelect does it. This might be really dumb, but I couldn't find it mentioned anywhere.
  9. I also got this on 3.0.62 and @Soma's fix worked. I can't exactly tell what caused it. In my case has_parent only worked for the direct parent. Anything higher would fail to find anything.
  10. @Macrura Feature request: Would it be possible to make the field refresh after page changes? In your examples, you put an editUrl that opens a modal. After making an edit in a modal, the field does not reflect the changes made. Another example is when creating new pages. I like to use PageFieldEditLinks by @thetuningspoon but after adding a page, it doesn't show up in the selectize options. Maybe this should be a feature of PageFieldEditLinks instead. It might need cooperation between you two. I believe you made the original AdminPageSelectEditLinks? I am not too sure I tried making my own hacky changes to PageFieldEditLinks but it didn't work too well. Otherwise, this is a really great module
  11. @Macrura No problem
  12. @Macrura After updating to the latest version of InputFieldSelectize(1.0.3) I now get the following error when I try to view a field using InputFieldSelectize I am running ProcessWire version 3.0.62
  13. I recently needed a module that automatically fills the title field of a page using fields on that page. I couldn't see one that already existed so I made my own. This is mostly based on ProcessSetupPageName by @kixe which I use along with this module. Keep in mind I am very new to ProcessWire so perhaps somebody else can contribute or make a better one Note: The title is automatically hidden when using this module You can enter any string. To add a fieldname, subfield or property, you surround the fieldname with {}. Dot syntax allowed. Example: Fish: {parent.title} {myfield}
  14. @bernhard To clarify, I basically want a PageTable but with the repeater matrix editing interface as @adrian said.
  15. @bernhard I don't quite understand how it matches what I described. Doesn't it only let you edit titles? To edit all the fields don't you still have to open a model like a PageTable? Maybe I am missing something. Could you explain how it could be used for what I described?