Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation since 06/18/2019 in all areas

  1. 17 points
    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 anyone didn't draw lines between this module and Soma's awesome MarkupSimpleNavigation. Simply put, I've been using MSN (...) for a number of years, and it's been great – but there have been some smallish issues with it, particularly with the markup generation part, and it's also doing some things in a way that just doesn't work for me – the xtemplates thing being one of these. In many ways it's less about features, and more about style. In MarkupMenu I've tried to correct these 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 PHP 7.1+, it's installable with Composer, and I have a few additional ideas (such as conditional placeholders) on my todo list. One smallish and rather specific 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 has a wrapper function for MarkupSimpleNavigation (to avoid code / config repetition), and this way I've been able to omit that Requirements ProcessWire >= 3.0.112 PHP >= 7.1.0 If you're working on an earlier version of ProcessWire or PHP, use MarkupSimpleNavigation instead.
  2. 15 points
    This week I've been working on core 3.0.134 but am going to keep the version number at 3.0.133 for another week while I continue with updates there. Commit log. One of the updates already present that I'm finding quite useful is a nice upgrade to InputfieldSelector (like used by Lister and ListerPro) which simplifies the field selection process as there are no longer separate "Field" and "Field…" selections for fields that have subfields, and they are now bundled into one. This reduces the number of selectable fields and likewise speeds up the selecting/filtering process. I'll have more details on that next week, along with other updates. I'm going to be working remotely next week (not vacation) and do not yet know what the internet situation is going to be yet, so on the chance that I don't have good internet access, I may not have an update next week, but hopefully will. Have a great weekend!
  3. 9 points
    Also, there is a counter option built into PW for all textarea fields:
  4. 6 points
    @BitPoet's groupBy() hook is nice for this sort of thing. As with @teppo's suggestion, you'd have to do a bit more to get it working with infinite scroll (the limit might fall in the middle of a day, in which case you wouldn't want the day heading added again on the next pagination).
  5. 6 points
    I have no experience with this Tribe events thing, so can't speak for that, but for the bulk of the content I'd recommend skipping the database export idea and going with the built-in REST API. While the REST API has its quirks, going directly to database for exports is going to be a major pain in the a*s in comparison. Not entirely unlike exporting ProcessWire content with raw SQL... It would be best to have a separate copy of the site at hand first, but after that it's basically as simple as installing the ACF to REST API plugin (which adds ACF field data to the REST API results) – and of course making sure that the REST API is enabled in the first place. You should be able to query and export all your pages, articles, and any custom post types with this method. Once you have the data, importing it to ProcessWire is going to be a breeze. (Note: based on some quick googling the Tribe events plugin also provides REST API support. I haven't used this, but it looks promising.) Also, in case that idea won't pan out, you can always rely on existing solutions, such as WP All Export (which provides a GUI for exporting content, including ACF data). Admittedly I haven't worked with this plugin before, but it's the companion plugin for WP All Import, the de facto standard plugin solution for complex imports. WP All Import is a bit of a monster and can feel clunky (hence devs often prefer custom imports for long-running, often-used, scheduled stuff), but for one-off cases it's a really handy tool. -- Edit: in case anyone is wondering, the WP REST API was first announced on June 17th 2013, which would be a week or so after Ryan started this thread. It didn't make it's way into the core until 2015, and even then it was for a very long time considered "a work in progress". It's been more than five years since this thread was started, so it shouldn't come as a big surprise that some things have changed
  6. 5 points
    Perhaps I'm missing the point, but this should be the easy part. Maybe something along these lines: <?php $current_date = null; $items = $pages->find('template=news-item, sort=date_field, start=0, limit=20'); if ($items->count()) { foreach ($items as $item) { $date = date('j.n.', $item->getUnformatted('date_field')); if ($date !== $current_date) { if ($current_date !== null) echo "</ul>"; echo "<h3>{$date}</h3><ul>"; $current_date = $date; } echo "<li>{$item->title}</li>"; } echo "<ul>"; } It's a bit crude and probably wouldn't work as-is with your infinite scroll approach, but that's the basic idea anyway
  7. 5 points
    Here now some details how we use ElasticsearchFeeder on www.blue-tomato.com: Our main webshop technology is Java / SAP Hybris which is mostly developed by an external developer team. Hybris is good for multichannel webshops but not the best tool for general content management or for creating quick new content. So we use ProcessWire for our editoral content like blogs, landing pages, buyers guides etc. since 2 years. We created a RestAPI where SAP Hybris gets the content from ProcessWire. So ProcessWire prerenders the main-body and gives it with some metadata to Hybris which puts them between the webshop header and footer. This works great with following page sections: https://www.blue-tomato.com/blue-world/ https://www.blue-tomato.com/team/ https://www.blue-tomato.com/buyers-guides/skateboard/skateboard-decks/ Since this are kind of static pages it worked very well but we want to integrate also our content dynamicly on other high traffic pages like the homepage or product detail pages. This is why we decided to put our content into ElasticSearch. In front of ElasticSearch we created an GraphQL / Node.js Server, because we mashup our ProcessWire data with product data from other (REST) sources. For the first step we created two kind of widgets, which run on the Blue Tomato Homepage: Blue World News (latest news from our blog) Shop The Look The Shop The Look Widget is our first try to mix and show data from different sources. The Editor of a "Look" has to create the look in the ProcessWire Admin panel. He uploads the look photo and has to put product IDs into a Table. No product price, title or image. All of the product data will be fetched by GraphQL from our other database during the request. All widgets are rendered with React. I hope I could give you a short overview of what we do with ProcessWire and ElasticsearchFeeder.
  8. 4 points
    Windows Terminal has been released and can be downloaded from the Microsoft Store. Article: https://www.theverge.com/2019/6/22/18701365/microsoft-windows-terminal-10-download-store-features WSL (WSL2 in the near future) + VSCode + Terminal... Microsoft is awesome.
  9. 4 points
    A rather large update today for this language pack. Including a lot of new modules, some new Pro modules. And core translations for the 3.0.133 dev version. As usual, the translations is not complete. And some typos might exist.
  10. 4 points
    Yeah, @Robin S is mostly correct. The array approach seems like a good idea, but it will end up biting you in many cases. For ease of readability and building up complex selectors, I do build them with a regular php array and then simply implode the array with a comma to get the string selector. This is now my goto approach for any complex dynamic selectors.
  11. 4 points
    There are a few things that came up in my mind right now. First I thought it looked like a failed git/SVN merge of some kind but afterwards it looked liked a failed upload from FileZilla. At least they both look pretty similar somehow. As you stated that there are more instances of other sites and CMSs on that hosting you might want to try to set up different users for different sites. I guess you are using a US hosting company such as DreamH*st, H*stgator or Blueh*st, *2, or another 3.99/month mass-hosting ... I had several similar issues with these companies in the past - but to their rescue - they offer different users on a account to separate installations/instances of different sites. TL;DR: what @teppo and @louisstephens say seems to be the case... someone got somehow access to that hosting. Maybe even through a nifty trick in W*rdPress.
  12. 4 points
    That's quite strange. Running this through decoder suggests that this include is trying to load file from /wire/modules/System/.db9f7664.ico. Is this a path that exists on your site, and if so, what's in that file? /wire/modules/System/ is a path where SystemUpdater and SystemNotifications live, but I'm not aware of anything that should create a file like that. Combined with files suddenly being removed and this file getting modified, it doesn't sound good. The first thing to do would be to check the server, i.e. is it possible that someone has gained illegitimate access to it. Is this a shared host, a VPS, or something else entirely? Were both sites on the same host? I'm not aware of any security issues with ProcessWire itself, but ProcessWire isn't immune to problems caused by someone gaining access to the server, directly or through another application (such as a WordPress installation – which has actually happened before).
  13. 4 points
    From what I can tell, some might have gained access to your server/account . I have seen this before with wordpress sites. Has anything with your server changed lately? Also, I would check with your host to check if this is not just effecting you. Just in the short term, I would change your ftp credentials.
  14. 3 points
    @stuartsa, you can achieve a step setting for InputfieldInteger / InputfieldFloat / InputfieldDecimal by a couple of hooks in /site/ready.php: // Add a step setting to InputfieldInteger / InputfieldFloat / InputfieldDecimal $wire->addHookAfter('Inputfield(className=InputfieldInteger|InputfieldFloat|InputfieldDecimal)::getConfigInputfields', function(HookEvent $event) { $inputfield = $event->object; $field = $inputfield->hasField; if(!$field) return; /* @var InputfieldWrapper $wrapper */ $wrapper = $event->return; /* @var InputfieldText $f */ $f = $event->wire('modules')->InputfieldText; $f->name = 'step'; $f->label = 'Step'; $f->value = $field->step; $f->showIf = 'inputType=number'; $wrapper->add($f); }); // Add step attribute to InputfieldInteger / InputfieldFloat / InputfieldDecimal $wire->addHookBefore('Inputfield(className=InputfieldInteger|InputfieldFloat|InputfieldDecimal)::render', function(HookEvent $event) { /* @var Inputfield $inputfield */ $inputfield = $event->object; $field = $inputfield->hasField; if(!$field || !$field->step || $field->inputType !== 'number') return; $inputfield->attr('step', $field->step); });
  15. 3 points
    This would only be useful for simple, single-value fields like text fields, right? Because how would it work with an Images field or a Repeater field for example? Anyway, here is a proof-of-concept FileCompiler module: https://github.com/Toutouwai/FileCompilerDataAttributes File Compiler Data Attributes A proof of concept module for populating markup elements according to data attributes containing a field name. Created in response to this forum topic. This approach is really only useful for simple, single-value fields such as text fields as far as I can see. Installation Install the File Compiler Data Attributes module. Setup If you follow the practice of starting your template files with the ProcessWire namespace declaration then for every template you want to use this module with you must change the "Use Compiled File?" option in the template settings from the default option. You must choose either of the "Yes" options depending on what suits you best. I find the need to do this annoying and there is an open issue about it. There is an option in the module config to strip the data-field attribute from the markup when the template file is compiled. Usage In your template files, insert HTML elements (probably empty elements although this is not compulsory) with a data-fieldattribute set according the field name you want to populate the element from. Example: <h1 data-field="title"></h1> <div data-field="body"></div>
  16. 3 points
    Just add this plugin: https://ckeditor.com/cke4/addon/wordcount Or use AdminOnSteroids module which comtains this plugin.
  17. 3 points
    In contrast to you and several others here my focus is more towards frontend development, some technical SEO stuff and only a few bits of real programming. Some hooks, some minor module stuff but nothing fancy. So I looked for something that is super easy to use with everything I need for my jobs. I used and tested a lot of tools but at the end I stayed with Laragon as it's doing exactly what I need. In the last few days I started to use PW Kickstart from @bernhard which adds another layer of comfort to my workflow. As it works as expected I feel no need to change my setup.
  18. 3 points
    That's a nice addition to Bracket Pair Colorizer 2.
  19. 3 points
    I discovered indent-rainbow today: https://marketplace.visualstudio.com/items?itemName=oderwat.indent-rainbow I don't like visual distractions when coding, and I thought this might contribute to that, but the colors are very very subtle so I'm keeping this one installed.
  20. 3 points
    IMPORTANT NOTICE!!! Hi everyone. I just discovered something pretty important with this module. If you are using the Role Name or Custom PHP Code option and matching a page name or path, you MUST be sure to check "No Access" for the "If no match, give all access or no access?" setting. If you don't do this, a site editor could change the name of their branch parent, which would result in no match and hence they could gain access to the entire page tree. I am tempted to actually remove these two matching options to improve security - is anyone using them? To make life easier, I have added a new "Role Specified Branch Parent" option which allows you to select a branch parent on a per role basis, rather than per user. I think in most cases this is the best option to use. Please be sure to check your settings and if you can please switch to the "Role specified" or "User specified" options in the new version. Let me know if you have any questions or concerns. Thanks, Adrian
  21. 3 points
    PS, here's the thread @Robin S was referring to:
  22. 3 points
    Just my opinion: I'm not sure there's much advantage to doing that - selector arrays seem more trouble than they are worth. When you start needing things like OR groups and nested selectors (which you inevitably do) the array syntax gets quite verbose and frankly less readable than the string syntax (especially if you are already familiar with the string syntax). I can't locate the topic now but I remember @adrian working with selector arrays for a while and I think he ended up reverting back to selector strings because there were too many issues/hassles with the array syntax. Maybe he will correct me on that.
  23. 3 points
    https://github.com/processwire/processwire/pulls There are still pull requests from 2016... Please @ryan could you take a look at the PR repository just like you did with the issues over the last weeks? There are many simple ones that really just need to be merged (like https://github.com/processwire/processwire/pull/143/commits/80aa0ac2e6383b32a4d0a932d5bec78a8fb5bf14 ). It's really frustrating if one tries to contribute and this contributions just seem to be ignored
  24. 2 points
  25. 2 points
    Hey gents. I've been asking myself this question for quite a while now and even though I've completed some projects purely and entirely out of PW core + free modules, I've been always envy of the simplicity in code and to minimize the database/website load. As it appears, in times when I had to revise some of the profiles code I was finding a better and simpler approach based on some shared recent or good old (but not forgotten) tricks by all the smart persons presenting this amazing ProcessWire community. The more I analyze the code, the more strong need I feel to get the ProFields module for several reasons: a.) All the advice and help that have lead me to my present skills were kindly given absolutely for free with no questions asked and no matter if the answer was helping me generate some revenue. I am 100% convinced that I "owe" back to the community and its major developers the support (my 5 cents back ) b.) Being a bit selfish - I would really like to spend less time on a project while still delivering the same if not much better and simpler solutions. To achieve all this, I would need the tools kindly included in the "ProcessWire toolbox" called ProFields. Initially my plan was to build a few profiles, generate some revenue and then spend some of the finance to purchase the tools needed, however most of the profiles I've built were for personal or close friends/relatives from which I did not generate much out of respect. But I've learned that with the proper tools, even when I am "working for pennies" I can complete the project faster/easier and move on to the next of kind. c.) As it was previously mentioned, everybody is in a need of a stable financial position as otherwise no matter how good is the will, everything seems to be doomed to an end of a failure. By buying the ProFields module, I would not only support the respectful development team, but also the community itself as the new releases, modules, tweaks etc. would keep on going. To me - this seems like a healthy recipe of success. d.) Not sure about others, but at least in Canada I am allowed to claim some work related expenses while working as a self employed, so I have a choice to either give/share my money with the developers team or to give them to the government in the form of taxes. Well, let's just say I got tired of paying taxes e.) The words: "free for life" or "use on as many websites you want" got me by surprise. Most of the platforms I am aware of are selling their licenses per user, per device, per website etc. but I have not seen a single one stating that I can use a bunch of modules to sell websites etc. and that can go on and on to as many users as I can convince of my skills. I have some pre-sale questions, but I am sure that everything is as well covered as it is with all the freebies so I will not pose some, wait for answers and waste more time on this. I am about to start working on a new project where I clearly stated that without the tools I need, I won't be participating so I am very much eager to start "playing" soon with all the masterpieces included in ProFields. I just wish that the price was in Canadian dollars or at least I've bought the license at the time when CAD to US was 1.04 to 1, but hey - it is an economy driven situation so there is no one to blame on this other than myself waiting for so long.
  26. 2 points
    We recently rebuilt the Architekturführer Köln (architectural guide Cologne) as a mobile-first JavaScript web app, powered by VueJS in the frontend and ProcessWire in the backend. Concept, design and implementation by schwarzdesign! The Architekturführer Köln is a guidebook and now a web application about architectural highlights in Cologne, Germany. It contains detailled information about around 100 objects (architectural landmarks) in Cologne. The web app offers multiple ways to search through all available objects, including: An interactive live map A list of object near the user's location Filtering based on architect, district and category Favourites saved by the user The frontend is written entirely in JavaScript, with the data coming from a ProcessWire-powered API-first backend. Frontend The app is built with the Vue framework and compiled with Webpack 4. As a learning exercise and for greater customizability we opted to not use Vue CLI, and instead wrote our own Webpack config with individually defined dependencies. The site is a SPA (Single Page Application), which means all internal links are intercepted by the Vue app and the corresponding routes (pages) are generated by the framework directly in the browser, using data retrieved from the API. It's also a PWA (Progressive Web App), the main feature of which is that you can install it to your home screen on your phone and launch it from there like a regular app. It also includes a service worker which catches requests to the API and returns cached responses when the network is not available. The Architekturführer is supposed to be taken with you on a walk through the city, and will keep working even if you are completely offline. Notable mentions from the tech stack: Vue Vue Router for the SPA functionality VueX for state management and storage / caching of the data returned through the API Leaflet (with Mapbox tiles) for the interactive maps Webpack 4 for compilation of the app into a single distributable Babel for transpilation of ES6+ SASS & PostCSS with Autoprefixer as a convenience for SASS in SFCs Google Workbox to generate the service worker instead of writing lots of boilerplate code Bootstrap 4 is barely used here, but we still included it's reboot and grid system Backend The ProcessWire backend is API-only, there are no server-side rendered templates, which means the only PHP template is the one used for the API. For this API, we used a single content type (template) with a couple of pre-defined endpoints (url segments); most importantly we built entdpoints to get a list of all objects (either including the full data, or only the data necessary to show teaser tiles), as well as individual objects and taxonomies. The API template which acts as a controller contains all the necessary switches and selectors to serve the correct response in <100 lines of code. Since we wanted some flexibility regarding the format in which different fields were transmitted over the api, we wrote a function to extract arbitrary page fields from ProcessWire pages and return them as serializable standard objects. There's also a function that takes a Pageimage object, creates multiple variants in different sizes and returns an object containing their base path and an array of variants (identified by their basename and width). We use that one to generate responsive images in the frontend. Check out the code for both functions in this gist. We used native ProcessWire data wherever possible, so as to not duplicate that work in the frontend app. For example: Page names from the backend translate to URLs in the frontend in the form of route parameters for the Vue Router Page IDs from ProcessWire are included in the API responses, we use those to identify objects across the app, for example to store the user's favourites, and as render keys for object lists Taxonomies have their own API endpoints, and objects contain their taxonomies only as IDs (in the same way ProcessWire uses Page References) Finally, the raw JSON data is cached using the cache API and this handy trick by @LostKobrakai to store raw JSON strings over the cache API. Screenshots
  27. 2 points
    Is your project_logo field limited to 1 file only? If not... either change the limit in the settings to 1 or place your image code into a foreach() I'd recommend the first option.
  28. 2 points
    I don't know how to do this in PW, but I'm guessing something like GROUP BY in mysql should work. Check RockFinder I see some examples: https://github.com/BernhardBaumrock/RockFinder#custom-sql-aggregations-groupings-distincts
  29. 2 points
    That trailer though is pretty epic.
  30. 2 points
    Well, a real linux kernel inside windows... And proper copy&paste. And having one single config json sounds awesome. Hope that principle will find its way to VSCode, then it would finally be really easy to share your dev environment across multiple machines
  31. 2 points
    Thanks @Robin S, somehow I thought the built-in one didn't work for CKEditors but it's not true. Just tried it and worked fine for a multi-language field as well, and showed the same values as the CKEditor plugin. According to the CKEditor plugin's documentation it offers more advanced configuration though.
  32. 2 points
    Interesting, thx for sharing!
  33. 2 points
    @teppo Thanks for your insights and links. I have stumbled over import-/export WP plugins, and tried out two or three that sounded promising, but none of them did a clean job with ACF pages. I will definitely take a closer look at WP REST. The task I will definitely hate the most are internal links. WP stores them as hardcoded links. If all URLs inside PW will change* (conceptual question of course), updating those countless links inside RTE fields to avoid broken links will be tedious. But I'm sure I'll whip out something that'll work (regex, .htaccess 301 redirects, storing old URLs in hidden PW fields too etc.) * i.e. in case we'll not keeping the old WP structure and hence not going to use /site/templates/includes/hooks.php like Ryan did (his first post in this thread)
  34. 2 points
    Hi @Juergen This should work: $page->seo->robots->noIndex = 1; $page->seo->robots->noFollow = 1; Cheers
  35. 2 points
    Can't you use one of these? $_COOKIE["wires"]; $_COOKIE["wires_challenge"]; Seems like the first one is always created, and the second one only if logged in.
  36. 2 points
    Firefox has some nice features while debugging grid layouts. At least they feel more solid than those in Chrome. I use Opera once in a while but only for very basic tasks. Somehow it feels clunky and slow. While Chrome was my daily driver for a long time I recently started using the Brave browser for casual browsing. For now I tried to unsubscribe again and added those mails to the Spam list in Gmail. Maybe this helps.
  37. 2 points
    @buster808 Can you please use the code blocks provided by the forum instead of copy pasting directly from your editor into the post. It's really hard to read the way they're right now.
  38. 2 points
    No ready-to-go module that I can find. I don't know the details but they seem to support basic authentication to the service just fine. So probably just install their library through composer (or manually) and do the API call on the POST request of your frontend form. https://developer.mautic.org/?php#basic-authentication https://github.com/mautic/api-library
  39. 2 points
    Actually all of the above, but yes, the Tracy dump is a key part of it - so much easier to see which parts are being added to the selector this way. I do also sometimes modify parts by key, but I also just find my code looks cleaner that concatenating a string with commas at the end of each one, plus you don't have to worry about a possible trailing comma.
  40. 2 points
    That sounds weird but... the good new are... it's probably not a server issue. Just a few questions to understand things better. Has your user superuser rights/privileges? What's your username? Admin? Check your access roles in Access > Users. Are all pages affected or only some pages? (you said some pages don't update) what can be changed? what can't be changed? what have pages with/without changes you can/can't save in common? templates? fields? What can/can't be changed? Do you get any error messages? What do they say? Do you see any changes in the backend? After saving a page: can you see and any new timestamps in Settings (tab) > Info?
  41. 2 points
    Thanks for your help @Zeka! Did find this topic while searching for a hint. I am familiar with OR groups, but what I am trying to do here is "migrate" from using string selectors to array selectors, but I can't just get them to behave like its string equivalent! I understand it will be hard to debug this without the whole scope of the ProcessWire project but maybe some has been through the some of the same issues.
  42. 2 points
    Thanks @MarcoPLY. Yes, I was already aware of it but it is great of you to bring it up like this for the benefit of everyone else.
  43. 2 points
    I just published another update that makes full use of the Add to Home Screen functionality in Chrome (though the app is installable in Android Chrome, Android Firefox, iOS Safari and regular Chrome). In particular, there's a new page that explains how to install the PWA on different devices, with a button that triggers the system dialogue for installing the PWA on supported browsers (only Chrome at the moment). This was a bit difficult to implement since there's little common ground between browsers in this regard at the moment, so let me know if you find any bugs or other errors! @charger ProcessWire only handles specific paths, everything else is routed to the frontend app and handled by the router. A normal ProcessWire installation uses the .htaccess rules to redirect all requests to it's index.php file. Meanwhile, the Vue SPA uses one single index.html as it's entry point and performs all further routing inside the visitor's browser. Since I want most visitors and paths to go to the frontend app, I modified the .htaccess file ProcessWire comes with to only forward specific routes to ProcessWire, and route all other requests to the Vue app: # .htaccess # Requests to the root domain without a path should go to the Vue app (index.html) instead of ProcessWire (index.php) DirectoryIndex index.html index.php index.htm # This additional RewriteCond comes right before the main RewriteRule from ProcessWire # It lets ProcessWire handle only calls to specific paths (in this case, the admin url (/cms), the API endpoint and the sitemap which is generated server-side) RewriteCond %{REQUEST_URI} (^|/)(api|cms|sitemap) RewriteRule ^(.*)$ index.php?it=$1 [L,QSA] # Everything else is routed to index.html, so the Vue app will receive the request and the vue-router can show the appropriate page # Redirect index.html to / RewriteRule ^index\.html$ / [L,R=301] # Redirect everything else to the app FallbackResource /index.html
  44. 2 points
    I will look into updating the Payment modules to use latest Stripe libraries. Other than that this change shouldn't require any changes for webshops and websites using payment modules, since that authentication is done between stripe and payment processors (banks, cc companies etc).
  45. 2 points
    From time to time, I copy/paste snippets of code in the forum here to my editor (SublimeText). Unfortunately, I think the forum software sometimes throws in invalid, INVISIBLE unicode characters that break the copied code and usually will throw PHP errors that at first sight don't make any sense. These characters are impossible to detect in SublimeText, but with the following plugin I just discovered, it will identify them: https://packagecontrol.io/packages/Gremlins
  46. 2 points
    Ah, the early days of discovering ProcessWire and enjoying the constant feedback loops of development bliss. This is a great site. I love seeing PW + ecommerce.
  47. 2 points
    At least to some degree related, no doubt! The reason I'm asking about ways to bundle dependencies into site profiles is that I was originally a bit conflicted about how to move forward with a project I'm currently working on. Based on the description in that thread there are definitely certain similarities with my project and what Jonathan is working on, but I'm not yet quite sure if there's any real common ground (except, perhaps, the target group) Either way it'd definitely be interesting to hear more about Jonathan's project – and perhaps share/borrow some ideas as well
  48. 2 points
    Repeater Images Adds options to modify Repeater fields to make them convenient for "page-per-image" usage. Using a page-per-image approach allows for additional fields to be associated with each image, to record things such as photographer, date, license, links, etc. When Repeater Images is enabled for a Repeater field the module changes the appearance of the Repeater inputfield to be similar (but not identical) to an Images field. The collapsed view shows a thumbnail for each Repeater item, and items can be expanded for field editing. Screencast Installation Install the Repeater Images module. Setup Create an image field to use in the Repeater field. Recommended settings for the image field are "Maximum files allowed" set to 1 and "Formatted value" set to "Single item (null if empty)". Create a Repeater field. Add the image field to the Repeater. If you want additional fields in the Repeater create and add these also. Repeater Images configuration Tick the "Activate Repeater Images for this Repeater field" checkbox. In the "Image field within Repeater" dropdown select the single image field. You must save the Repeater field settings to see any newly added Image fields in the dropdown. Adjust the image thumbnail height if you want (unlike the core Images field there is no slider to change thumbnail height within Page Edit). Note: the depth option for Repeater fields is not compatible with the Repeater Images module. Image uploads feature There is a checkbox to activate image uploads. This feature allows users to quickly and easily add images to the Repeater Images field by uploading them to an adjacent "upload" field. To use this feature you must add the image field selected in the Repeater Images config to the template of the page containing the Repeater Images field - immediately above or below the Repeater Images field would be a good position. It's recommended to set the label for this field in template context to "Upload images" or similar, and set the visibility of the field to "Closed" so that it takes up less room when it's not being used. Note that when you drag images to a closed Images field it will automatically open. You don't need to worry about the "Maximum files allowed" setting because the Repeater Images module overrides this for the upload field. New Repeater items will be created from the images uploaded to the upload field when the page is saved. The user can add descriptions and tags to the images while they are still in the upload field and these will be retained in the Repeater items. Images are automatically deleted from the upload field when the page is saved. Tips The "Use accordion mode?" option in the Repeater field settings is useful for keeping the inputfield compact, with only one image item open for editing at a time. The "Repeater item labels" setting determines what is shown in the thumbnail overlay on hover. Example for an image field named "image": {image.basename} ({image.width}x{image.height}) https://github.com/Toutouwai/RepeaterImages https://modules.processwire.com/modules/repeater-images/
  49. 2 points
    I dont think I have it down yet. I really think a page builder needs to live update while you change fields to be competitive with things like DIVI and Beaverbuilder and Elementor. This is what I am working on with vue. I am just looping through all fields attached to the page and making vue form fields that have 2 way databinding. So when you type new text in, it changes as you type. Or if you hit center text, it centers it instantly. I am using the REST API plugin to push the page data back to the database when you hit save. I plan on releasing the site profile to the community when I am done. It should be better than the above wordpress solutions as they are very hack solutions. You can not, for example, add any element inside a tab module or an accordian. You can only type manual code into their rich text. With mine, I can add a grid with columns or really anything inside anything.
  50. 2 points
    TLDR: Buy ProFields I don't understand why that brief list of fields is a "mess and a nightmare". I know the general advice given is to reuse fields where possible but I think people sometimes take this suggestion a bit too seriously. Create the fields you need and forget stressing about whether you have perfectly optimised the reuse of fields. If you have less than, say, 100 fields in your site you really have nothing to worry about. I think I saw a post recently where Lost Kobrakai was talking about a site of his with over 800 fields. But ProFields... You mention client editing experience, so I take that to mean you (like me) earn an income from developing websites. With that in mind here are some things to consider when making your decision whether or not to purchase ProFields... Have you thought about how lucky we developers are that we can earn an income with virtually no overhead costs? With so much fantastic open-source software made available to us at no cost we are in a very fortunate position. We could design and develop websites entirely with free software if we so choose. Hell, if we wanted we could go to the landfill and probably pick up a free old computer that would be perfectly adequate to develop a website on. Now think about the carpenters and dentists and all those other professions that must purchase real physical tools (that wear out) in order to earn a living. £100 doesn't go very far if you need to buy a table saw. On the topic of open-source, think about what Mr Ryan Cramer has provided us with in ProcessWire. People with his level of skill do not need to be contributing their time for free to open-source projects - they are in very high demand for all kinds of lucrative work. Purchasing a Pro module from Ryan is a way to show appreciation for the generous work he puts into PW. PW is not just great free software, it is great software full-stop. You mention previously having worked with Drupal and Craft CMS. Time is money, so think of all the money you have saved by the quick development workflow that PW allows vs Drupal. And Craft CMS costs USD$299 per website and is still not as powerful as the PW core. Ryan's Pro modules are insanely good value for money. The price that you can purchase a dev license that allows you unlimited use of the modules is more than reasonable. For comparison, here is one of the most popular addons for Concrete5: http://www.concrete5.org/marketplace/addons/block-designer-pro There is no unlimited license, and a license for 5 installations costs USD$276.25. And it requires "Block Designer" so that's another USD$120 for 5 installations, bringing the cost to USD$396.25. I haven't used it but it looks like it is basically the equivalent of Repeater Matrix. But probably not as elegant. And with ProFields you get another four modules bundled in. For unlimited use. For USD$129. Hope this has helped make the decision a little easier.
×
×
  • Create New...