Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 12/26/2019 in all areas

  1. New showcase entry, for Aaron Copland, composer. https://www.aaroncopland.com/ Features Filterable/Searchable Works Listing with category, publisher, instrument, tag, keyword, or year range filtering Each work has a page showing meta data, as well as related media like audio, images, video, and related events & news. Works are cross related at various levels, as Copland would sometimes use sections of one work in other works Microdata (json-ld) for site, person, works, images, news and some events Ability to display embedded media like Spotify, Youtube/Vimeo, Getty Images, Archive.org etc. Fast autocomplete site & works search Modules used Admin Custom Files AOS Page Field Edit Links Auto Smush Batch Child Editor Custom Inputfield Dependencies Admin Comments* Secure Files Font Awesome Pro Import External Images Autocomplete for CK Editor Inputfield Selectize Simple MDE Visual Page Selector Font Icon Picker Page Field Info Page Table Extra Actions Pages 2 PDF Changelog Dashboards Process Documentation Settings Factory Restrict Tab View Selectize Template & Field Tags Prev/Next Tabs Text Input Awesomplete Get Video Thumbnails Ion Rangeslider Runtime Markup Config Form Inputfield Color Inputfield Field Descriptions Extended Cookie Management Banner ProCache Lister Pro Profields (Table mostly) FormBuilder Various custom modules *Admin Comments is a module in development that enables site admins/editors/managers to add comments to pages in the backend and to optionally notify other site admins/editors/managers. Possibly to be released in directory soon.
    4 points
  2. sure - i can definitely post a tutorial on how that is put together, will post soon..
    3 points
  3. sure, here is the page table; the fields on any given section are just like title, headline, body, images, page select, section options etc, plus "section type". Some sections have no configuration. The slider section allows the user to select which slides to show; the slides themselves are stored in a central media library, and the settings for any slide are stored with the media item. Sections with images have a field to select the media item to use for the image, or upload an image. For a site like this, every image needs to be cleared and licensed, so the media library provides that functionality, with fields for license type, photopgrapher, sources etc. I'm not using the MicroContexts on this site; that module is now called "Page Field Contexts", and it enables template contexts based on Page Field values. It's a super simple, yet effective module and I'm using it on several sites. https://github.com/outflux3/PageFieldContexts
    2 points
  4. I created an issue on github for this https://github.com/processwire/processwire-issues/issues/1058
    2 points
  5. Sure! In terms of the visual/layout stuff, this is the first or 2nd site I did with UiKit, switching from mostly using Bootstrap. I ended up using a lot of the built in UiKit features, it really made the experience of doing the front end a lot easier and provided a lot of the inspiration for how stuff was setup. In terms of the api/php, there is a theme module which handles basic theme/template related stuff, and a meta module which handles all of the meta elements in the head (page titles, descriptions, open graph, schemas etc.); It amounts to a frontend api, inspired by the pw api. I can go into further detail soon... In terms of how the site's page content is managed, every content page is using simple PageTable with configurable sections as the page table rows. the most challenging part of this site was the works database and the way the works relate together at various levels... It also took the content editors over a year to proof the works listing. The events were also a lot of work; Those pull in automatically from the publisher's webservice using SOAP...
    2 points
  6. MarkupMenu is a markup module for generating menu trees. When provided a root page as a starting point, it generates a navigation tree (by default as a HTML "<ul>" element wrapped by a "<nav>" element) from that point onwards. If you've also provided it with current (active) page, the menu will be rendered accordingly, with current item highlighted and items rendered up to that item and its children (unless you disable the "collapsed" option, in which case the full page tree will be rendered instead). Modules directory: https://modules.processwire.com/modules/markup-menu/ GitHub repository: https://github.com/teppokoivula/MarkupMenu Usage As a markup module, MarkupMenu is intended for front-end use, but you can of course use it in a module as well. Typically you'll only need the render() method, which takes an array of options as its only argument: echo $modules->get('MarkupMenu')->render([ 'root_page' => $pages->get(1), 'current_page' => $page, ]); Note: if you omit root_page, site root page is used by default. If you omit current_page, the menu will be rendered, but current (active) page won't be highlighted etc. A slightly more complex example, based on what I'm using on one of my own sites to render a (single-level) top menu: echo $modules->get('MarkupMenu')->render([ 'current_page' => $page, 'templates' => [ 'nav' => '<nav class="{classes} menu--{menu_class_modifier}" aria-label="{aria_label}">%s</nav>', 'item_current' => '<a class="menu__item menu__item--current" href="{item.url}" tabindex="0" aria-label="Current page: {item.title}">{item.title}</a>', ], 'placeholders' => [ 'menu_class_modifier' => 'top', 'aria_label' => 'Main navigation', ], 'include' => [ 'root_page' => true, ], 'exclude' => [ 'level_greater_than' => 1, ], ]); Note: some things you see above may not be entirely sensible, such as the use of {menu_class_modifier} and {aria_label} placeholders. On the actual site the "nav" template is defined in site config, so I can define just these parts on a case-by-case basis while actual nav markup is maintained in one place. Please check out the README file for available render options. I'd very much prefer not to keep this list up to date in multiple places. Basically there are settings for defining "templates" for different parts of the menu (list, item, etc.), include array for defining rules for including in the menu and exclude array for the opposite effect, classes and placeholders arrays for overriding default classes and injecting custom placeholders, etc. ? MarkupMenu vs. MarkupSimpleNavigation TL;DR: this is another take on the same concept. There are many similarities, but also some differences – especially when it comes to the supported options and syntax. If you're currently using MarkupSimpleNavigation then there's probably no reason to switch over. I'd be surprised if someone didn't draw lines between this module and Soma's awesome MarkupSimpleNavigation. Simply put I've been using MSN (...) for years, and it's been great – but there are some issues with it, particularly in the markup generation area, and it also does some things in a way that doesn't quite work for me – the xtemplates thing being one of these. In some ways less about features, and more about style, I guess ? Anyhow, in MarkupMenu I've tried to correct those little hiccups, modernise the default markup, and allow for more flexibility with placeholder variables and additional / different options. MarkupMenu was built for ProcessWire 3.0.112+ and with PHP 7.1+ in mind, it's installable with Composer, and I have a few additional ideas (such as conditional placeholders) still on my todo list. One more small(ish) difference is that MarkupMenu supports overriding default options via $config->MarkupMenu. I find myself redefining the default markup for every site, which until now meant that each site had a wrapper function for MarkupSimpleNavigation (to avoid code / config repetition), and this way I've been able to leave that out ? Requirements ProcessWire >= 3.0.112 PHP >= 7.1.0 If you're working on an earlier version of ProcessWire or PHP, use MarkupSimpleNavigation instead.
    1 point
  7. After building the ProcessMentions module and another autocomplete module for images, I found that I am going to need even more of these, but things were going to get repetitive. So I refactored the whole thing into a basic autocompletion module and individual "actions". The result is Autocomplete for CKEditor (GitHub). To try out, Install the module and actions Enable actions in the settings of any CKEditor field Edit a page with this field, type "@" and some characters for the and enjoy There are still a few things I need to implement. ATM, it only supports single characters as triggers for the autocomplete. I'd like to change that to combinations so I don't run out of special characters at some point. I also have to add a few more configuration options (like search only at the beginning or also in the middle of the searched string). The documentation for custom styling also needs some work. I have tried to keep things generic. Implementing your own actions should be quite straight forward. The README at GitHub illustrates the main steps and the supplied action classes have inline documentation. I would love to get some feedback or even see some third party InlineCompleteAction implementations.
    1 point
  8. When I installed Processwire for the first time, I noticed that Admin sessions were not lasting for a long time and it was very common to be logged out. Reading this forum I found useful information, but I could not solve this issue. I tried to modify site/config.php adding $config->sessionExpireSeconds with different values, but without success (for your awareness sessionExpireSeconds default value is 86400 seconds, ie 1 day .. so quite enough!). OK, I had no time to go deeper, so I kept doing what I had to do ... being happily logged out … time to time. Few weeks later while studying Session.php in wire/core/ I got the hint (please read the commented text) which helped me to understand how to solve it: if(ini_get('session.save_handler') == 'files') { if(ini_get('session.gc_probability') == 0) { // Some debian distros replace PHP's gc without fully implementing it, // which results in broken garbage collection if the save_path is set. // As a result, we avoid setting the save_path when this is detected. } else { ini_set("session.save_path", rtrim($this->config->paths->sessions, '/')); } } Uh! Yes, my VPS uses Debian 9 ! So I quickly did a test: echo ini_get('session.gc_probability'); echo ini_get('session.gc_divisor'); echo ini_get('session.gc_maxlifetime'); The session.gc_maxlifetime was rightly set to 86400, but session.gc_probability was 0 ! As you can easily get from Session.php routine, if probability is 0 bye bye PHP's session garbage collection and of course PW will not set the save_path. But why probability is set to 0 ?? This is due to the fact Debian/Ubuntu Linux overrides standard PHP’s session garbage collection by setting session.gc_probability to 0. As a consequence PHP’s standard session garbage collection will never run. Instead Debian/Ubuntu sets a specific Cron job for garbage collection with a duration of 1440 seconds, ie 24 minutes. This determines the max session duration. If you try to change session.gc_maxlifetime through $config->sessionExpireSeconds=86400 or ini_set('session.gc_maxlifetime', 86400) it will have no effect and sessions will be deleted at intervals of 24 minutes (or within 54 minutes). The Cron job garbage collection duration is defined at php.ini level, and runtime changes to session.gc_maxlifetime will not affect the Cron job timeout. Uh! Of course the simplest solution would be to change session.gc_maxlifetime in php.ini. However sometimes this is not possible (shared hosting). Another point to consider is that this change may affect multiple applications running on your server. Instead of modifying php.ini, personally I preferred to enable PHP's session garbage collection locally for Processwire only. Majority of the code is already written in PW Session.php, we have just to take benefit of it. Let's go step by step. Let's open site/config.php and do the following modifications (I choose to implement 14400 seconds session time, ie 4 hours): /** * Reduce inactivity timeout (original 86400 = 1 day) * How many seconds of inactivity before session expires */ $config->sessionExpireSeconds = 14400; /** * Enable Session Garbage Collection * Garbage Collection is disabled in Debian as default (probability set to zero) * Enable session garbage collection with a 1% chance of running on each session_start(); * Chance calculated as gc_probability/gc_divisor * Session path is defined inside wire/core/Session.php and points to site/assets/sessions * Thanks to this modification session now takes into account gc_maxlifetime set in config */ ini_set('session.gc_probability', 1); ini_set('session.gc_divisor', 100); Do not forget to lock site/config.php after modifying it. Here it is! We are done! After we have set gc_maxlifetime (through sessionExpireSeconds), enabled the garbage collection (gc_probability=1), and set its intervention probability (gc_divisor=100 ie 1% chance), we can rely on Session.php where the a session path (session_save_path()) is defined, and session is started (session_start()). In the development session of our browser let's look for our session cookie: if you go to site/assets/sessions you will find your corresponding session: Please note that during development phase, likely having little traffic, the number of sessions may grow and they will not be deleted. This depends from the 1% chance of deletion. If you want to test garbage collection is properly working or just to make sure sessions files are regularly cleaned during development, you can decrease gc_divisor to a lower rate(10=>10% ... 2=>50%). Do not forget to reestablish gc_divisor = 100 when moving to production. I hope some can find that tutorial useful in the future ... and may save several log outs!
    1 point
  9. I will take a look at their repo next year. Maybe there is/was something. I did actually. I couldn't find anything related to that issue. It happens on processwire.com, the Aaron Copland site and even with my default UIKIT test sites I run locally. At first I thought about an issue with my Brave installation (from Arch Linux AUR) but it happens on other machines, too - all linux as their is no Windows or OSX/macOS device with me right now. I have to dig deeper into it as it's something that annoys me a lot and I need/want/have to use UIKIT in an upcoming project.
    1 point
  10. What about ImageReference like the PageReference we already have? Thx for that preview. What came to my mind instantly was that it would be great to have an option to define a default. This would then be very similar to the "select image from page" option - so maybe these could be combined? Maybe that would be overengineering. Not sure ? Thx for your great work! I will definitely use your module a lot in the future.
    1 point
  11. @kongondo let me know that there already is a fieldtype module ImagePicker authored by @theo. To avoid confusion, I am going to rename my module. Not 100% sure yet on the new name. What I think would fit the purpose and features of my module is ImageFromAnywhere. With the upcoming addition of the 'Choose image from any page' feature, I think this name reflects quite well what the module does. I'll be happy to receive your suggestions for a new name. Note to forum admins: I can't make text bold or italic for quite some time now on latest Firefox and Chrome on Linux.
    1 point
  12. @Macrura, you deserve them. The table filtering on the list (its reactiveness and the immediate changes on the query strings) and the advanced search would be ideal :)
    1 point
  13. Congrats @Macrura, beside the pleasant look and feel of the site I really appreciate the precision and the amount of details within the search pages. I'd love, as a christmas present, and in-depth tutorial/guide on this subject (since, IMHO, you've made the best search pages throughout the years) ? ?
    1 point
  14. 1 point
  15. As an alternative so you don't have to use an extra field, you could also use the $cache API to save the counts, and to avoid the count on first load, calculate all counts when a page of template news or exhibition is saved through a hook. And if you really really want to make sure a guest user never hit the cache rebuild call you could use a cron job to rebuild the cache behind the scenes.
    1 point
  16. Thanks for posting the solution to your problem! To test if a full page object was returned by $pages->get() you can use if($category->id) {...} This is usually enough. When PW doesn't find a page it returns an object NullPage. This NullPage object returns null for id. So the simple test above is sufficient. Since you get your category and subcategory names from the urlSegments, you could test earlier in your code if these exist. If there is no urlSegment(1), $categoryName = $sanitizer->pageName($input->urlSegment(1)); will return an empty string. So you could test for that. I can recommend to start early on using the fabulous debugger module TracyDebugger. It makes dev life easier and can save a lot of time. I use it on every project. Also it is always goo to have the API reference open in a separate tab or browser window ?
    1 point
  17. You should check via phpinfo if there are more disabled functions or more restrictions on that hosting account. If yes, I would overthink to upgrade or switch to another.
    1 point
  18. Hey @Macrura could you maybe add some screenshots or short screencasts as a little inspiration how you are using this module? ? @BitPoet thx for the module! Just tried it and it works great. Could you please consider showing all available results as default if no character is typed? At the moment it shows the "loading" animation but it seems to do nothing until you type any letter: I think it would be better if the dropdown showed "admin" or "hello_world" right from the beginning, because if users do not remember the correct word of a hanna code they could simply type [[ and choose it from the list of available options.
    1 point
  19. I just submitted a pull request with fixes for the overflow positioning, offset when CKEditor is in inline mode, and overrides for the <ul> padding and margin coming from AdminThemeUikit. https://github.com/BitPoet/ProcessCKInlineComplete/pull/4
    1 point
  20. Thanks for pointing that out. I never changed that setting in production, so I didn't think of that. The latest github master (0.1.4) now uses the settings defined in TextformatterHannaCode's config both when inserting the pattern and as the trigger for autocompletion.
    1 point
×
×
  • Create New...