Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 10/30/2016 in all areas

  1. If you only want to sort in-memory, getting the pages as a plain array and using a custom sort function should do the trick: <?php $ps = $pages->find('yourselector')->getArray(); usort($ps, function($a, $b) { $na = $a->name; $nb = $b->name; if(!ctype_digit($na) && !ctype_digit($nb)) return strcmp($na, $nb); if(ctype_digit($na) && ctype_digit($nb)) return strcmp($na, $nb); return (ctype_digit($na)) ? 1 : -1; }); foreach($ps as $p) echo $p->name . PHP_EOL;
    4 points
  2. Try putting $item->internalPage->url in curly braces {$item->internalPage->url}
    2 points
  3. This module facilitates quick batch creation (titles only or CSV import for other fields), editing, sorting, deletion, and CSV export of all children under a given page. You can even provide an alternate parent page which allows for editing of an external page tree. http://modules.processwire.com/modules/batch-child-editor/ https://github.com/adrianbj/BatchChildEditor The interface can be added to the Children Tab, or in a new dedicated tab, or placed inline with other fields in the Content tab. Various modes allow you to: Lister - Embeds a customized Lister interface. Installation of ListerPro will allow inline ajax editing of displayed fields. Edit - This allows you to rename existing child pages and add new child pages. It is non-destructive and so could be used on child pages that have their own children or other content fields (not just title). It includes the ability to quickly sort and delete pages and change page templates. Also allows full editing of each page via a modal dialog by clicking on the page name link. This is my preferred default setup - see how it replaces the default Children/Subpages with an easily addable/editable/sortable/renamable/deletable list. Note that the edit links open each child page in a modal for quick editing of all fields. Add - adds newly entered page titles as child pages to the list of existing siblings. You could create a list of pages in Word or whatever and just paste them in here and viola! This screenshot shows the editor in its own tab (name is configurable) and shows some of the CSV creation options. Update and Replace modes look fairly similar but show existing page titles. Update - Updates the titles (and any other fields if you enter CSV data) for the existing pages and adds any additionally entered pages. Replace - Works similarly to Add, but replaces all the existing children. There are checks that prevent this method working if there are any child pages with their own children or other content fields that are not empty. This check can be disabled in the module config settings, but please be very careful with this. Export to CSV - Generates a CSV file containing the fields for all child pages. Fields to be exported can to fixed or customizable by the user. Also includes an API export method. Populating fields on new pages In Add, Update, and Replace modes you can enter CSV formatted rows to populate all text/numeric fields, making for an extremely quick way of creating new pages and populating their content fields. Predefined Field Pairings Like the field connections setup from Ryan's CSV Importer, but defined ahead of time so the dev controls what columns from the CSV pair with which PW fields. This is especially powerful in Update mode giving editors the ability to periodically import a CSV file to update only certain fields on a entire set of child pages. These pairings also allow for importing fieldtypes with subfields - verified to work for Profields Textareas and MapMarker fields, but I think should work for most others as well - let me know if you find any that don't work. Access permission This module requires a new permission: "batch-child-editor". This permission is created automatically on install and is added to the superuser role, but it is up to the developer to add the permission to other roles as required. Config Settings This module is HIGHLY configurable down to setting up custom descriptions and notes for your editors. You define one config globally for the site and then optionally you can define completely custom configurations for each page tree parent on your site. There are too many settings to bother showing here - you really just need to look through all the options and play around with them!
    1 point
  4. AdminOnSteroids Various admin tweaks to enhance ProcessWire admin. http://modules.processwire.com/modules/admin-on-steroids/ https://github.com/rolandtoth/AdminOnSteroids
    1 point
  5. Thanks a lot for your reply, now I understand how it works
    1 point
  6. @horst Thanks! It's working now. I'm new to PW so the permissions thing being the problem evaded me.
    1 point
  7. v095 adds a new tweak "Do not distribute modules into tabs" to ModuleTweaks. This results in a flattened module list, without duplications, which makes easier to find a module, especially when using the filter box. The "Add new module" block is in the bottom of the page. I'll probably add a jumplink to that location later for easier access. This feature is JavaScript powered and slows down the Modules page loading a bit but imo one or two extra seconds is worth for the benefits.
    1 point
  8. 1. In the "modules" db table 2. I assume you mean the settings for the modules? They are stored in the data field in the modules table 3. There are lots of strategies around this - really depends on how you like to update your modules and PW core.
    1 point
  9. It just parses "$item->internalPage" and echoes "->url" as a normal string, don't know if it's normal behavior or not. More about the variable parsing.
    1 point
  10. ...was a filecompiler issue - on several sites... deleting the compiler cache manually fixed it.
    1 point
  11. Have a read here: (scroll down a bit if you want to do it via Hooks)
    1 point
  12. @3fingers. No need to start a new thread about an existing issue. Better to add your issue to the existing threads, thanks.
    1 point
  13. Mac OS' file system HFS+ is by default case insensitive, which means that it doesn't matter if you mix upper- and lowercase paths and filenames. Telling your editor software to open /somefolder/somefile.php and /SomeFolder/SOMEFILE.php will bring up the same file. When you format a partition on Mac OS, you can choose to make the file system case sensitive instead, thus you can have somefile.php and SOMEFILE.php in the same folder. There's a PHP bug already showing the same issue outside of ProcessWire. You might vote that up to get it more attention. One other idea that came to mind: check if opcache is enabled in php.ini (I think MAMP still does this by default and its been known to cause strange problems). If yes, setting opcache.enabled to 0 and restarting MAMP might be worth a shot. (And don't trust what the the "cache" option in the GUI.)
    1 point
  14. thank you tpr, i was not familiar with that pages. now i am @adrian what do you think of hiding the tracy bar on mobile? at least a checkbox for that? in my case it would totally be enough to hide it based on screen width. if you don't think that's a good idea let me know and i'll add it via css on my own. i would prefer this to be built in though because it annoys me on almost any project.
    1 point
  15. Thanks a lot for your reply. This is the result: 1033 news->name title headline summary kategorie body images count: 2 Pageimage The error was probably because I had never before created a new field with the fieldtyp CroppableImage3. Because I already had some images fields, I have only changed the input field type of the existing fields and not created a new one. After I had created a test field with the fieldtyp CroppableImage3, the other fields now work as desired.
    1 point
  16. Module updated to v094. The ctrl+arrow navigation was added to paginated filterboxes (AdminDataTables), and moduleFilter filterbox has also got a simiar feature to navigate between tabs having matches. There were also many small updates to the filterboxes in general, now I think they have everything that such a feature can have There are also small anchored links to GitHub readme in the top Submodules section. I'm not entirely satisfied with this because even though the links are correct the images are loaded after the page jumps to the anchor and pushes the target section out of the screen. Anyway, it's a GitHub issue imo that I can't fix.
    1 point
  17. You'll probably have to create a pseudo name sort field and populate that pseudo name field with the desired sort values and sort by that field ....
    1 point
  18. I'm just a basic git user, so probably I just do not understand what you exactly mean? I has a nice Merge button... https://blog.sourcetreeapp.com/2012/08/21/merge-or-rebase/
    1 point
  19. Now that @adrian is on holiday, our only hope to get super cool stuff on a daily basis is in you... Thanks a million for all the effort, and keep it up, of course
    1 point
  20. v091 brings useful updates to the AdminDataTable filters like counter, invert search using "!" and some badass CSS styling, plus many improvements under the hood. The new submodule ListerTweaks is also included, which now respects the Lister bookmarks too. There was an important fix to ctrl+s feature of Hotkeys - if the Source dialog of a CKEditor is opened then ctrl+s won't save the underlying page but trigger the OK button in the dialog.
    1 point
  21. @ottogal An easy solution would be to change... [[audio file="LINK"]] ...to... [[audio file='LINK']] If you want Hanna Code Helper to insert single quotes around attributes I think you'll have to modify the module code. Change line 124 to: $attrs .= " $attrName='$attrValue'"; You can use SimpleXML in your Hanna Code to get the href from the link: $a = new SimpleXMLElement($file); $path = $a['href']->__toString();
    1 point
  22. @Zahari Majini It appears to be the same issue as reported here. For now, you can work around it by changing the settings for your repeater matrix to the following... Not the most satisfactory of results. Note, doesn't work well enough if you simply switch the Ajax option to off as the picker appears on all the fields as soon as you open the owning entry.
    1 point
  23. EDIT: @adrian SOLVED MY PROBLEM I'm having an issue. My processwire login. I click configure and this happens (at the url http://freezermoosh.co.uk/opensesame/module/edit?name=MaintenanceMode) Error: Uncaught Error: Access to undeclared static property: MaintenanceMode::$fM in /var/sites/f/freezermoosh.co.uk/public_html/site/modules/Notanotherdotcom-Maintenance-Mode-a42854b/MaintenanceMode.module:94 Stack trace: #0 [internal function]: MaintenanceMode::getModuleConfigInputfields(Array) #1 /var/sites/f/freezermoosh.co.uk/public_html/wire/core/Modules.php(3509): call_user_func(Array, Array) #2 [internal function]: ProcessWire\Modules->___getModuleConfigInputfields('MaintenanceMode') #3 /var/sites/f/freezermoosh.co.uk/public_html/wire/core/Wire.php(348): call_user_func_array(Array, Array) #4 /var/sites/f/freezermoosh.co.uk/public_html/wire/core/WireHooks.php(548): ProcessWire\Wire->_callMethod('___getModuleCon...', Array) #5 /var/sites/f/freezermoosh.co.uk/public_html/wire/core/Wire.php(373): ProcessWire\WireHooks->runHooks(Object(ProcessWire\Modules), 'getModuleConfig...', Array) #6 /var/sites/f/freezermoosh.co.uk/public_html/wire/modules/Process/ProcessModule/ProcessModule.mo (line 94 of /var/sites/f/freezermoosh.co.uk/public_html/site/modules/Notanotherdotcom-Maintenance-Mode-a42854b/MaintenanceMode.module) This error message was shown because: you are logged in as a Superuser. Error has been logged.
    1 point
  24. Those who don't have Lister Pro (like myself) will probably dig this feature - option to specify extra columns for the lister (Find & Users). As you probably know when you close the browser tab with a Lister then your custom columns are gone. This tweak let you specify the defaults. I've needed such feature for a long time and today when I tried to use the filter I realized how useful this would be. There are a few things to iron out and a module config UI is need to be figured out but I already love it Ps. adrian will surely like the screenshot
    1 point
  25. @Michael van Laar, you could use a hook to set the value of the Page field after a new article page is added. In /site/ready.php: $this->pages->addHookAfter('added', function($event) { $page = $event->arguments('page'); if($page->template->name != 'article') return; // your logic here to find the right author ID $page->setAndSave('author', $my_author_id); });
    1 point
  26. Hello @mstroeck and welcome to the forums! What sort of server setup are you using? Any chance that you have custom rewrite rules? Any more detail that can shed more light on the issue?
    1 point
  27. @adrian's gonna love it
    1 point
  28. Hi. First of all, thanks for this great module! I do have one question: Is there a reason why this module is not "singular"? To be clearer: adding ""singular": true" to the jsonfile. I am having the automatic send option enabled, and use some custom api code to add new users in frontend-scope and backend. According to the json info file the module gets autoloaded on "template=admin". So in Frontend I have to use $this->modules->get("EmailNewUserPortal"); Because my custom code gets executed in frontend and admin, I would have to check where I am, because if I do $this->modules->get("EmailNewUserPortal"); in backend there are two instances of the module running. This results in sending the NewUser Mail twice. After adding the singular Option to your module, this issue has gone. Perhaps there is another need to be not singular here wich I didn´t see? Just wanted to ask... Thanks...
    1 point
  29. Just uploaded v089 with a few improvements to the filter boxes. Now it supports ajax tables and "input" texts are also considered on filtering. As a result you can search for page title in Batch Child Editor module for example, which wasn't possible earlier: Table columns don't jump on filtering anymore. Furthermore the "body" was set to "overflow: scroll" so it doesn't jump when its height changes (which often happens filtering a long table).
    1 point
  30. @pwired and all forum members I decided to put together my own bash script because I did not find what I was after. I am not a bash pro nor a linux/unix guru, so there might be better solutions using standard system tools, but I like the result so I thought I share it with you. You might also find it useful. Here is a short demo: https://youtu.be/V6eF4NBNDbc Please read the instructions (located in the script itself) if you happen try it out! Any constructive criticism is welcome. pwdiff.sh 0.0.8, (2016-10-25), initial public release:
    1 point
  31. And here we go again - general filter for AdminDataTables:
    1 point
  32. Preview of the new filterbox for modules - the dots in the tabs shows that items are found there:
    1 point
  33. @jmartsch there is a Lister Pro Action for this export as CSV i thought?
    1 point
  34. Thanks a lot, @adrian and @horst. You guys are awesome. As is this community.
    1 point
  35. update: i'm using laragon now and love it! see this post: !!! OUTDATED !!! i'm using vagrant on win10 for all my development too. i really like it once you have the hassle of setup done. i'm now using scotchbox - i don't use the repo gebeer linked to. here is my new one: https://gitlab.com/baumrock/vagrant-pw-lamp/tree/master sorry, no time for documentation right now, but the readme from the old repo should also have some useful informations (as already linked by gebeer): https://github.com/BernhardBaumrock/vagrant-pw-lamp on win8 i had to switch GUI mode to OFF otherwise it didn't work. on win10 it was the contrary ^^ i'm too busy right know to give more help. gebeer and i have been talking about vagrant and pw development quite for some time now but it all seems too experimental to really recommend our setups to someone else... but if you want to try and have some specific questions please let me know some nice things i like and why i am using it: have a linux sandbox setup projects with "real" hosts in seconds; my workflow is like this: create a folder on my host like "example" "git bash here" clone my repo https://gitlab.com/baumrock/vagrant-pw-lamp vagrant up then i have my machine ready and can access my linux server on example.dev mailcatcher will catch all emails, so i can also test all email stuff, even when i'm offline i can do "grabpw" and get a fresh install of PW to choose from master/dev/devns i can do "backup" at any time, that will backup files + db i can do "restore", so i can move projects from one device to another i can even do "push" or "pull" of the whole website from my live server to my vagrant box, but that's a bit experimental when i'm done with the project i do "vagrant destroy", it will backup everything and keep only 1 backup and destroy the machine. so i don't mess up my host system with lots of GB of VMs ps: sorry i just realized that my repo is private... i can't make it public atm but you can pm me if you are interested
    1 point
  36. I find things like laravel valet + php-version much more interesting for a simple dev environment compared to vagrant or docker. At least if you just need a PHP version and something mysql. For setups more involved with the infrastructure I'd also rather suggest trying Docker today, as it's Native-App Beta is doing great and the speed improvement and deployment options are just far superior. The only reason I'm currently still developing on a vm is that I'm working on different machines and don't want to hassle with updating the database back and forth. Put the vm on an external drive and done
    1 point
  37. I'm using it for all my development work. Makes setting up dev environments so much quicker and easier. No more manual installation of LAMP stack in my Linux box or fighting with WAMPP/XAMPP settings. I have one vagrant box that hosts all of my PW projects. Then I have one that brings all I need for a Drupal project. My main box is a remnant from the days where I was mainly doing Joomla projects. But it still works quite nice: https://github.com/joomlatools/joomlatools-vagrant One of these days I want to put together a box solely for PW with wireshell etc. Just didn't have the time to pull it together. Bernhard put a nice box together with some scripts for automatic PW installation and DB backups: https://github.com/BernhardBaumrock/vagrant-pw-lamp
    1 point
  38. You can have a separate config-dev.php besides config.php, which will be loaded if present. Just overwrite the httpHosts array there and not upload it to your live server. Edit: Actually the config-dev.php will replace the config.php, so it needs to be a full copy with some changes. Edit2: And I misunderstood it again like last evening. My suggestion won't of course change your saved domain names in the database. The problem is, that you cannot simply make that work with changing the httpHosts array, as that's not how the multisite module does work. httpHosts is only a whitelist to check against, but the domain does get parsed from various request data. So accessing pw via multi-site.local will either result in an domain multi-site.local or the first domain of httpHosts, if multi-site.local isn't part of the whitelist. So you either need to change the domain names you set up, or you need to include this replacement in the multisite module itself.
    1 point
×
×
  • Create New...