Jump to content


Popular Content

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

  1. 5 points
    This is the new topic for the Settings Factory module (formerly known as Settings Train). Repo: https://github.com/outflux3/SettingsFactory I'm not sure what versions this is compatible with, it has only been tested on 3.x branch; it is not namespaced, and i'm not sure if namespacing is necessary or a benefit for this module; if any namespace or module gurus can weigh in on this, let me know. I'm also not sure if there needs to be a minimum php version; I have one live site using this now and it's working great; But before submitting to mods directory, would be better if there was some additional testing by other users.
  2. 3 points
    Hi Marc Much prefer this name - makes more sense. Will test it out (functionality-wise) today. You don't need to namespace it if you're maintaing compatibility with PW-legacy. I don't namespace my module files, but only everything outside of them. For example, Typographer uses two namespaces: Rockett and Typographer, both of which are imported via the PW class loader. Everything should work fine in legacy, so long as you don't use any features that are only available after 3.0.62 as legacy will probably only be brought up to speed when the next 3.x stable comes out. In terms of PHP compatibility, I make it a rule to support only 5.6+, as it is currently the oldest version with security support. With that said, my phpfmt (mentioned below) is configured to use PHP 5.4-style arrays. Some other recommendations from my side: Be consistent with spaces/tabs. Tabs are generally frowned upon on the PSR side of things, but it's really up to you, provided it's consistent. I use four spaces for indentation, and I also use phpfmt in Sublime to automatically format my code. in processForm(), you're pulling in the page title within the walls of a translation helper. As far as I know, this doesn't work, so you'll need to use sprintf to import the page title: sprintf($this->_('Saved: %s'), $this->wire('page')->title) wire is imported into the Process, so can use $this->wire(…) everywhere that doesn't have a static scope, instead of the wire() helper. Hope that helps. 😊
  3. 2 points
    By strange coincidence, I was just thinking that maybe PW should have a standard EditorConfig file as part of the suite. Whilst it does not address all of the code styling issues raised above, it would allow us to all get the tabs/spaces/line endings/whitespace trimming right for this project by just using an editor that either supports EditorConfig out of the box, or via a plugin. I've started using it on my current project and it seems to work quite well.
  4. 2 points
    @SamC I a using LiceCap to create screen animation. It works under OSX and Windows.
  5. 2 points
    ==UPDATE== I did this in the end using a single 'blog-entry' template. I have the structure: post 1 post 2 post 3 - post 3.1 - post 3.2 post 4 post 5 My menu is now in an include file: <?php namespace ProcessWire; ?> <?php // check if menu needs to be rendered before getting PageArrays if ($page->template == "blog-entry" && $page->parent->template == "blog-entry" || $page->template == "blog-entry" && $page->hasChildren()): // children of complete-guice parent if ($page->template == "blog-entry" && $page->hasChildren()) { $entries = $page->and($page->children); } // children of complete-guide parent elseif ($page->parent->template == "blog-entry") { $entries = $page->parent->and($page->parent->children); } ?> <ul class="list-group"> <?php foreach($entries as $index => $entry): // apply 'active' for current page $currentClass = ($page->id == $entry->id) ? "active" : ""; // change the parent blog post page title to 'Summary' $title = ($index == 0) ? "Summary" : $entry->title; ?> <li class="list-group-item <?= $currentClass; ?>">Page <?= $index + 1; ?>:&nbsp;<a href="<?= $entry->url; ?>"><?= $title; ?></a></li> <?php endforeach; ?> </ul> <?php endif; ?> ...and to output it at the top of a blog post. Only shows if the page has children: // blog-entry.php <?php namespace ProcessWire; ?> <?php include("./includes/multi-page-menu" . ".php"); ?> <div class="container py-5"> <div class="row justify-content-center"> <div class="col-lg-9"> <?php if($page->bodyRepeater): ?> <?= $page->render("bodyRepeater"); ?> <?php endif; ?> </div> </div> </div> <?php include("./includes/multi-page-menu" . ".php"); ?> ...with structure: ...renders: Only need one template now for anything that is a blog post whether it's a single page or has children. Now I can use the family settings properly without having to choose a template when Adding New > Blog Post. I'm quite a big fan of these settings.
  6. 2 points
    Module works amazing. In my case, I needed to show the fields only if the page does not have a parent of a certain template (as the child pages simply display the parents fields on the webpage), selector: parent.template!=complete-guide ...and the out the box options only allows for fields on the same page. Thanks @Robin S
  7. 2 points
    Hi @kongondo, I purchased VPS this afternoon and have been having an explore of it. As always with your modules, it's impressive stuff! A question: is it possible to customise the columns that are shown in the inputfield list view? So if we're not using Tags but want to show some other custom field from the page can we show that? It would be really useful if we could. I want to give some feedback on some aspects of the appearance and workflow, and I mean this to be constructive so I hope it comes across that way. It's awesome what this module can do and it's obvious how much work you've put into it. It's just lacking a bit of the polish and attention to detail that I would expect from a pro/commercial module at this price point. 1. It would be nice if the Process module installed the Inputfield module ("installs" option in getModuleInfo) so it was just a one-step installation process. 2. Rather than users needing to type the name of the image fields used for thumbnails, could you change to an AsmSelect that selects from existing image fields? Also, the note here needs updating to reflect that image fields allowing more than one image can now be used with VPS. 3. If the option to allow users to edit pages from the modal is enabled, the page edit view replaces the add/remove lister and there is no way to return to it. I'm wondering if this option is needed actually - I couldn't think of many cases where you would want to allow page editing within the modal that has been opened to add/remove pages from the inputfield. 4. In the inputfield list view, the Description and Tag columns do not reflect changes to those fields made in the page modal edit (the inputfield reloads, but the columns don't update). 5. The spinner is cut off in the modal. 6. The tab layout in the modal is a bit messed up. 7. The position of the actions select/button looks off too - it's crashing into the grey bar above. Also, it's not possible to interact with the select because it is behind the WireTabs <ul>. 8. In modal edit view, some text is obscured behind the WireTabs. 9. The thumbnail appearance and layout could be improved IMHO. a) Show the thumbnail uncropped, so the aspect ratio of the image can be seen. b) Remove the rounded corner styling - it can be misleading (what if you had an image that actually had rounded corners), and it isn't used consistently (list view thumbnails are not rounded). c) Use the core default thumbnail dimension of 260px height and unconstrained width. In most cases this will also make the inputfield/modal load faster because the thumbnail variation will already exist from the time the image was uploaded. The existing thumbnails are too small. d) It's a tiny bit disconcerting seeing the thumbnail scale down when the pink "selected" border is applied. Perhaps consider a different CSS styling technique such as applying the border to a transparent element in front of the image. e) The thumbnail layout breaks at some widths. Also the thumbnail label line height is too low. f) Let the thumbnail container be the natural width of the thumbnail. So all the thumbnails just float left against each other (with some white space around them), similar to the appearance of the core Images field. I tweaked the VPS code a bit to get this: The thumbnail label could potentially be removed too, and shown in a tooltip on hover (I think in most cases users select an image from scanning the thumbnails rather than the labels). Or add an option for this. 10. If pages are removed from the inputfield (but the page is not yet saved), this is not reflected when the modal is opened. The removed pages are still shown with the border/opacity styling of pages that are added to the inputfield. I guess it might be difficult to avoid this. 11. In the modal, if the "remove" action is performed on a page that is not added or the "add" action is performed on a page that is already added, the error notice could be less cryptic: There is also an overflow issue possible here, and the appearance of the notices are somewhat ugly in general: unnecessary white border and border radius, unnecessary background colour change on hover, the text needs some padding. 12. Could the actions in the modal window (add, remove, etc) be smarter to streamline the workflow? For the lesser-used actions (delete page, delete image from page) the select dropdown is fine, but it is a bit awkward for the frequent actions of adding and removing pages. How about this: VPS knows whether each page is currently added or not (hence the different styling). So for pages that are not added clicking the thumbnail marks the page for adding (a plus icon or similar is shown in the corner of the thumbnail). And for pages that are already added clicking the thumbnail marks the page for removal (a cross icon is shown). 13. Some very minor appearance things: Inconsistent text size and divider appearance for the same controls in the modal vs the inputfield. The default focus style looks awkward on the Add Pages button after the modal closes. Using a large black h3 for the "Nothing added yet" text is a bit strong. I understand if you think some of these issues are trivial, but the truth is I wouldn't be entirely happy having my clients use this module in it's current form. But with a bit of polish it will be amazing, and I want to thank you for developing it.
  8. 1 point
    Support thread for WireMail Mailgun. For bug reports, please use the bug tracker on GitHub. https://github.com/plauclair/WireMailMailgun
  9. 1 point
    Tabs 4 Life, brah! There is no more definitive authority than Richard Hendricks: (I've posted that before but could not resist) But seriously, the PW code style gets things so right. The braces style too. Some reasoned argument: https://github.com/php-fig-rectified/fig-rectified-standards/blob/master/Reasoning-Tabs-vs-Spaces.md https://github.com/php-fig-rectified/fig-rectified-standards/blob/master/Reasoning-Brace-Styles.md
  10. 1 point
    The $options are used in the PageRender module. There isn't much documentation for them apart from what is in the module file.
  11. 1 point
    I ended up turning this into a module, ProcessDatabaseRepair, though it also can also check and/or optimize the tables. So far works well, but since it interacts with database, i'd be worried about distributing the module. If anyone in particular needs such a module, let me know. It's quicker for me to use this to optimize the tables than to login to client's PhpMyAdmin and run it there; also if in the rare event described above, any table crashes, the hope is that this will fix it (yet to encounter a situation where it can be tested in that scenario, unless there is a way to force crash a table)...
  12. 1 point
    I would say the PageTable module by Ryan is close to his repeater matrix ;-) I only extended the functionality of the former.
  13. 1 point
    Sure, why not? I am using it on more than ten websites. Some of them have thousands of visitors each day, but that is not the crucial thing since the module doesn't do anything different than the PageTable module itself. It "just" renders the templates also in the admin. There can be some glitches (as this thread shows) but as long it works for you in the admin area, it will also work for your visitors ;-)
  14. 1 point
    It is currently not actively under development but I use it as it is on several sites (I guess a lot of others do so, too). So I am wondering about this line: <?php echo $page->pagetableextended->render(); ?> The parts are just pages (see PageTable docs) . So with your code you just get an array of pages and PW is so kind to show you which. What you wanna do is: <?php foreach($page->pagetableextended as $pe){ echo $pe->render(); } ?>
  15. 1 point
    I think the solution to your problem is rather simple: Set up your hooks after you check for unwanted urls.
  16. 1 point
    I haven't looked at the details here, but I wanted to mention that maybe you should be careful of the $parent_name in array check. Maybe parent->path would be safer. There is always the chance that you could end up with two pages on different branches with the same name. Also, remember that we have $input->url (instead of $_SERVER['REQUEST_URI']). What about this: if(strpos($input->url, page()->parent->path) !== false) throw new Wire404Exception();
  17. 1 point
    Oh, and just to follow up on the PHP compatibility. It's currently compatible with 5.4+. If the square array notation is changed in both files (three small occurrences in total), then it supports 5.2+.
  18. 1 point
    You're welcome. The GH editor is showing me spaces in some places, and so the indentation appears inconsistent. I wasn't actually aware of a style guide for PW (I've now seen it). I tend to stick to PSR1 and 2 along with the following configuration:
  19. 1 point
    Perhaps setting page template file in the hook or set alternative template file in admin?
  20. 1 point
    @szabesz - I'd prefer it to be inline for quick access to the information (I also think its handy for beginners). I'll add a link to the applicable page though to learn more and see the actual license text. Licenses don't often change (if at all), and it's not all that often that new ones get added to the list. The commits to their license files are only related to URLs, examples, and small fixes. Some new licenses were added, and I can easily keep track of those. But, I won't be linking it up to their repo because some licenses are just not applicable, and so they're excluded from the list. PS, as much as this is going to be a production-product that I'll maintain, it's also a 'playground' of sorts for me to learn Vue.
  21. 1 point
    Thanks. Currently, the front end displays basic information about the selected license underneath its drop-down.
  22. 1 point
    Working on some modifications with the front-end before I get to the back-end side of things. Part of the new front end has an informative process that helps you select a module license (super helpful for beginners). My question is this: Should I select MIT or ISC as the default license? They are functionally equivalent, however ISC removes redundant wording from the text, and so my inclination is to lean towards that. Thoughts?
  23. 1 point
    Tutorials are not just a bunch of examples I expect a – good – tutorial to be more than what is written in the docs, some extra info on how to wire things together, and possible gotchas to look after and how to iron them out. Sure, the UIkit docs are good but there is no guidance on where to put those components in a real site, for example. Also, what I'm really missing is the explanation of the design approach of the SASS/LESS structure (eg. how changing a variable will propagate through the components, etc..). They assume one already knows all this stuff. That is where a tutorial could come in handy BTW, I have not yet found any tutorials but I already published a site based on UIkit 3. Still, I am also interested reading/watching them if they exist.
  24. 1 point
    Thank you very much for taking the time to do this! That looks just what I need to point me in the right direction, at least I now have some hope I am starting off in the right direction. I will let you know how I get on and if I get stuck on some aspect of this I will probably be bothering you again... ! Regards - Paul
  25. 1 point
    Hi Paul, lets try to get started with a basic flow. Create a file called mytable.php in the root directory (along side the index.php file) and paste the following code : Then In your template file put the following code : Hope it get you started.
  26. 1 point
    Checking for empty value is usually enough $emptyPages = $pages->find("myField=''") // note the empty string with single quotes $filledPages = $pages->find("myField!=''")
  27. 1 point
    intercooler.js (which I may have mentioned before ) has beta support for Server Sent Events. I haven't tried SSE, but I'm a big fan of intercooler generally.
  28. 1 point
    I always look for free HTML templates or buy one for about $10. It takes me to about a day to incorporate it in PW. After that you have all fexibility of PW with a kick-ass template.
  29. 1 point
    There exist two Pro modules which will help you to build this e-commerce website. Padloper (already mentioned) and Variations : https://variations.kongondo.com (check the tutorial and the video) Also there are two good reads on Snipcart, a tutorial and a case-study - a must read even if you plan to not use Snipcart: https://snipcart.com/blog/processwire-ecommerce-tutorial https://snipcart.com/blog/case-study-ateliers-fromagers-processwire Welcome to the forum @Samk80 and good day to you
  30. 1 point
    Hi @abmcr Try: foreach($page->images->shuffle() as $image) { echo "<img src='$image->url'>"; }
  31. 1 point
    Here's a screenie of the front end:
  32. 1 point
    @The Frayed Ends of Sanity $pages->addHookAfter('LoginRegister::buildRegisterForm', null, 'changeHeader'); function changeHeader(HookEvent $e) { $form = $e->return; // setting $form->description to false, null or "" (empty string) removes it from the form; $form->description = "Header text"; $e->return = $form; } in ready.php https://processwire.com/api/hooks/
  33. 1 point
    hi @The Frayed Ends of Sanity and welcome to the forum, of course you can change it! the easiest would be some css: #LoginRegisterForm > h2 { display: none; /* or */ font-size: 14px; color: red; font-weight: normal; } you can also hook into buildRegisterForm() and remove the description of the form. you can also add a markup inputfield to your form for any other HTML you need. or you can modify the markup on the client side via JS (of course that would not be the cleanest solution but sometimes easy fixes have their place...)
  34. 1 point
    I am actually wondering if you might be better off not relying on ajax calls for each filter step. Have you considered storing all the details of all trees in a wireCache'd JSON object that you load up when the page originally loads and then filter through that in memory? I have done this before - I have 3MB of data in JSON which is cached, I make sure that data is transferred compressed (so it's only a couple of hundred KBs). The initially page load takes a couple of seconds, but after that, the filtering is instant. I think so long as you know that the data will not expand to an outrageous size, this might be a good approach. PS - Great looking site!
  35. 1 point
    I thought I'd list a few suggestions that I feel could be useful additions to the comments field. I know most of this can be done via the API, but these additions would make it easier Moderation: It would be nice if we could have role-based moderation settings. In other words, the ability to set up stricter moderation settings for less trusted user roles (roles created for new members etc), and more lenient settings for trusted members (moderators, editors). The same could be applied to the spam settings. That way comments made by trusted user roles could be automatically posted, while other roles could be checked for spam etc. Text Formatters and Inputfield Types Although I'm aware of the security implications, it would be nice to have the option to choose text formatters and the type of field, i.e plain text area or CKEditor etc for the text field. Again this could also be based on role-based settings - trusted users could use CKEditor while untrusted users could be limited to the standard plain text editor. Comments form Easier form customisation, i.e to be able to choose which fields are displayed. If members are logged in, do we need the e-mail address field showing? A simple comment box and submit button would be fine. Also, the additions made to FormBuilder regarding CSS Frameworks were great, and I'd love to see it extended to the comments form. // prepare a form for output $form = $forms->render('comments'); // in your document <head> echo $form->styles; echo $form->scripts; // somewhere in your document <body> echo $form; And voila, a UIKit comment form.
  36. 1 point
    v0.0.4 released. Adds config option to remove clone button.
  • Create New...