Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 11/19/2017 in all areas

  1. glad you like it and thanks for the compliment yeah... it's not as easy to find in the beginning (and often i'm still searching a lot around the code). but most of the necessary informations are not too hard to find if you look at the code. Inputfields for example have a baseclass here: https://github.com/processwire/processwire/blob/master/wire/core/Inputfield.php Also see somas tutorial about forms (i updated my initial post with the link: https://processwire.com/talk/topic/2089-create-simple-forms-using-api/ ) I'll see what i can do...
    3 points
  2. Check out Tracy Debugger and you'll be glad you did. Then rather than using var_dump and echo you can use the bd() function in your files to get a lovely expandable dump output and the "double output" thing won't be an issue with Markup Regions.
    3 points
  3. It's available. Extremely alpha. If you discover a security related issue, please get in contact via the forum PM system. Feel free to post any other issues here. PW Repo Entry: ModuleReleaseNotes Github: ModuleReleaseNotes Thanks to @adrian and @Mike Rockett for their kind assistance.
    3 points
  4. http://www.karenthomasphotography.com/ modules: AIOM+, ProcessPageDelete, TextformatterVideoEmbed. js: isotope, imagesloaded, fitvids, scrollTo, and Jquery with custom AJAX magic.
    2 points
  5. I made a quick (shabby non-centred) demo of something I've been working on, worked out OBS studio just enough to record this. There's no sound but you get the idea. There's also no sidebar, I thought I'd get the theming sorted first then work out how to incorporate that, I was actually thinking a sidebar with 'favourite' links would be pretty cool, which I guess could be a (process?) module. I'll add that to the bucket list. There was a lot of tracing variables about but I'm pretty happy with the outcome. The different colours are controlled with a single line in my custom theme less file and you see the mouse professionally disappear of screen whilst I recompile. Give us a shout if you want to try it, learning how to use github properly is also on the bucket list
    2 points
  6. Thanks for this great tutorial! I am impressed by your PW admin UI manipulation skill all time. This tutorial could definitely get someone's hands dirty. Yes it is really quite hard imo because the related information is not easy to find. They do exist but always sit inside various post replies. It just looks like a missing piece to beginners. I long for a more in-depth version of this tutorial, or a complete guide precisely, that shows how to accurately use wiretab, pw-modal, panel, buttons etc. and layout all of them properly. I discovered a bit from reading through the core files and modules by trial and error but I believe I still have a long long way to go. I believe many people, like me a while ago, stuck in the layout phase and then give up their modules development.
    2 points
  7. Of course it depends on what you are iterating over, but in general foreach is very efficient. For instance, I've read that when working with a plain PHP array it is often more efficient to use foreach in place of dedicated PHP functions such as array_map and array_reduce (although for most situations that would be micro-optimisation and you would just use whichever is most convenient). I don't think that kind of sort would be possible in a selector, where you want to look through all repeater items and sort their containing pages by the most distant date. I think when you sort by a value contained within a multiple-page field (repeater, page reference, etc) the sort happens on whatever is the first page in that multiple-page field. So therefore you would need to apply some automatic sort to the repeater items so that the most distant date is always first, and that isn't so easy to do. If you have Profields Table then that has an option to automatically sort by a column. Or you might have to create a hidden field in the event template and populate it with a saveReady hook so it contains the most distant date, then sort by that field. To shorten your code you could do away with the nested foreach and do something like: if($article->template->name == 'events-detail') { if(count($article->events_detail_dates->find("events_detail_dates_start_date >= $today"))) include './inc/events-item.inc'; } //... BTW, where you are not mixing HTML and PHP you don't need PHP open/close tags on every line - you can just put the whole block of PHP code between a single pair of open/close tags. It doesn't do any harm the way you are doing it, but perhaps a little harder to read.
    2 points
  8. Another approach is to not allow users to create pages at all, but rather automatically create a single unpublished page for each user in a hook at the time the user is created. Then each user can populate and publish their page if they wish.
    2 points
  9. Hi @teppo. Yes you has a lot of experience and your point of view seems to me to be right. When it comes to slimming processwire it would generally be useful to compress all the images that are in the profiles. I used a compressor from here: https://compressor.io/compress And I compressed the images in the Regular profile that you can download from here: https://github.com/rafaoski/site-compress Comparing it with the uncompressed profile from here: https://github.com/ryancramerdesign/regular I reduced regular profile by 1.5MB, It would be nice to have some compression when adding profiles to the core.
    2 points
  10. Part 1 of a 2 part Module & Service Reveal. I'm currently working on a new module: ModuleReleaseNotes that was inspired by the work I originally did on making Ryan's ProcessWireUpgrades module "release" aware. In the end, I decided to ditch the approach I was originally taking and instead work on a module that hooked in to the UpgradeConfirmation dialog and the module edit page. Aims My aims for this module are as follows... Make discovery of a module's changes prior to an upgrade a trivial task. Make breaking changes very obvious. Make reading of a module's support documentation post-install a trivial task. Make module authors start to think about how they can improve the change discovery process for their modules. Make sure the display of information from the module support files/commit messages doesn't introduce a vulnerability. Looking at these in turn... Making discovery of a module's changes prior to upgrade a trivial task. This is done by adding a "What's changed section" to the upgrade confirmation dialog. This section takes a best-effort approach to showing what's changed between the installed version and the updated version that's available via the module repository. At present, it is only able to talk to github-hosted repositories in order to ask them for the release notes, the changelog file (if present) and a list of commits between the git tag that matches the installed version and the tag matching the latest version. It will display the Release Notes (if the author is using the feature), else it will display the commits between the tags (if tagging is used by the module author) else it will show the changelog file (if present) else it will show the latest N commits on the master branch (N, of course, being configurable to your liking.) An example of the Github Release Notes pulled in for you, taken from Mike Rockett's TextformatterTypographer Module... An example of a tag-to-tag commit list from the same module... An example of a changelog - formatted to show just the changes (formatting styles will change)... Finally, an example of a fallback list of commits - sorry Adrian ... Making breaking changes obvious. This is currently done by searching for a set of configurable search strings. Later versions may be able to support breaking change detection via use of Semantic Versioning - but this may require some way of signalling the use of this versioning standard on a module-by-module basis. For now, then, you can customise the default set of change markers. Here I have added my own alias to the list of breaking change markers and the changes section of the changelog is styled accordingly (these will be improved)... Make reading of a module's support documentation, post-install, a trivial task. This is done by making some of the support files (like the README, CHANGELOG and LICENSE files) readable from the module's information/settings screen. There is an option to control the initial open/closed state of this section... Here is Tracy's README file from within the module settings page... Make module authors start to think about how they can improve the change discovery process for their modules. There are notes in each of the sections displayed on the upgrade confirmation page that help authors use each of the features... Make sure display of external information doesn't introduce a vulnerability. This is an ongoing concern, and is the thing that is most likely to delay or prevent this module's release lead to this module's withdrawl should a vulnerability be found. Currently, output is formatted either via Markdown + HTML Purifier (if it was originally a Markdown file) or via htmlspecialchars() if it has come from a plaintext file. If you discover a vulnerability, please get in contact with me via the forum PM system. Ongoing... For now, I've concentrated on integration with GitHub, as most people use that platform to host their code. I know a few people are hosting their repositories with BitBucket (PWFoo comes to mind) and some with GitLab (Mike Rockett?) and I would eventually like to have adaptor implementations for these providers (and perhaps GitKraken) - but for now, GitHub rules and the other hosts are unsupported. Links Github: ModuleReleaseNotes PW Module Repository: Here
    1 point
  11. Field Descriptions Extended This module enables you to extend field descriptions by dividing short descriptions with a longer text that is revealed in a toggle. Modules Directory: http://modules.processwire.com/modules/field-descriptions-extended/ Github: https://github.com/outflux3/FieldDescriptionsExtended Extending your field descriptions using the standard field's description field. Once this module is installed, it will automatically search your description field for the presence of 5 dashes (-----). Any content above the 5 dashes will be visible and the content below the dashes will be hidden. A 'More...' link will appear at the end of the short description which when clicked will reveal the rest of the description. Using Simple Markdown Editor with the description field If you have Simple Markdown Editor (InputfieldSimpleMDE) installed, you can enable the field description to have that editor. *When using Simple MDE, you can use the button (Insert Horizontal Line) instead of typing 5 dashes. More about SimpleMDE. Extending your field descriptions using content from a ProcessWire Page for the field description. You may use the content from a ProcessWire page as a field description. This would allow you to easily insert images, links, and use hanna codes. To use page content for your field descriptions, please follow these instructions: Install Select Fields module (FieldtypeFields) http://modules.processwire.com/modules/fieldtype-fields/ Create a new field using this field type, e.g. field_select. Add the field to any template you will be using for your field descriptions. Setup your help pages (for example under a settings branch) where you will store the field description content,using the template containing the Field Select. Add content to a page and select the field where that content should show. To show a short text before the link to the longer content, separate them with 5 dashes Be sure to update your settings on this page, first enable page content descriptions,then specify the name of the Select Fields field, template to search, and content field. If you create a field description using this method, please note that the description field must be blank for contexts where you want the page content to appear. You can freely use template context for field descriptions, but the Page Content method is not context sensitive and will display under all contexts where the description is blank. ---- original post: This is a new module, hope to release soon, which allows extended field descriptions, in currently 2 ways. The main feature of the module is that you can have a short description and then a 'more...' link which drops down a longer block of text. This is achieved by separating the intro/visible text and the rest with 5 dashes. Example setup: the 2nd way is if you are using AdminThemeUiKit, you can show extended field instructions in a panel. The content of the panel is edited on a regular PW page. This use case would probably not be that common, but if you had a field that required some extended instructions for how to use, this could be useful; Also, since this allows you to target information and instructions down at the field level, it could reduce the amount of documentation needed on a global level, since it is a lot more context targeted.
    1 point
  12. Edit: Because of the great response to this topic I wrote a guest blogpost: https://processwire.com/blog/posts/building-custom-admin-pages-with-process-modules/ One of the hidden treasures of processwire seems to be the creation of custom admin pages. Technically speaking those pages are ProcessModules - but i guess that's the reason why so many people out there seem to be afraid of building them... it sounds so hard! You've never created a module for ProcessWire? You have never created a plugin for any other CMS? You have no clue about OOP with all its classes, methods and properties? No problem! I'll show you how simple you can start: <?php class CustomAdminPage extends Process { public static function getModuleinfo() { return [ 'title' => 'Custom Admin Page Example', 'summary' => 'Minimalistic ProcessModule to show that nobody has to be afraid of building custom admin pages.', 'href' => 'https://processwire.com/talk/topic/17709-how-to-create-custom-admin-pages-aka-processmodules-yes-its-that-simple/', 'author' => 'Bernhard Baumrock, baumrock.com', 'version' => 1, // page that you want created to execute this module 'page' => [ 'name' => 'customadmin', // your page will be online at /youradmin/setup/customadmin/ 'parent' => 'setup', 'title' => 'Custom Admin Page Example' ], ]; } public function ___execute() { return 'This is the most simple Admin-Page you have ever seen :)'; } } Now save this file as CustomAdminPage.module and place it in your /site/modules folder. After a refresh it will show your module in the modules manager of your site where you can install it: After installation you already have your first very own admin page! Congratulations! Was not too hard, was it? It's as simple as that! Now lets add some more custom HTML. And to show you another nice feature we will add this code to a separate method called executeDemo(). And because everything is so simple we will also add some javascript to this page public function ___executeDemo() { $out = ''; $out .= '<h1>H1 has some special css styling in the admin, thats why it seems to have no effect</h1>'; $out .= '<h2>H2 looks different ;)</h2>'; $out .= '<h3>...and so does H3</h3>'; $out .= '<button onclick="myFunction()">Click me</button>'; $out .= '<script>function myFunction() { alert("this is a demo javascript"); }</script>'; return $out; return ''; } Now thanks to ProcessWire-magic your page will already have its own URL: Just append /demo to your url and see what you get: And of course don't forget to click the button Ok, now that code looks a bit hacky, right? Inputfields and especially InputfieldMarkup for the win! We add another method with some advanced code. To use inputfields we need a form that holds all those inputfields and that makes it possible to handle user input lateron. See somas great tutorial about forms here for a quickstart and more details: public function ___executeAdvanced() { $out = '<h2>A more complex Example</h2>'; $form = wire()->modules->get('InputfieldForm'); $field = wire()->modules->get('InputfieldMarkup'); $field->label = 'Markup Test 1'; $field->value = '<h1>h1</h1><h2>h2</h2><h3>h3</h3><h4>h4</h4>'; $form->add($field); $out .= $form->render(); return $out; } Ok, it get's boring Let's do something more fun and add a chart in a second field and change the fields to 50% screen width (I'm sure you know that already from the GUI template editor)! public function ___executeAdvanced() { $out = '<h2>A more complex Example</h2>'; $form = wire()->modules->get('InputfieldForm'); $field = wire()->modules->get('InputfieldMarkup'); $field->label = 'Markup Test 1'; $field->value = '<h1>h1</h1><h2>h2</h2><h3>h3</h3><h4>h4</h4>'; $field->columnWidth = 50; $form->add($field); $field = wire()->modules->get('InputfieldMarkup'); $field->label = 'Chart Sample'; $field->value = '$chart'; //$field->notes = 'Example code taken from here: http://www.chartjs.org/docs/latest/getting-started/usage.html'; $field->columnWidth = 50; $form->add($field); $out .= $form->render(); return $out; } OK, we are almost there... we only need to add the chart library! To keep everything clean we will put the code for the chart in another method. We will make that method PRIVATE to add some security. Our new Method: private function renderChart() { // prepare chart code wire()->config->scripts->add('https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.1.3/Chart.min.js'); ob_start(); ?> <canvas id="myChart"></canvas> <script> var ctx = document.getElementById("myChart"); var myChart = new Chart(ctx, { type: 'bar', data: { labels: ["Red", "Blue", "Yellow", "Green", "Purple", "Orange"], datasets: [{ label: '# of Votes', data: [12, 19, 3, 5, 2, 3], backgroundColor: [ 'rgba(255, 99, 132, 0.2)', 'rgba(54, 162, 235, 0.2)', 'rgba(255, 206, 86, 0.2)', 'rgba(75, 192, 192, 0.2)', 'rgba(153, 102, 255, 0.2)', 'rgba(255, 159, 64, 0.2)' ], borderColor: [ 'rgba(255,99,132,1)', 'rgba(54, 162, 235, 1)', 'rgba(255, 206, 86, 1)', 'rgba(75, 192, 192, 1)', 'rgba(153, 102, 255, 1)', 'rgba(255, 159, 64, 1)' ], borderWidth: 1 }] }, options: { scales: { yAxes: [{ ticks: { beginAtZero:true } }] } } }); </script> <?php return ob_get_clean(); } Now we just need to call $this->renderChart() in the right place! Here is the complete Module: <?php class CustomAdminPage extends Process { public static function getModuleinfo() { return [ 'title' => 'Custom Admin Page Example', 'summary' => 'Minimalistic ProcessModule to show that nobody has to be afraid of building custom admin pages.', 'href' => 'https://processwire.com/talk/topic/17709-how-to-create-custom-admin-pages-aka-processmodules-yes-its-that-simple/', 'author' => 'Bernhard Baumrock, baumrock.com', 'version' => 1, // page that you want created to execute this module 'page' => [ 'name' => 'customadmin', // your page will be online at /youradmin/setup/customadmin/ 'parent' => 'setup', 'title' => 'Custom Admin Page Example' ], ]; } public function ___execute() { return 'This is the most simple Admin-Page you have ever seen :)'; } public function ___executeDemo() { $out = ''; $out .= '<h1>H1 has some special css styling in the admin, thats why it seems to have no effect</h1>'; $out .= '<h2>H2 looks different ;)</h2>'; $out .= '<h3>...and so does H3</h3>'; $out .= '<button onclick="myFunction()">Click me</button>'; $out .= '<script>function myFunction() { alert("this is a demo javascript"); }</script>'; return $out; return ''; } public function ___executeAdvanced() { $out = '<h2>A more complex Example</h2>'; $form = wire()->modules->get('InputfieldForm'); $field = wire()->modules->get('InputfieldMarkup'); $field->label = 'Markup Test 1'; $field->value = '<h1>h1</h1><h2>h2</h2><h3>h3</h3><h4>h4</h4>'; $field->columnWidth = 50; $form->add($field); $field = wire()->modules->get('InputfieldMarkup'); $field->label = 'Chart Sample'; $field->value = $this->renderChart(); $field->notes = 'Example code taken from here: http://www.chartjs.org/docs/latest/getting-started/usage.html'; $field->columnWidth = 50; $form->add($field); $out .= $form->render(); return $out; } private function renderChart() { // prepare chart code wire()->config->scripts->add('https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.1.3/Chart.min.js'); ob_start(); ?> <canvas id="myChart"></canvas> <script> var ctx = document.getElementById("myChart"); var myChart = new Chart(ctx, { type: 'bar', data: { labels: ["Red", "Blue", "Yellow", "Green", "Purple", "Orange"], datasets: [{ label: '# of Votes', data: [12, 19, 3, 5, 2, 3], backgroundColor: [ 'rgba(255, 99, 132, 0.2)', 'rgba(54, 162, 235, 0.2)', 'rgba(255, 206, 86, 0.2)', 'rgba(75, 192, 192, 0.2)', 'rgba(153, 102, 255, 0.2)', 'rgba(255, 159, 64, 0.2)' ], borderColor: [ 'rgba(255,99,132,1)', 'rgba(54, 162, 235, 1)', 'rgba(255, 206, 86, 1)', 'rgba(75, 192, 192, 1)', 'rgba(153, 102, 255, 1)', 'rgba(255, 159, 64, 1)' ], borderWidth: 1 }] }, options: { scales: { yAxes: [{ ticks: { beginAtZero:true } }] } } }); </script> <?php return ob_get_clean(); } } I hope you enjoyed reading this and it will open up many new possibilities for you! Updates: permissions: https://processwire.com/talk/topic/17709-how-to-create-custom-admin-pages-aka-processmodules-yes-its-that-simple/?do=findComment&comment=174746 tutorial on file uploads: https://processwire.com/talk/topic/17709-how-to-create-custom-admin-pages-aka-processmodules-yes-its-that-simple/?do=findComment&comment=185261 snippet how to use NavJSON: https://processwire.com/talk/topic/17709-how-to-create-custom-admin-pages-aka-processmodules-yes-its-that-simple/?do=findComment&comment=216412
    1 point
  13. ok hang on let me check this - where are you adding that hook (i'm adding it in ready method) dangit, was adding it before... it's totally working now.
    1 point
  14. It's working for me. Double-check the hook code, or maybe you have some other module or hook interfering? AdminTheme::getExtraMarkup should never return null - even if it's unused it still returns an array. $wire->addHookAfter('AdminTheme::getExtraMarkup', function(HookEvent $event) { $parts = $event->return; $parts['head'] .= '<link rel="stylesheet" href="/site/templates/custom.css">'; $event->return = $parts; });
    1 point
  15. If you want to add a CSS file so that it is linked at the bottom of the list of admin styles and scripts you can use a hook like this: $wire->addHookAfter('AdminTheme::getExtraMarkup', function(HookEvent $event) { $parts = $event->return; $parts['head'] .= '<link rel="stylesheet" href="/path/to/custom.css">'; $event->return = $parts; });
    1 point
  16. one thing that i would find difficult from the perspective of UI, is that if you click on an image, you lose all context of where you are at, scrolled down – the page scrolls to the top, and even if you close the larger image at the top, it doesn't put you back where you were – this results in an insane amount of vertical scrolling if you wanted to peruse the portfolio items. You may need to either add prev/next navigation to the opened image, or find some other way of presenting the detail of the images when clicked.
    1 point
  17. Needed this, thanks! Seems so obvious afterwards.
    1 point
  18. Thanks @netcarver, that works. I got it working with a switch statement. Not neat but it works. This solution is much neater.
    1 point
  19. Site profiles: yes. Making Processwire out of the box by stuffing the core: no way.
    1 point
  20. First post-release display bug report in and fixed - thanks!
    1 point
  21. Yeah, this approach is better. @ziu There's various examples in the forum regarding Robin's suggested approach. Just can't find them now.
    1 point
  22. @JasonS Noooooo, I was afraid this would happen. It is fixed now! Sorry! Yep, that was a Tracy bd() call ... as a quick fix you may just remove that line ...
    1 point
  23. I haven't looked into why, but it's weird to me that the first option doesn't work. Maybe it would be ok with !== but that would make it more strict, so not sure. But glad you have it working
    1 point
  24. Good suggestion - I have actually used this module (slightly modified) on the frontend - works great!
    1 point
  25. Thanks @bernhard for the brief explanation what I have to do it. I actually sent the PR for the first time ( I hope its good ). In this place addings the link: https://github.com/ryancramerdesign/regular/pull/4 Time will tell if PR will be approved
    1 point
  26. thats nice! so what about making a PR on github so that ryan can accept the compressed profile? ...and i'm pretty close to release something even more awesome i have to see if the new online installer changed anything or if it still works.
    1 point
  27. Hi, Check this thread if it can solve your problem:
    1 point
  28. You could also look at this code/module by @Soma for the live search feature: https://github.com/somatonic/AjaxSearch/blob/master/AjaxSearch.js Then its up to you to do your logic in the search.php template. To filter the data, check the doc/example : - https://datatables.net/examples/plug-ins/range_filtering.html - https://datatables.net/examples/api/multi_filter.html - https://www.google.fr/search?q=jquery+datatables+filter
    1 point
  29. One thing to consider here would be offline or LAN use, where you may not have access to GitHub.. and of course GitHub being offline, though that doesn't happen too often these days. That being said, I personally think that we should limit the starting site profiles to a bare minimum – three or four being the absolute maximum in my opinion. Offering an online site profile installer as an additional option in case none of the starting profiles feel just right would be pretty awesome.
    1 point
  30. Changelog styles now improved. Here's a changelog from the update screen - no breaking changes detected... ... and here it is with breaking changes ... Raw markdown also get's labelled...
    1 point
  31. i'm working on something in this direction i have to polish up a lot though. don't know when i find time...
    1 point
  32. @rafaoski, do you know about the Site Profile Exporter module? You can make your own profile (or edit an existing one) and add in whatever technologies you want, then export it and use it for new PW installs. I'm not sure why any of the things you are requesting need to be connected with the PW core as everyone's preferences are different. When it comes to profiles that are bundled with the core I'd like the number to reduce (to, like, 1 maximum) because for me I never use them and it's just unnecessary megabytes that have to be downloaded and unpacked with every new core release. Currently nearly half the size of the PW downloadable core is made up of site profiles that for some users (most?) will just be immediately deleted. I'd rather see each "official" profile in it's own GitHub repo where they can be downloaded only if needed.
    1 point
  33. As much as I like the idea of including more with the site profiles, I feel like a lot of these are user specific. I rather like the fact I can quickly add in what I need based on the project scope. I actually have a folder with a few dependencies (slideshows, data tables, grids) that I just copy over to a new install and can get up and running quite quickly.
    1 point
  34. I'm not sure of the likely hood for a default site profile including these. Minify CSS/JS is included in AIOM and ProCache - I don't think this will make it's way to the core. There is a UIKit Site Profile which is using - https://getuikit.com Am I miss understanding your question?
    1 point
  35. Thought id also post a link to this great blog post by Ryan, which includes the successor to the MarkupLoadGCal module: https://processwire.com/blog/posts/composer-google-calendars-and-processwire/ Hope this helps.
    1 point
  36. Here are a few links to check out for PW calendars. I'm not recommending a solution here, just signposting. These are in the official PW module repository... https://github.com/ffub/MarkupiCalendar (iCalendar feeds anyone?) https://github.com/netcarver/PW-ProcessGcalEmbed (My old module) http://www.99lime.com/modules/recurme/ (Premium) These aren't (a.f.a.i.k.)... https://github.com/plauclair/Calendar https://github.com/ryancramerdesign/MarkupLoadGCal (Ryan's module) https://github.com/decadeofdefeat/church-website-processwire (Has a calendar implementation in it) https://github.com/lindquist/processwire-calendar https://github.com/UF-Asq-Fab-Lab/Scheduler Hope that helps!
    1 point
  37. Saving a sort order to a Repeater field is trickier than you might expect. This is because the sort order of items in a Repeater field is determined by their sort position under their parent page in Admin > Repeaters > [repeater field] > [container page]. So the "sort" value of each Repeater page in other words. When you do... $page->repeater_field->sort('some_property') ...you are only changing the order of items in the PageArray. This order is never saved to the "sort" value of the individual repeater items. Here is one way you can save the sort order: // Here you order the PageArray how you want it $r_items = $page->repeater_field->sort('some_property'); // BUT, the original keys (indexes) are preserved // So you need to get just the values with new keys // This step could be merged into the line above // Alternatively you could just use a counter variable in the foreach loop $r_items = $r_items->getValues(); foreach($r_items as $index => $r) { // Update the sort value of the repeater page // See: https://processwire.com/api/ref/pages/sort/ $pages->sort($r, $index); } Also, you might be interested in the Page Move and Resort module by @kixe. It has a method... $pages->resortChildren($page, $selectorValue) bool/ null resort children under specified parent based on selector value (sort=$selectorValue) ...which you could use on the parent page of the Repeater items.
    1 point
  38. Just a quick update, so this module works fine and if you purchased FontAwesome 5 Pro and need/want to use those icons in the PW admin, this module allows that do be done, and works with default and Reno themes; it doesn't work on UiKit theme yet, see here for the reason https://github.com/processwire/processwire-requests/issues/120
    1 point
  39. There is limited (and undocumented) AJAX 'dependent selects' support built into Page Reference fields. You must use the 'Custom find' or 'Selector string' option for defining selectable pages, and reference the source Page Reference field (that exists on the same page) using syntax like this: parent=page.page_reference_field_name Based on testing I have found: It only works for Select, Select Multiple or AsmSelect inputfields It does not work inside a repeater item
    1 point
  40. Just edit the url of the "Admin" page in the pagetree.
    1 point
×
×
  • Create New...