Leaderboard
Popular Content
Showing content with the highest reputation on 06/30/2018 in all areas
-
DEPRECATED If you are interested in the new version (commercial module launching in 2023) write me a PM --- Some of you might have followed the development of this module here: https://processwire.com/talk/topic/15524-previewdiscussion-rockdatatables/ . It is the successor of "RockDataTables" and requires RockFinder to get the data for the grid easily and efficiently. It uses the open source part of agGrid for grid rendering. WHY? ProcessWire is awesome for creating all kinds of custom backend applications, but where it is not so awesome in my opinion is when it comes to listing this data. Of course we have the built in page lister and we have ListerPro, but none of that solutions is capable of properly displaying large amounts of data, for example lists of revenues, aggregations, quick and easy sorts by the user, instant filter and those kind of features. RockGrid to the rescue ? Features/Highlights: 100k+ rows Instant (client side) filter, search, sort (different sort based on data type, eg "lower/greater than" for numbers, "contains" for strings) extendable via plugins (available plugins at the moment: fullscreen, csv export, reload, batch-processing of data, column sum/statistics, row selection) all the agGrid features (cell renderers, cell styling, pagination, column grouping etc) vanilla javascript, backend and frontend support (though not all plugins are working on the frontend yet and I don't plan to support it as long as I don't need it myself) Limitations: While there is an option to retrieve data via AJAX the actual processing of the grid (displaying, filtering, sorting) is done on the client side, meaning that you can get into troubles when handling really large datasets of several thousands of rows. agGrid should be one of the most performant grid options in the world (see the official example page with a 100k row example) and does a lot to prevent problems (such as virtual row rendering), but you should always have this limitation in mind as this is a major difference to the available lister options that do not have this limitation. Currently it only supports AdminThemeUikit and I don't plan to support any other admin theme. Download: https://gitlab.com/baumrock/FieldtypeRockGrid Installation: https://gitlab.com/baumrock/RockGrid/wikis/Installation Quikckstart: https://gitlab.com/baumrock/RockGrid/wikis/quickstart Further instructions: https://gitlab.com/baumrock/RockGrid/wikis/quickstart#further-instructions German Translation File: site--modules--fieldtyperockgrid--fieldtyperockgrid-module-php.json Changelog: https://gitlab.com/baumrock/FieldtypeRockGrid/raw/master/changelog.md Module status: alpha, License: MIT Note that every installation and uninstallation sends an anonymous google analytics event to my google analytics account. If you don't want that feel free to remove the appropriate lines of code before installation/uninstallation. Contribute: You can contribute to the development of this and other modules or just say thank you by testing, reporting issues and making PRs at gitlab liking this post buying me a drink: paypal.me/baumrock/5 liking my facebook page: facebook.com/baumrock hiring me for pw work: baumrock.com Support: Please note that this module might not be as easy and plug&play as many other modules. It needs a good understanding of agGrid (and JavaScript in general) and it likely needs some looks into the code to get all the options. Please understand that I can not provide free support for every request here in the forum. I try to answer all questions that might also help others or that might improve the module but for individual requests I offer paid support (please contact me via PM). Use Cases / Examples: Colored grid cells, Icons, Links etc. The Grid also has a "batcher" feature built in that helps communicating with the server via AJAX and managing resource intensive tasks in batches: Filters, PW panel links and instant reload on panel close: You can combine the grid with a chart library like I did with the (outdated) RockDataTables module:7 points
-
This week we've got a lot of updates on our core dev branch, including new features, issue resolutions and more. For starters, we've added support for making the Trash and Restore features available to non-superusers, along with related improvements. Plus we've got several new useful and interesting page traversal methods and properties added to our $page API. https://processwire.com/blog/posts/processwire-3.0.107-core-updates/5 points
-
Finally I was able to release RockGrid I decided to release it as MIT, so everybody can contribute and maybe use it for other great additions to ProcessWire. I think it's a great way of listing data and I can think of several situations where it would make the admin UI a lot better than it is now with our existing tools. For example @adrian s batch child editor could maybe benefit from such a tool? I don't know. Let's see what happens... The module is still alpha and not perfect... But it was also a lot of work and can't provide anything better than that at the moment. If anybody here can do it better: Please feel free to take over ? Thanks everybody for all the feedback here in this thread! Special thanks to @MrSnoozles for showing me agGrid and making me replace datatables ?5 points
-
@neophron If I read your original post correctly, you want to target each subpage individually for CSS styling, eg background colour, after it's rendered on the home page. If so, then I would add a class of the page name and/or template name and/or page id to the subpage template, eg: // Sub page template <div id="p<?=$page->id?>" class="<?=$page->name?> <?=$page->template?>"> // Your field output stuff here... </div> This ensures each home page section has unique style classes and ids to target. Then use your first method to render the subpages on the home page, ie: <?php foreach($page->children() as $p){ echo $p->render(); // will render the above } ?> Your CSS would then look something like: .subpage-1 {background-color: blue;} .subpage-2 {background-color: red;} .subpage-3 {background-color: green;}4 points
-
ProcessWire & Vue.js — a Lovestory Introducing the all new ICF Conference Website The new ICF Conference Page — Fearless » What would happen if we were equipped to fearlessly face the daily challenges and live a life without fear? « This question is at the core of our next ICF Conference in 2019 in Zurich. Its also the question we set out to answer in terms of developing the new website; the all new ICF Conference website is our most advanced website in terms of technology, designed to take advantage of the latest web-technologies. Its a brand new design powered by a lean setup, using ProcessWire for easy content management and a slick frontend based on Vue.js, Quasar and a heavily customized Uikit theme. Technology-stack — From backend to frontend, technologies that are fun, easy and fast to develop with We built on the ICF Ladieslounge website as a solid foundation and took our learnings from building our last Conference Booklet PWA (Progressive Web App) and applied it to the new website. Some highlights of the new ICF Conference website: Completely decoupled backend and frontend Custom design based on Uikit frontend framework Changing of languages happens instantly, no page-reload required Easy content updates thanks to ProcessWire All data is transferred using a single request returning custom JSON » Continue reading on Medium And please don't forget to clap and share:3 points
-
@netcarver, for me, the latest dev-branch is working, but all other are 404. http://kongondo.github.io/ProcessWireAPIGen/pw3dev/index.html EDIT: Uhm? Why I'm answereing this? - Believe me, before my answer, I couldn't see Adrians and your further posts. Something like a "One Hour Time Delay" with my internet connection? ? ?2 points
-
Today I want to share a little module that adds 2 additional save buttons with redirect and 1 unpublish button to the page edit. 2 additional save buttons: My intention was that it would be nice if someone saves an article in the backend and will be redirected after saving directly to the frontend page of the article. This module adds 1additional save button at the bottom next to the default save button and 1 at the top. So you can choose if you want to save the article with the default save button or you will save it with the custom save button and you will get redirected to the frontend article. 1 unpublish button: The idea behind this was that I want to disable the setting tab for non superuser. The problem was if I hide it, then non superusers are no longer able to unpublish an article. Therefore this module adds an additional unpublish button at the bottom - the user clicks it and the page will be saved with status unpublished. All pages under the admin section will not be affected of this module. Module is multilingual, so you can set the button texts in all languages. Top view page status published: Bottom view page status published: Bottom view page status unpublished: Here is the code: <?php /** * Adding 2 additional save buttons with redirect to frontend and 1 unpublish button for page edit form. * * ProcessWire 2.x * Copyright (C) 2010 by Ryan Cramer * Licensed under GNU/GPL v2, see LICENSE.TXT * * http://www.processwire.com * http://www.ryancramer.com * */ class CustomPageSaveAndUnpublish extends WireData implements Module { /** * getModuleInfo is a module required by all modules to tell ProcessWire about them * * @return array * */ public static function getModuleInfo() { return array( 'title' => 'Custom page save and unpublish module', 'version' => 1, 'summary' => 'Example for adding 2 additional save buttons with redirect and 1 unpublish button to page edit', 'href' => 'http://www.processwire.com', 'singular' => true, 'autoload' => true ); } /** * Initialize the module * * ProcessWire calls this when the module is loaded. For 'autoload' modules, this will be called * when ProcessWire's API is ready. As a result, this is a good place to attach hooks. * */ public function init() { $this->addHookAfter("ProcessPageEdit::buildForm", $this, "addSaveButton"); $this->addHookAfter("ProcessPageEdit::buildForm", $this, "addUnpublishButton"); // tell processwire that this is a page save if ($this->input->post->submit_save_minor) { $this->input->post->submit_save = 1; // attach hook on page save $this->addHookAfter("Pages::saved", $this, "hookPageSave"); } if ($this->input->post->submit_unpublish) { $this->input->post->submit_save = 1; // attach hook on page save $this->addHookAfter("Pages::saveReady", $this, "hookPageSaveReadyUnpublish"); } } public function hookPageSave($event) { //function to redirect to the frontend after save $page = $event->arguments("page"); if ($this->input->post->submit_save_minor) { // this will get saved after this saveReady hook so no need to save here $pageid = $page->id; $goto = wire("pages")->get("id=$pageid")->url; //get url of frontend article wire("session")->redirect($goto); } } public function hookPageSaveReadyUnpublish($event) { //function to change the status to unpublished $page = $event->arguments("page"); $status = $page->status; $unpublishmessage = __("Status of the page is set to unpublished"); if ($this->input->post->submit_unpublish) { if ($status == 1) { $page->status = "2049"; $this->message($unpublishmessage); } } } public function addSaveButton($event) { //function to add the 2 additional save button with redirect at the top and at the bottom $page = $event->object->getPage(); $status = $page->status; if (($page->rootParent->id != "2") AND ($status == 1)) { //dont show on all pages which are under the admin section and which are not published $form = $event->return; $buttontext = __("Save and go to page"); // new submit button $f = $f2 = $this->modules->InputfieldSubmit; $f->attr("name", "submit_save_minor"); $f->attr("value", $buttontext); $f2->attr("name", "submit_save_minor"); $f2->attr("value", $buttontext); $f2->class .= ' ui-priority-secondary head_button_clone'; // add submit button after the regular save button only if page is published $form->insertAfter($f, $form->get("submit_save")); $form->insertAfter($f2, $form->get("submit_save")); } } public function addUnpublishButton($event) { //function to add the unpublish button at the bottom if page has status published $page = $event->object->getPage(); if ($page->rootParent->id != 2) { //dont show on all pages which are under the admin and dont show the button under the delete tab $form = $event->return; $unpublishbuttontext = __("Unpublish"); // new submit button $f = $this->modules->InputfieldSubmit; $f->attr("name", "submit_unpublish"); $f->attr("value", $unpublishbuttontext); // add unpublish button after the save button if ($page->status == 1) { $form->insertAfter($f, $form->get("submit_save")); } } } } Everybody who is interested can download the modul here: CustomPageSaveAndUnpublish.zip Best regards Jürgen1 point
-
Hi all, Introducing a new GDPR Cookie Management Banner module. https://github.com/adrianbj/CookieManagementBanner https://modules.processwire.com/modules/cookie-management-banner/ This module was sponsored by VentureWeb in Squamish, BC, Canada. I converted a Drupal module written by Oliver Walker from VentureWeb into what you see here. The Drupal module requires jQuery so at the moment, this module also requires jQuery. I will probably remove this sometime soon. This module certainly has similarities to MarkupCookieConsent but provides the user with the following features: The user can accept all cookies or they can choose to not accept tracking/marketing cookies. Module config options allow you to: define all text and button labels (multi-language support) manually increment the cookie policy version which forces the user to review their consent again select whether users can manage their cookies, or just accept all option to limit display of banner to users only in European Union (by IP address) position selection (top or bottom overlay, or content pushed down from the top) It comes with basic default styling which is easily overwritten by site CSS The module sets various values to the dataLayer array which works together with Google Tag Manager - please read through the code in /assets/js/CookieManagementBanner.js to get a better idea of how this works and what is made available for GTM. You can wrap your tracking/marketing cookie code in a check for the localstorage key of: pwcmbAllowCookies if(localStorage.getItem('pwcmbAllowCookies') == 'y') You can also provide a link on your site (probably in the footer) like this that will allow the user to show the banner even after they have saved their preferences / accepted. <a href="#cookies" class="js-pwcmb-notice-toggle">Manage Your Cookies</a> Would love to hear feedback from anyone who gives this a go.1 point
-
You may or may not know the templates created over at Styleshout.com. As a fan of the work I decided to create a site profile based on the latest template Sublime. Just in case you ask: I talked to Erwin from Styleshout about the idea and he was totally fine with it. There are no major changes compared to the official version of that template - just some CSS tweaks. The whole site profile was created without any 3rd party ProcessWire modules and comes with sample (lorem ipsum) content and free stock photos. Details about used fonts, scripts and images can be seen over at the Sublime template details page. If you decide to use this site profile please keep in mind that you keep at least the Styleshout link in the footer of that page - my link can be removed. ? Is this site profile ready for usage? Sure. It will work and can be customized and updated with your content straight away. There is even a SEO tab if you want to play that Google-game. Right now I would say it's more of a good looking easy entrance to the ProcessWire world. All template code is quite verbose and easy to understand for beginners. By now all site profile files are located over at Github: https://github.com/webmanufaktur/pw-sublime That's all Folks - feel free to play around with this site profile. Let me know what you would do different or what should be changed. Bugs, questions, anything? Let me know. Screenshots Pages or sections created in the backend. Choose and sort those sections for the front page. SEO if you want Auto-generated navigation based on sections. Global settings What will or might come in the future? I plan to create more site profiles in the future - all based on pre-made HTML templates that are available for free. If you know other templates or would like to see one of them as a site profile, please let me know. Maybe I can spare an hour or two.1 point
-
Hi, thanks for this idea. Due to time pressure, I installed the »Sublime PW« profile and started to adapt it. This single page concept is build upon a Page Reference Field. In every page(= sections) you can throw your html structures.1 point
-
Just released RockGrid, so RockFinder Tester is now usable in this module ?1 point
-
ok then check if your new template is in the allowed page (template) in the sections field options (go to Setup > Fields > sections then Input tab)1 point
-
I don't know, but the function itself is hookable, see here: https://github.com/processwire/processwire/blob/master/wire/modules/Process/ProcessPageEdit/ProcessPageEdit.module#L864 protected function ___buildFormChildren() { ... if(!empty($settings['ajaxChildren'])) $wrapper->collapsed = Inputfield::collapsedYesAjax; Guess you'll have to find out where $settings is stored... in config.php or elsewhere?1 point
-
3.x dev still works: http://kongondo.github.io/ProcessWireAPIGen/pw3dev/1 point
-
To get the repeateritems when they do not live on the current page, you do: $upcoming_dates = $pages->get(ID-of-repeaterpage)->agendaitem->find("agenda_datum>=$today, sort=agenda_datum"); and you go from there.1 point
-
I totally agree with that but pages in pages under pages (repeaters) is something different. So plain pages are always more easily to control.1 point
-
Never ever give endusers too much options as in decisions. A lesson I learned way too early. Give them pre-defined options (for example: 2-columns, 3-columns, 4-columns, big jumbotron, small jumbrotron). Pre-defined sets of settings work much better than fully customizable parts - for my clients and for my cases.1 point
-
Honestly... go with pages for each event. It's much easier to handle and much easier to [everything]. Repeaters are nice but events/dates/calendar entries are more than just an item in a page. If you used pages instead of repeaters you could use: <?php $eventsToday = $pages->find("template=event, date=today"); ?> Just create a root element, for example: page with template events, for all your events and place all evens underneath it.1 point
-
I use the following in /site/modules/InputfieldCKEditor/config.js to disallow inline styles. CKEDITOR.editorConfig = function( config ) { config.disallowedContent = '*{*}'; // All styles disallowed };1 point
-
If you need this for the backend (result available in frontend too) you can use FieldtypeMarkup for the result. Grab the code from here: https://github.com/kixe/FieldtypeMarkup Create a hook with your formula and place the code in /site/ready.php The result will be populated after saving the page. /** * https://github.com/kixe/FieldtypeMarkup * FieldypeMarkup as concat field with formula * EXAMPLE * */ $wire->addHookAfter('FieldtypeMarkup::formatValue', function($e) { $page = $e->arguments[0]; $field = $e->arguments[1]; // quick exit if ($field->name != 'result') return; if ($page->template != 'calculator') return; $value1 = $page->inputfield1; $value2 = $page->inputfield2; $value3 = $page->inputfield3; $value4 = $pages->get(12345)->inputfield1; // get value from another page $result = $value3 * ($value2 - $value3) / $value4; // formula $e->return = $result; });1 point
-
http://lmgtfy.com/?q=javascript+form+formula You just need some very basic HTML + some very basic JavaScript1 point
-
There's native `Fieldset in Tab` for creating editor tabs, but sometimes it could make more sense to put a field that's not directly related to `Content` into `Settings` or `Children` tab (such as for body class or some toggles that I see being used often). You can use the hook below to move fields between the tabs. // site/ready.php wire()->addHookAfter('ProcessPageEdit::buildForm', function (HookEvent $e) { // make sure we're editing a page and not a user if ($e->process != 'ProcessPageEdit') return; // RESTRICT BY TEMPLATE // $page = $e->object->getPage(); // if ($page->template != 'home') return; // RESTRICT BY ROLE // $user = $e->user; // if (!$user->hasRole('editor')) return; $form = $e->return; $contentTab = $form->children->get('id=ProcessPageEditContent'); $settingsTab = $form->children->get('id=ProcessPageEditSettings'); // $childrenTab = $form->children->get('id=ProcessPageEditChildren'); // if page template is set noSettings = true, $settings will not exist if (!$settingsTab) return; // MOVE TITLE FIELD TO SETTINGS TAB $title = $contentTab->get('title'); if (!$title) return; $contentTab->remove('title'); $settingsTab->prepend($title); });1 point
-
Thanks @abdus Relating to the topic, there are other code snippets lurking in the Forum, like: Have a different title of a field across multiple templates? Hook to hide inputfield in Admin Custom Field in Page SettingsTab Remove a fieldset tab from specific pages of a template1 point
-
Cool stuff! But in the example you would definitely want that template check at the top of the hook (or check the current process with $this->process) or you will get an error when creating or editing a user (no Settings tab exists).1 point
-
1 point
-
Thanks for sharing. This would make for a good recipe on https://processwire-recipes.com/1 point
-
Should anybody need this: $pages->addHookAfter("ProcessPageEdit::buildForm", function(HookEvent $event) { $page = $event->object->getPage(); $form = $event->return; if ($page->template->id == 44 && $page->parent->id != 1020) { $fieldset = $form->find("id=Inputfield_fieldset_tab_2")->first(); $form->remove($fieldset); $event->object->removeTab("Inputfield_fieldset_tab_2"); } }); Just replace the $page->template->id with the id of your template, and the $page->parent->id to what you want (or something similar). Finally replace fieldset_tab_2 with the name of your field.1 point