Leaderboard
Popular Content
Showing content with the highest reputation on 08/10/2018 in all areas
-
Hello for all, ConfigurationForm fieldtype module is one my experiment from 2016. Main target to build this module was to store multiple setup and configuration values in just 1 field and avoid to use 1 db table to store just single "number of items on page", or another db table to store "layout type" etc. Thanks to JSON formatted storage this module can help you to reduce number of PW native fields in project, save DB space, and reduce number of queries at front-end. Install and setup: Download (at the bottom ), unzip and install like any other PW module (site/modules/...). Create some filed using this type of field (ConfigurationForm Fieldtype) Go to field setup Input tab and drag some subfields to container area (demo). Set "Name" and other params for subfields Save and place field to templates ("Action tab") How to use it: In my case, I use it to store setup and configurations values, but also for contact details, small content blocks... (eg. "widgets"). Basic usage example: ConfigForm fieldtype "setup" has subfields: "limit", type select, option values: 5, 10, 15, 20 "sort", type select, option values: "-date", "date", "-sort", "sort" // get page children (items) $limit = isset($page->setup->limit) ? $page->setup->limit : 10; $sort = isset($page->setup->sort) ? $page->setup->sort : '-sort'; $items = $page->children("limit=$limit, sort=$sort"); Screenshots: Notes: Provide option to search inside subfields Provide multilanguage inputs for text and textarea field types Provide option for different field layout per-template basis Do not place/use field type "Button" or "File input" because it won't works. Please read README file for more details and examples Module use JSON format to store values. Text and textarea field types are multilanguage compatible, but please note that main target for this module was to store setup values and small content blocks and save DB space. Search part inside JSON is still a relatively new in MySQL (>=5.77) and that's on you how and for what to use this module. Thanks: Initial point for this fieldtype was jQuery plugin FormBuiled and thanks to Kevin Chappel for this plugin. In field type "link" I use javascript part from @marcostoll module and thanks to him for that part. Download: FieldtypeConfigForm.zip Edit: 14. August 2018. please delete/uninstall previously downloaded zip Regards.9 points
-
This week the focus has been on fixing various issues in the queue at our GitHub processwire-issues repository. So while there aren't any new/exciting features to write a blog post about, there are a lot of commits in ProcessWire 3.0.110 that fix various minor issues. If you are running on the dev branch, the upgrade is definitely worthwhile. You can review this week's commits in our commit log in the date range from August 6 to August 10. Also a big thanks to @netcarver who is now helping to administer the processwire-issues repository.7 points
-
Long but well written, detailed and informative article written by an Engineering Manager for Google Chrome about the true cost of Javascript and what you can do to alleviate some of that cost. Must read! https://medium.com/@addyosmani/the-cost-of-javascript-in-2018-7d8950fbb5d47 points
-
20+ year of web dev and we still on this bs. Best thing that happened is: box-sizing: border-box; Jees, we fly to the mars...7 points
-
I find it ironic that a product called "webpack" is now touting the advantages "code-splitting"? It's like we're adding layer on top of layer of complexity just to get back to where we started.5 points
-
I'm proud to share this newly released custom-made website with you. Musikschule Neumünster https://www.musikschule-neumuenster.de/ Design details The design was built from ground up to give every aspect and every detail of the website its very own unique look. We faced the demand to create a visual experience that is up to date but kind of classic at the same time. A fact you can't describe but you will feel and see it when visiting the website. ? Technical details From top to bottom every detail can be managed in the backend - all instruments, tutors, events, and content pages. In order to make life easier some things are automated (for example: archiving older events or managing the relationship between tutor and instrument). Modules and time-savers ProCache Croppable Image 3 PagefieldPairs MarkupSitemap Hanna Code Jumplinks I hope you enjoy the result as much as we* do. * A little side note to reduce confusion: I'm partner and the developer of Muskaat (design and development bureau based in Neumünster, Germany).2 points
-
I've read that one a few weeks ago and while I like the gist of it I find it horrible that the javascript community just seems to replace complexity with even more complexity. Also such blog posts always seem to be about the technical side of keeping js in check, while I feel the biggest gains can be archived by actually doing less in javascript. I'd like to see some practical advice on how to not blow through kb's of npm packages and still having a reasonable interactive website. Yesterday I tried out shopifys draggable library and even that one alone is like a third of the max. size of bundle mentioned in the article – just for drag and drop2 points
-
hey adrian would you mind changing 999 to 9999 ? 999 is too low here for debugging my sql queries and I wonder why we have such a low setting for the "big" dump. I think it's fine to have a low setting for bd() but one would use bdb() only for dumping big dumps so I think 999 can often be limiting and then the benefit of having bdb() compared to bd($var, [6,9999]) is lost.2 points
-
@darrenc Yes 'pw-remove' works. Maybe it's about being consistent? Try using the <region> tag for all rather than mix-n-matching <region> & <div> Instead of using <div id="sidebar"></div> use <region id="regSidebar"> <div id="Sidebar">xxx</div> </region><!--regSidebar--> Then in your template where you don't want to display the sidebar, simply put <region id="regSidebar"></region> This has always worked for me and helps me keep track of the regions. Many roads up the mountain ?2 points
-
Hello for all, here is module what I just posted in forum module section. It can store/hold multiple fields values in JSON format, and because of that it can help to reduce total number of fields in project, total number of queries at front-side, and reduce DB storage space. Regards.2 points
-
Check out pw-remove in the Removing elements section of this post: https://processwire.com/blog/posts/processwire-3.0.49-introduces-a-new-template-file-strategy/2 points
-
A couple of things Ryan has said: https://processwire.com/talk/topic/26-what-is-the-autojoin-feature-in-the-fields-editor-and-how-do-i-use-it/ https://processwire.com/talk/topic/613-underlying-workings-of-autojoin/?do=findComment&comment=49481 point
-
For some reason I never really thought about the fact that, with client-side rendering, you are basically sending your entire application over the wire. It's like having to install an app each time you visit a website. Makes me feel more confident in the componentized server-side approach I've been pursuing, which seems to achieve 90% of what the fully client-side approach aims to achieve, without the complexity and overhead. And it still leaves room for plugging in a more progressive framework like Vue for the cases when you need that extra 10% of interactivity.1 point
-
I haven't tested these yet, but to reduce the amount of fields you could try: http://modules.processwire.com/modules/fieldtype-yaml/ https://processwire.com/blog/posts/functional-fields/ formerly called Static fields https://processwire.com/blog/posts/processwire-updates-and-new-field-types/. Note this is a paid module. All the other Profield modules https://processwire.com/talk/store/product/10-profields/1 point
-
Hi @bernhard - I have upped them to 9999 here locally - I'll commit it to the next version. Hi @rick - that might be possible, but I am curious about why you want this - for me it's about quickly and temporarily getting every Tracy related hidden so I can see what's behind on the main page content.1 point
-
Just and FYI: Ubuntu and Debian both display the correct information for me. On another note, when minimizing the tracy bar (displayed lower right) it removes whichever panel is displayed. Is there a way to keep the target panel visible when the tracy bar is minimized? It doesn't matter if the panel is opened in a new window, the performance is the same. Thanks for all your work on this module. It really is a time-saver.1 point
-
Thank you! I tried OR groups but didn't get them together to get the desired result. In the meantime I found out that the cause of the problem seems to be the Multi-dot selector. Not just for the OR '|' fields but also for my approach with the array. The parts of the array are working with AND logic until I add the part with the Multi-dot selector. So I did a little workaround: There are two searches now. The first one does an OR search in facility_jobs.facility_job.job_title with all given words. The resulting list of IDs is now a filter for the selector array instead of the Multi-dot selector. This seems to work quite well now. Maybe this can be done with one request using sub-selectors. I will look into this later.1 point
-
I recently discovered a show called Final Space and it's been a revelation so far with very entertaining characters and humour to boot. They have an all star voice lineup including David Tennant, Steven Yuen, Conan O'Brien, Ron Perlman, Caleb McLaughlin etc It's kinda like a blend of Futurama & Rick & Morty with an ongoing plot like a normal TV series, rather than having storylines that are confined to each episode only. Check it out if you're a fan of the above shows. https://www.imdb.com/title/tt6317068/1 point
-
Oh, right. To work around that limitation you can most likely rewrite your multi-dot selectors as sub-selectors: https://processwire.com/api/selectors/#sub-selectors https://processwire.com/blog/posts/processwire-3.0.6-brings-pages-upgrades-and-link-abstraction/#improvements-to-sub-selectors Although I'm not certain they can be used with OR pipes either. Maybe you'll need OR groups. Let us know how you get on.1 point
-
1 point
-
Slightly off topic but @Robin S, do you know about this? https://www.masterclass.com/classes/judd-apatow-teaches-comedy and btw, great post1 point
-
ahhhhhhhhhhhhhhhhhhhhh great! thank you kindly @adrian1 point
-
Hi! @Mike Rockett the documentation pages for Jumplinks seem to be down, will you upload them somewhere else again?? Then again, thanks for this awesome module. EDIT: Whoops, right here: https://jumplinks.rockett.pw/1 point
-
Take a look at this post (https://processwire.com/talk/topic/19024-selector-arrays-with-page-reference-fields-with-and-not-or/?do=findComment&comment=165462) and the rest of the thread. I really like the concept of selector arrays and they can make things much more readable and avoid concatenation stuff, but currently they can be a little tricky to get things how you want. Hope that helps.1 point
-
Thanks matjazp, I've added to the issue report.1 point
-
Thanks for all your answers!!! This was really fast and seems like a very active community! I'm sure the code snippet by @szabesz and the fieldtype by @kixe will work as well and are definitely more lightweight. I went with the RuntimeMarkup fieldtype suggested by @elabx as it was the fastest and easiest one to apply. Here is my php snippet for the runtime field: return " <a id='custom-action-button' href='#' onclick='copyUrlToClipboard(event);'>Copy URL to clipboard</a> <input type='text' value='" . $page->httpUrl() . "' id='target-page-url'> <p id='action-executed-hint'>Successfully copied URL to clipboard!</p> <style> #custom-action-button { color: #FFF; background: #93BF0D; font-weight: bold; padding: 0.6em 1.1em; font-size: 1em !important; border-radius: 5px; } #custom-action-button:hover { color: #FFF; background-color: #DB1174; } #custom-action-button:active { color: #FFF; background-color: #860A47; } #custom-action-button:visited { color: #FFF; } #target-page-url { position: absolute; left: -9999px; top: -9999px; opacity: 0; pointer-events: none; } #action-executed-hint { display: none; } #action-executed-hint.show { display: inline; } </style> <script> function copyUrlToClipboard(event) { event.preventDefault(); var urlText = document.getElementById('target-page-url'); urlText.select(); document.execCommand('copy'); var hint = document.getElementById('action-executed-hint'); hint.className += ' show'; } </script> "; It creates an a-tag which is styled like a backend button. Hope its useful for someone else!1 point
-
1 point
-
@adrian I've jshinted and formatted the code, you can update the test module if you wish.1 point
-
Hello, I have something similar I hope you can adapt it to your needs. Mine is for user templates: <?php //adds a button to the end of the user edit page: $this->addHook('ProcessPageEdit::buildForm', function (HookEvent $event) { $current_page = $event->object->getPage(); if ($current_page->template->name != 'user') return; // this button is for the user edit page only if (empty($current_page->user_family_name)) return; // custom field is not yet filled in, which means the new User has not been saved but still being edited in the admin $id = (int) $current_page->id; if ($id != 0) { if ($current_page->hasRole('mycustomrole')) { $href = createLink($current_page); // this is a custom function to be implemented, it must generate and return the required URL $field = $this->modules->get('InputfieldButton'); $field->attr('class', $field->class . " my-custom-css-class-if-needed"); // this is just opitional, I left it here as an example $field->attr('value', 'Copy URL to clipboard...'); $field->attr('data-clipboard-text', $href); // data-clipboard-text is needed by https://clipboardjs.com/ $field->attr('href', ''); // $href $event->return = $event->return->append($field); } } }); The copy to clipboard action is performed by https://clipboardjs.com/ which can be loaded by the admin using various techniques or free modules (such as AdminOnSteroids or Admin Custom Files) or one can simply put this line into config.php: $config->scripts->add($config->urls->templates . "clipboard.min.js"); where clipboard.min.js is in the templates directory, for example. EDIT: I forgot to note that the hook goes into init.php1 point
-
Thanks @netcarver for the detailed line. Horst's approach worked really well with a very small feed, and I was learning how to make a module to potentially handle this. I was hopping to tap into a cron job to handle the updating/adding at a specific time, like midnight every night, but maybe lazycron might work inside the module. I havent done much research into actually hooking into lazy cron within a module and getting the module to perform the functions similiar to horst's example above. However, you make a good point regarding page size. I believe max I will be dealing with maybe 500 to 600 max (though could be as low as 200). I would say I am getting a lot better with php as my background is in front-end, but I am enjoying the learning process. Since the items will have a status (new, used, or sold), I was thinking that I could potentially write a function to trash the items marked as sold after a 24 hour period and empty the trash. Well, this was my thought earlier in my pre-planning stages.1 point
-
0 points