Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 02/10/2017 in all areas

  1. This week we’ve started developing a new admin theme for ProcessWire that aims to be a community collaboration. We’ve now got some good momentum with lots to share in this post. We also get into some technical details and have screenshots as well. https://processwire.com/blog/posts/working-towards-a-new-admin-theme/
    11 points
  2. This module enables you to automatically create pages based on a ProcessWire page template, eg Calender detail page, that has calendar event recurrences. Download from GitHub: https://github.com/clipmagic/ProcessRecurringEvents
    8 points
  3. DEPRECATED - this module will not see any updates. I'm short before releasing RockGrid as commercial module. If you are interested contact me via PM this is a preview of a module that i'm working on for quite a long time. I needed it for an intranet office management application that i'm still working on. It makes it very easy to create very customized Datatables using the awesome jquery datatables plugin (www.datatables.net) Download - sorry, removed as it changes too frequently; closed alpha - contact me if you think you can contribute Remarks: The module is intended to be used on the backend. Loading styles is at the moment only done via adding files to the $config->styles/scripts arrays. Also the communicaton to javascript is done via the $config->js() method that is built into the admin and would have to be implemented manually on frontend use. But it would not be difficult of course Installation: Nothing special here, just download + install edit: removed some parts, because i made a complete rewrite of the module (and may not have been the last one)! [...] removed Why i created this module: of course i know @Soma s module but i needed a lot more features and the newer datatables version. also i like to define all the columns as objects and have everything on one place. lister & markupadmindatatable: nice for basic tables but lacks of features to modify the appearance of the cell values (like rendering icons, background colors and so on) datatables provides a great frontend API for filtering, showing/hiding columns, getting data, modifying it... it also plays well together with frontend charts like google chart api in this case: todo / roadmap: reload only one row add filters to all columns (in future also dropdowns, smaller than, bigger than, Regex, ...) make it possible to add table on frontend pages make buttons look like pw buttons make it possible to set settings globally and only for one table provide easy way of colorbars (percentage, red/green), maybe at different positions (left, top, right, bottom) provide easy way of adding action items (edit, show, link etc - visible or onhover) make own layout for tables (topleft, topright, bottom etc to make it easy to create extensions and show messages) privide way of simple javascript plugins (like I already have for row sums etc) provide easy way of handling actions for all selected items (delete selected, update selected...) provide easy way of reloading data (--> easy when using ajax source) easy way of showing/hiding columns excel/csv/clipboard export GUI for table setup processmodule to show different tables (lister replacement)
    8 points
  4. Website: https://gatorade.com.do/5v5/ Modules: Form Builder, Lister Pro, Profiler pro, Tracy debugger, Procache (still not installed) It's a simple landing designed to handle registrations to a Gatorade Tournament, but it's kind of cool to see a big brand like Gatorade running Processwire.
    8 points
  5. do those pages have a title field? maybe you removed it? in the pagetree you wouldn't realize it because it would show the page name. try a tracy console like $child = $pages->get(_your_childpage_id_); d($child->id); d($child->title);
    4 points
  6. @Nurguly Ashyrov, this is really awesome. My front-end work is mostly JS/SPA work these days and I learnt to love the “headless”/“api first“ approach of commercial CMSes like Contentful. So I often thought about what a perfect and easy to manage back-end ProcessWire would be with a solid HTTP-based api built right in to allow uncoupling actual front-end/ui parts like admin and user interfaces (as actual self-contained apps) from the CMS itself. A module like yours makes a huge leap in this direction and will make ProcessWire much more interesting for a lot of front-end devs and e.g. as a flexible and fast to set up back-end for app prototyping/mvp development. A pity this didn’t exist 9 month ago!
    3 points
  7. You can also avoid recursive issues with hooks on save by just saving the field you have changed, rather than the entire page, eg. $OtherPage->save('ThemeCachedCSS');
    3 points
  8. @adrian How about adding "required" html5 attributes to username/pass input fields? Plus updated the above screenshot to a non-stock login form
    3 points
  9. The solution to both of these is to create a parent for your PageTable pages under the Admin branch of the tree. Edit: actually, that doesn't deal with the second question, but this thread has some techniques for disallowing direct access to a page:
    2 points
  10. Hi @tpr - I have made all those requested changes and also several other updates to the module. Please let me know if you find any problems.
    2 points
  11. Ok gotcha - I see how it helps now. I had a quick look and couldn't figure out what it achieved, but now I see and agree it's a little nicer. I wish there was a way to not have it partly cover the sidebar, but with those elements being absolutely positioned, I don't see an option. I think what I ended up with is a decent compromise though - it's narrow enough that it doesn't interfere, but is still obvious enough. If anyone has any better ideas I'd be happy to change.
    2 points
  12. Well, that depends... If you have a domain for the site or create a subdomain for the site, then we are talking about two different situations. For example in the case of a standard cPanel only account: say you have dev.example.com and want to install ProcessWire in /public_html/dev_example, in that case the default .htaccess file just does its job fine. However, when I moved the "main" site – which runs under the domain the cPanel account is tied to – to a subdirectory, only these rules did the trick for me: RewriteCond %{HTTP_HOST} ^(www.)?szabesz\.hu$ RewriteCond %{THE_REQUEST} \s/+szabesz_hu/(\S*)\s [NC] RewriteRule ^ /%1 [R=302,L,NE] Where szabesz.hu is my site, szabesz_hu is the subdirectory. I inserted this before the line RewriteCond %{REQUEST_FILENAME} !-f Also $config->urls->root = '/'; must probably be present in /site/config.php to get page()->url return the url segments without the subfolder being part of it, more on this: https://processwire.com/api/ref/page/url/ Nothing else I found in the forum or in the docs worked in my case. And there are other situations as well, but I just wanted to point out this one, since I had to google around to solve it. Your scenario can be different though, so you might want to provide some information about what you exactly want to solve .
    2 points
  13. Hi. You should uncomment this line in .htaccess and change "pw" to the name of your folder RewriteBase /pw/ Also, there is a branch of similar topics:
    2 points
  14. Better yet, show us your HTML and I'll tell you how to do it.
    2 points
  15. If you want your hook to fire on the saving of all pages but the one you are updating in your hook you would do: public function UpdateAnotherPage($event) { $page = $event->arguments('page'); if($page->id !== 1240) { // update page 1240 } }
    2 points
  16. It's possible, but I don't think there is a way to limit the access to a single module. Module configuration uses the ProcessModule process. If you check the source for that class you can see the permission that is needed to get access to the process: 'module-admin'. So you can create that permission and give it to a role, but then they can configure any installed module, which would be quite dangerous. Also, the modules menu still doesn't appear for the role - you'd have to dig around in the admin theme modules to find out what prevents that menu item from rendering. An alternative would be to create a custom Process module that provides the same config fields and then save to the MarkupSEO config on page save. Then you can give access to that one Process module.
    2 points
  17. This jQuery plugin seems to do the job without any obvious performance issues: http://laertejjunior.github.io/freezeheader/
    2 points
  18. Here are some of the custom skins provided for the Bar-UI, and the shortcodes used:
    2 points
  19. NOTE: This thread originally started in the Pub section of the forum. Since we moved it into the Plugin/Modules section I edited this post to meet the guidelines but also left the original content so that the replies can make sense. ProcessGraphQL ProcessGraphQL seamlessly integrates to your ProcessWire web app and allows you to serve the GraphQL api of your existing content. You don't need to apply changes to your content or it's structure. Just choose what you want to serve via GraphQL and your API is ready. Warning: The module supports PHP version >= 5.5 and ProcessWire version >= 3. Links: Zip Download Github Repo ScreenCast PW modules Page Please refer to the Readme to learn more about how to use the module. Original post starts here... Hi Everyone! I became very interested in this GraphQL thing lately and decided to learn a bit about it. And what is the better way of learning a new thing than making a ProcessWire module out of it! For those who are wondering what GraphQL is, in short, it is an alternative to REST. I couldn't find the thread but I remember that Ryan was not very happy with the REST and did not see much value in it. He offered his own AJAX API instead, but it doesn't seem to be supported much by him, and was never published to official modules directory. While ProcessWire's API is already amazing and allows you to quickly serve your content in any format with less than ten lines of code, I think it might be convenient to install a module and have JSON access to all of your content instantly. Especially this could be useful for developers that use ProcessWire as a framework instead of CMS. GraphQL is much more flexible than REST. In fact you can build queries in GraphQL with the same patterns you do with ProcessWire API. Ok, Ok. Enough talk. Here is what the module does after just installing it into skyscrapers profile. It supports filtering via ProcessWire selectors and complex fields like FieldtypeImage or FieldtypePage. See more demo here The module is ready to be used, but there are lots of things could be added to it. Like supporting any type of fields via third party modules, authentication, permissions on field level, optimization and so on. I would love to continue to develop it further if I would only know that there is an interest in it. It would be great to hear some feedback from you. I did not open a thread in modules section of the forum because I wanted to be sure there is interest in it first. You can install and learn about it more from it's repository. It should work with PHP >=5.5 and ProcessWire 3.x.x. The support for 2.x.x version is not planned yet. Please open an issue if you find bugs or you want some features added in issue tracker. Or you can share your experience with the module here in this thread.
    1 point
  20. Simplest way is to put your jQuery into a function and call it on DOM ready and also on ajaxComplete: $(function() { myPageTableFunction(); }); $(document).ajaxComplete(function() { myPageTableFunction(); }); But you could use a hook rather than the jQuery approach: $this->addHookAfter('Fieldtype::markupValue', function($event) { $field = $event->arguments('field'); $page = $event->arguments('page'); if($field->name == 'my_text_field' && $page->template->name == 'my_pagetable_template') { $text = $event->return; if($text == 'aktiv') $event->return = "<span class='uk-badge active'>$text</span>"; if($text == 'abgesagt') $event->return = "<span class='uk-badge cancelled'>$text</span>"; } });
    1 point
  21. Ok, I'll check what could cause child pages being accessible, probably a few days later. If it's not too complicated I would welcome an option to exclude protected pages from being found. If I lock a room for a reason I don't want anyone to sneak in through the window
    1 point
  22. The parent of the PageTable pages must use a template that the editor has "add children" permission for.
    1 point
  23. Sure, it's just a little weird though as $loginForm should work everywhere in regular templates - at least it has in my testing. No problem here - would you mind doing a little testing in the isProtected() function to see where it might be failing. Is $pagesToCheck including the parent which is protected? Is $this->matchedParent being populated with this page? etc This module is designed to protect access to pages - I am not sure that it should actually prevent pages from being found. I am happy to revisit though if you think otherwise - it should be easy enough to do.
    1 point
  24. Thanks a lot everyone :). It seems that PageTable field type is what I was looking for. It amaze me so much that it is included in the core, just a click away The Repeater Matrix looks amazing but I haven't got the budget yet to buy the proModules, although I can't wait to try them out, expecially the FormBuilder seems a huge timesaver! I have few questions regarding the PageTable field type. Is it possible to hide from the user (in the page tree) the folder I use for containg the PageTable sections? It seems that if I restrict access to the containing template the user can't add new pages anymore. How do I prevent PageTable sections from being accessibile in the front end? Should I just unpublish the containing folder and I should still be able to fetch the data right?
    1 point
  25. Ryan, it looks really great indeed! A great improvement on the theming capabilities! Looking forward to create a dark theme on it!
    1 point
  26. You can certainly do it using page tables or the profield matrix, but often people don't like the UX of those fields to much for this use case. But it's the best we've got for that kind of content – and seeing that silverstripe UI I think it's not so much a problem for you.
    1 point
  27. As everyone else has stated, The repeater Matrix has a much better UX than page tables. You can rearrange sections and add multiple "blocks" of the same template to the table. I have just started testing it, and so far I am enjoying it.
    1 point
  28. To the recently added staging bar. In AOS for example it partly covers the sidebar so items loose hover state when you move the mouse over the bar.
    1 point
  29. <?php $entry = $page->homepage_media->getRandom(); echo $entry->video_strip_1->url; echo $entry->video_strip_2->url; echo $entry->video_strip_3->url; echo $entry->video_strip_4->url; echo $entry->video_strip_5->url;
    1 point
  30. I feel silly sorry, it works all it needs is all the dependencies specified
    1 point
  31. Thanks for the insight! Yup. I was thinking about that and will go that route now - stay tuned
    1 point
  32. It's possible to do :nth-child(n+6) on any kind of element, it's not the element that matters but the context it is in, particularly it's siblings. If you have a bunch of <picture> elements standing next to each other, then picture:nth-child(n+6) would certainly work.
    1 point
  33. If you really need Apache, you need to install it yourself via ssh. Processwire runs fine in Nginx.
    1 point
  34. I use this from time to time when I absolutely have to: http://mobiledetect.net/
    1 point
  35. Small bugfix pushed for a problem with the default marker URLs. Master branch (not namespaced) now at v2.8.1 and PW3 branch (namespaced) now at v3.0.1.
    1 point
  36. You are missing the crucial step in your hook where you check what page was saved and then decide if you want your page update code to run. You don't want that update to occur on any page save like it does now, because then it will trigger again when the updated page is saved in the hook, and so on until the cows come home.
    1 point
  37. Hi, uhm, actually I don't believe there is much to improve regarding the aspect of "many tables": To check if an object is currently at the top - the computer has to iterate over the many candidates sooner or later anyway? Could somebody comment on this so I can check whether my logic is faulty ;P Yet what certainly can be improved: highly recommended: debouncing / throttling: https://davidwalsh.name/javascript-debounce-function if you don't know about that already. ... and of course the actual calculation of the distances can be improved ... but I don't have something fancy at hand right now ... but I enjoy looking at code and think about what could be improved
    1 point
  38. Check document.getElementFromPoint(point close to top) if it's in one of your tables and either check only that one's scrollTop or see if it is not inside the thead?
    1 point
  39. Here are some of the pre-configured cassette ui players:
    1 point
  40. Around line 672 when checking template files you could add the $config->templateExtension too, eg. if (!$item->isDir() && in_array(pathinfo($item, PATHINFO_EXTENSION), array(wire('config')->templateExtension, 'php', 'inc'))) { This allows selecting twig/latte/etc files from the module settings. However I'm still trying to figure out why $loginForm is not available for me (using Latte). Surely it's something in my code, but any chance to add $loginform to page, etc. $this->wire('page')->loginForm = $loginForm (before line 291)? This would allow using the form anywhere in the selected template. I'm using this now and it's working fine.
    1 point
  41. Admin styling: adding "pointer-events: none" could be useful I think.
    1 point
  42. Just for informations - on my test installation, your dump is imported successfully. Apache/2.4.23 (Win64) PHP/5.6.25 libmysql - mysqlnd 5.0.11-dev - 20120503 Extension PHP : mysqli curl mbstring Version PHP : 5.6.25 Version MySQL : 5.7.14 Version PHPMyAdmin : 4.6.4
    1 point
  43. You are right! Fine now! Thanks!
    1 point
  44. Just to clarify, I'm not working on the core image field, I only work on the CroppableImage Modules, to make them work with the new core Imagefield in PW3. It will inject a small section with buttons into the head of the edit area, like here, (predefined Crops) The buttons will open a modal editor window. The editor window should get some new styling. Thats it. And this only is possible because of the sponsoring through DREIKON, who are so kind to donate 500+ Euro for my work on this, what is much appreciated. Otherwise I wouldn't be able to invest the needed time for it, atm. Current state is: injection works, modal open and close works, rearanging / styling of the editor window needs to be done, testing needs to be done.
    1 point
  45. Thanks OLSA, that was it, I had left html purifier enabled. I still think that done this way is not how it should be. It shouldn't require any tweaks to extra allowed content. But I will continue playing with this and see if I can make it work without extra allowed content. Also maybe using the Semantic version of embed plugin would work better and be more markup agnostic. I will test that also.
    1 point
  46. Maybe this helps someone. Nerd alert! Currently building a shop module for a project, where I was looking for a easy way to handle/store form data in session and later repopulate it easily using form API. It can be very tedious to do that manually grab the fields, store in session repopulate form. So I found a way to do it "automatically" by serializing form object and build a name => value array that I store in session, then retrieve the array later and convert it to WireInputData as it is required for form object to process. Further I needed to turn of CSRF temporarely to get around error when populating the form object. Here a example code for those interested. // generate $form // when sent if($input->post->send) { // process form $form->processInput($input->post); // if no errors if(!count($form->getErrors())){ // serialize form values and store in "shop" session namespace $formfields = $form->getAll(); $formdataKeys = $formfields->explode(function($item, $key){ return $item->name; }); $formdataValues = $formfields->explode(function($item, $key){ return $item->value; }); $formdata = array_combine($formdataKeys, $formdataValues); $session->setFor("shop", "userformdata", $formdata ); $session->redirect("nextpageurl"); } } else { // if session formdata found repopulate form object if($formdata = $session->getFor("shop", "userformdata")){ $formdataInput = new WireInputData($formdata); $form->protectCSRF = false; // to not get a CSRF validation error $form->processInput($formdataInput); // fills in form and validates it $form->protectCSRF = true; } } return $form->render();
    1 point
  47. Hi Macrura, I've just done something similar to this for my current project. I needed to add data-start-time attributes to every option in a select dropdown so I decided to extend the InputfieldSelectMultiple class to provide a replacement addOption() implementation that added the required data attribute as part of the internal attributes array for each option. Here's what I did... public function addOption($value, $label = null, array $attributes = null) { if ( is_null($value) || (is_string($value) && !strlen($value)) ) { return $this; } if (null === $attributes) { $attributes = array(); } $extra_atts = $this->extendAttributes($value, $label); $attributes = array_merge($attributes, $extra_atts); return parent::addOption($value, $label, $attributes); } public function ___extendAttributes($id, $value) { $atts = array(); /** * Either hook this method to do what you want or implement things directly if this * is the only use of this Inputfield. * For your example you'd grab the fields you want from your page and put into data * attributes... */ //$page = wire()->pages->get($id); //$atts['data-description'] = $page->description; return $atts; } I've updated the example above to output data-description. Hope that helps you with some ideas!
    1 point
  48. This is awesome Ryan! I actually used your snippet below and modified it to do what I needed and it worked perfectly, Just took me longer to create the temp field .. foreach($mypages as $p) { $p->of(false); $p->image->description = $p->temp; $p->save(); } Your above snippet is definitely a time saver and has been added to my library. It works perfectly when I tested it. I just had to modify it slightly to meet my needs. I would just like to say your willingness to bend over backwards to assist others in this forum is a true judgement of your character. You and several others go above and beyond to help others learn with examples. One in particular I would like to mention who helped me way beyond my expectations was Nik. Just like you, he took the time to break things down with examples and even explanations. How you both manage to find the time, I do not know. To you, Nik and all the others who help us learn everyday, I thank you sincerely for helping us. I am confident I am speaking for others as well and say that ya'll truly make a difference to those of us following in your paths.
    1 point
  49. Strangely, I was looking this up yesterday! Doesn't that limit characters? If you want to do words: $text = implode(' ',array_slice(str_word_count($post->summary,1),0,$maxpostlength)); Where $maxpostlength is the number of words and $post->summary was the field I wanted to truncate.
    1 point
  50. Well deleting the original will leave you with a problem as you already know It would be relatively easy to script a batch resize all original images and run that once over all page that has images. Use the ImageSizer class. Working example: $pa = $pages->find("template=basic-page,images.count>0"); foreach($pa as $p){ foreach($p->images as $i){ $ImageSizer = new ImageSizer($i->filename); $ImageSizer->resize(120,0); } } It will resize all the original images to 120x*. And you're done. (This particular example show how cool the on-page images are.)
    1 point
×
×
  • Create New...