Jump to content

Leaderboard

Popular Content

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

  1. Exactly what I was going to write, but you were quicker. I think we should put an emphasis on accessibility when creating this new admin theme. Not just only color contrast but also regarding keyboard-only usage and usage with assistive technologies like screen readers. Creators of WordPress and Drupal already aim for ATAG (Authoring Tool Accessibility Guidelines) compliance, e.g. here and here and ProcessWire should do so as well Although I'm no professional in this topic I'd love to help with audits and Pull Requests.
    10 points
  2. Looks very clean and sleek. I'm a little concerned the default UIkit styling of some components takes the minimalist aesthetic a bit too far. There's a point where the visual metaphor breaks down and usability suffers. Take the 'tabs' component... In the first screenshot it is much more obvious: that it will respond as a tabbed interface as opposed to some other type of navigation which tab is active which parts of the page are contained within the area the tab navigation controls (e.g. you can see that the "Save" button is outside the tabbed area). Edit: I realise that UIkit will only provide the foundation styling for the admin and will be customised for use there. So this is more just an observation about the decisions made by the UIkit designers rather than something that will be a problem for the finished PW admin theme.
    7 points
  3. 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/
    6 points
  4. Having a proper front-end framework power our.. umm, back end.. is a great idea. While keeping dependencies as low as possible makes sense and has, in my opinion, proved out to be a great strategy so far, this is one of those cases where an outside component just plain makes sense. My hope is that this will also simplify the workflow for module authors trying to match the look and feel of existing admin theme(s). Currently you basically have to target a certain admin theme, and even then you'll probably end up inventing a few UI features / components of your own. Not a very good situation for providing a consistent experience for end users Have to agree with @Robin S. I enjoy simplicity as much as the next guy, but the default tab component in Uikit is just plain bad in terms of both usability and accessibility. Another thing that slightly bugs me in current design (which we probably shouldn't be commenting on, considering that it's obviously not the final one) is the low contrast: that's a really common mistake in terms of accessibility, but luckily it's also really easy to fix.
    6 points
  5. @Oliver, @bcartier Thanks guys. Glad you like it. No, Language fields are not supported yet. There will be support for them too. Maybe I will implement them this weekend. In any case I will let you know when they are available. For those who are following this module, I make releases almost everyday. Sometimes I introduce new bugs but patch them as soon as I find them. There are bunch of features added since the first introduction. You can follow up the changes/additions in the changelog. Lots of parts are not documented yet but I will provide full documentation and possibly introduction video targeted to ProcessWire users, on what the module is about, how you can use it, along with some todo app tutorial. But for now, feel free to play with it and provide some feedback either here or in issue tracker. It is always easier to make changes in the beginning.
    5 points
  6. @Juergen I have used this module with ProcessWire's translation capabilities with no problems! And actually, forgot to mention that on my previous post. Once upon a time, a client wanted to control the contrast of their b&w converted image, so with the help of @horst 's PIM 2 module and RuntimeMarkup I was able to quickly setup a "thumb preview and edit" button. All buttons and text were in spanish and english.
    5 points
  7. If I understand the issue correctly, you can just add the image and then get the image name by getting the last added image. no need to clean the name - just let PW do it when you ->add() it. I do the same thing here: https://github.com/adrianbj/ProcessMigrator/blob/0dbeacdf4d1d4a8060d1d513ca9cb2eced3e540a/ProcessMigrator.module#L2577-L2595 As you'll see further up in that function - I am using virtually the same code as you for extracting external images from HTML, importing them locally and setting the new URL in the HTML.
    4 points
  8. cool - yes, thanks almost have this working using your examples!, will post final code once it's tested... Edit: this is the new improved version for specific usage; could be improved a lot (basically copy the migrator code), with the try/catch in case the external image can't be retrieved, and also allow for some additional checks for image field, RTE field; for most applications i can just add this to my SiteUtilities module and enable it for some specific templates and fields... public function importExternalImages($event) { $page = $event->arguments[0]; $html = $page->body; if (strpos($html,'<img') === false) return; //return early if no images are embedded in html $dom = new \DOMDocument(); $dom->loadHTML(mb_convert_encoding($html, 'HTML-ENTITIES', 'UTF-8')); $images = $dom->getElementsByTagName('img'); if(!$images->length) return; // not needed? $assetsPath = $this->pages->get($page->id)->filesManager()->url(); $extCount = 0; foreach ($images as $image) { $img_url = $image->getAttribute('src'); if(!filter_var($img_url, FILTER_VALIDATE_URL)) continue; $page->images->add($img_url); if($image->getAttribute('title') != ''){ $page->images->last()->description = $image->getAttribute('title'); } elseif($image->getAttribute('alt') != ''){ $page->images->last()->description = $image->getAttribute('alt'); } //resize image to make version to match the size originally in the RTE //check to make sure size is different to downloaded version before resizing if($image->getAttribute('width') && $image->getAttribute('width') != $page->images->last()->width) { $imgForRte = $page->images->last()->size($image->getAttribute('width'), 0); } else { $imgForRte = $page->images->last(); } $image->setAttribute('src', $imgForRte->url); $extCount++; } if(!$extCount) return; $page->of(false); //$page->body = $dom->saveHTML(); $page->body = preg_replace('/^<!DOCTYPE.+?>/', '', str_replace( array('<html>', '</html>', '<body>', '</body>'), array('', '', '', ''), $dom->saveHTML())); $page->save('body'); $this->message("image links updated to local images."); $page->save('images'); $this->message("external images imported to page"); } thanks again for your help and advice!
    3 points
  9. @tpr - I am attaching a new version of the module which rejigs things a bit. It now lets you do: if($page->protected()) { It returns false or the id of the page that is protecting the checked page, which could be itself, or the closest protected parent. This should let you handle your search results however you want. I thought about automatically removing protected pages from results, but I think there are just too many contingencies to do it this way - I think it makes more sense to let the dev handle it via protected() Please let me know how this goes and also if it by chance fixes your issue with child pages not being protected. PageProtector.zip
    3 points
  10. Thanks to UIkit 3 being hookable, it is really easy to change the look of any componenets: https://getuikit.com/docs/less#use-hooks Even this is supported: "Should there be neither a variable nor a hook available, you can also create your own selector. ... This will sort your new selector to the right place of the compiled CSS file."
    3 points
  11. 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)
    2 points
  12. Thanks! Search results I can easily exclude the protected pages now but I guess there's no way I could exclude them in the initial $pages->find() query, where search results are populated. This leads to improper number of results if I exclude pages when outputting the results list, or if I filter them in memory beforehands then pagination will broke. This is no surprise because $page->protected is not a page field so I cannot use "protected=''" in the selector. I've tried using addHookProperty but $pages->find() doesn't respect that ($page->protected worked fine though). Anyway, I can live with it - but please correct me if I'm missing something. Child pages In case of child page protection I found that if I set no template in the module settings, then the protected child page loads with the loginForm, which is the expected behaviour. This unfortunately doesn't fit my current needs because I would prefer only one login page for members, so that's why I do a redirect: if ($page->id !== $memberLoginPage->id && $page->protected() && !($user->isSuperUser() || $user->hasRole('member'))) { $session->redirect($memberLoginPage->url); $this->halt(); } Would it be possible to have an option under "Protect child pages" like "Redirect to protected parent on direct access"?
    2 points
  13. thanks again - i learned a lot from studying the migrator as well as your other modules... I'm surprised this hasn't come up before, as i would think it quite common for clients to paste in HTML to the editor with external image references; My one client was totally confused because they would paste in these reviews with all of the images, not realizing the images were being pulled from external sites, and then they couldn't click the images in the editor;
    2 points
  14. I'd imagine ProcessWire should run on any Linux derivate available to EC2, but may I ask, why you want specifically EC2? DigitalOcean or Linode do charge similarly and are way easier to setup than aws (with all it's enterpricy setup tools and permission hierarchies and stuff). I always feel people preemtively reach for EC2 even though they don't need all the things which make aws great over other services in the first place.
    2 points
  15. The hook needs to be in /site/init.php, not /site/ready.php
    2 points
  16. This is a fantastic module! Thank you Nurguly! Does this handle Language fields yet? For example, I have translated titles, summaries for an "article" template, and I've allowed the article template, along with the "title" and "summary" fields in the module settings, but the the translatable fields are still not available through GraphiQL, even though the other non-translatable fields are.
    2 points
  17. Another option: $Events = $pages->get('/Events/')->Events_repeat->slice(-3);
    2 points
  18. Yes, it depends. Perhaps only its title should be findable though I guess this adds another level of complexity. Does the module add a page property eg isProtected to let devs handle this? Sorry I can't look into the code atm. What's more important imo is to exclude child pages from search, if they are also protected. Perhaps the abovementioned isProtected property could help here too.
    2 points
  19. 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>"; } });
    2 points
  20. @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!
    2 points
  21. I'm working on a module that scans the textarea field and imports external images, and replaces the reference to them in the editor with the local version. This is the function that is hooked after Page save. Mods: http://modules.processwire.com/modules/import-external-images/ Github: https://github.com/outflux3/ImportExternalImages
    1 point
  22. 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
    1 point
  23. On the parent page template, if you select a single allowed template for children and specify a "Name format for children" then the first step of the "Add New" page process should be skipped. To set the name the core name format setting might be sufficient, or you have more options with kixe's module, or you can use your own hook: $this->pages->addHookBefore('setupNew', function($event) { $page = $event->arguments('page'); if($page->template == 'my_template') { $page->name = 'some-name'; } });
    1 point
  24. It does sound like a bug that needs fixing, but just wanted to add that you can get an equivalent of httpUrl in a way that respects the slash settings with: $page->url(['http' => true]);
    1 point
  25. Thanks @szabesz. I just wanted to post to forums to get some feedback before I fill a bug report on github.com.
    1 point
  26. Try using $Events->reverse() in your foreach loop.
    1 point
  27. Apache and Nginx are both individual webservers, but only apache is supported officially by processwire. EC2 is from a plain server pov not different to other virtual server providers, but aws does have a lot of privacy / access rulings around all it's services, which is (or at least can be) super complicated for simple setups. That's why I think one should only use aws if one does need aws. I'm not sure how much knowledge you have about setting up your own servers, but if you're not quite comfortable with it I'd suggest you not doing it for any production work. If a simple shared hosting would be enough I'd charge the client a good amount extra for the hoops of setting up a virtual server in the first place. It's not only the time spent, but also the responsibility coming with setting up anything on your own. If you still want to roll with it I'd suggest you the tutorials over at digital ocean (initial setup / lamp setup) and using ubuntu. Ubuntu is the most used system out there and the digital ocean tutorials are quite well written and not really dedicated to their service per se. And just a suggestion about your "cloud loving" client. You might take a look a PaaS like heroku, which is as cloudy (in terms of scalablity/on-demand hosting) as aws, but a lot simpler to setup.
    1 point
  28. Without any rude intentions: If you can't get ProcessWire to run without docker on EC2 you shouldn't try to add docker to the game as well. It's only going to get more complicated and error prone.
    1 point
  29. @Nurguly Ashyrov I really like what you do here! So much fun to see this. Unfortunately I have no time ATM to start playing / using it. (buhuhh, - schnüff)
    1 point
  30. I completely agree - subtle stuff like this makes all the difference in letting you know how something will behave!
    1 point
  31. 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
  32. 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:
    1 point
  33. Those links are for Profields Table, which is a different thing than PageTable. PageTable is an installable module in the core but there's no formal documentation for it. Repeater Matrix has a friendlier UI in that you can see all your content in Page Edit without having to open modals for each 'block'.
    1 point
  34. Ryan, it looks really great indeed! A great improvement on the theming capabilities! Looking forward to create a dark theme on it!
    1 point
  35. How about hooking InputfieldPageTableAjax::checkAjax (and/or probably InputfieldPageTable::renderTable) and skipping all that hackish jquery?
    1 point
  36. 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');
    1 point
  37. If you don't do custom cropping (art direction) for your image-sizes you don't need the picture element. Using srcset/sizes is enough. Also you might want to look up the correct usage of nth-child as it's nothing you add in html, it's css. Syntax like yours does not exist in html (even if some js frameworks try otherwise).
    1 point
  38. 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);
    1 point
  39. I thought of another option around this: you could give the 'module-admin' permission to the role, and then use a hook to check which module is being requested and only allow access to a particular module. $this->addHookBefore('ProcessModule::executeEdit', function($event) { if(!$this->user->isSuperuser() && $this->input->get->name !== 'MarkupSEO') { throw new WirePermissionException('You do not have permission to configure this module.'); } }); Now you just need to create a custom link in admin to the module config page, maybe using a simple Process module. Or I think AdminOnSteroids lets you add custom menu items - haven't tried it myself.
    1 point
  40. You are right! Fine now! Thanks!
    1 point
  41. Sure, losing functionality is not good. Elsewhere I proposed a separate button for the cases where you want to add multiple templates. However, in terms of the total amount of convenience for the total number of users, I think the times you want to add fields and other settings immediately after adding a new template much outnumbers the times you want to add multiple empty templates and then end up back at Setup > Templates.
    1 point
  42. Thank you @Werner Pilnei. I am excited because I like using ProcessWire . I try to do my best in introducing this module to the community. GraphQL is very young standard and is not mainstream yet. I intentionally started this thread in the Pub section, to make sure this is not a module support page but more a discussion on GraphQL (as this new api standard by facebook) and ProcessWire. To talk about how they could fit with each other, what ways we could use it, the new ways to use ProcessWire and so on. I personally never think about ProcessWire as a CMS. Though it is in fact a true CMS in its literal meaning, it is best at managing your content. But when people are introduced to ProcessWire it is presented as CMS and since the web is cursed by WordPress, people start using ProcessWire with wrong assumptions in their minds which result in negative impressions. I am generalizing here but when an average web developer hears CMS, she thinks it is a ready website with bunch of functionality baked in like tags, searching, blogging, commenting and so on. Those functionalities become the evaluation criteria and when they see that there is no tags in ProcessWire they count that as one of the things ProcessWire is missing. They don't understand that tags are something ProcessWire shouldn't have, because they are used to see tags in a CMS. I don't think that I am telling something new here. The community is well aware of this problem and the release of new site profile states that these problems are being addressed. But it doesn't have to be the only way. The modular architecture of ProcessWire allows us to extend it anyway we want, and this module is one of those attempts in presenting ProcessWire in different perspective. Even if it won't make much difference, I think we should keep trying and experimenting. Who knows what could come up along the way. I was only thinking about SPAs when creating this module. Never thought of PWA and usage with service workers like you approached it. Which is, by the way is great to hear. I hope there will be bunch of other ways people use it.
    1 point
  43. Just a quick by the way, I recently updated the first post in this thread to state that the wireRenderFile() approach is the recommended way to use this module. I'll update the README too when I get the time.
    1 point
  44. After trying several SaaS options I've settled with StatusCake (referral) for a year now. They offer free unlimited servers. You can receive an e-mail free (or use several third party integrations) or text (costs a little like 25$ for 100 credits). The only drawback is that you can't select from which location you want to check and you might find the 5 min interval too slow. But hey: it's free Right now I'm thinking of upgrading to get additional 1 minute checking, Locations, SSL Monitoring and Page Speed tests for 20$ a month.
    1 point
×
×
  • Create New...