Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 08/19/2019 in all areas

  1. I wrote an api-module a few years ago, where the module generated a custom template (e.g. "api-page"), which could be used to create one or more endpoint-pages. To handle calls to these pages I used ProcessPageView::pageNotFound like @bernhard did: $this->addHookBefore('ProcessPageView::pageNotFound', $this, 'handleApiRequest'); public function handleApiRequest(HookEvent $e) { $page = $e->arguments[0]; if ($page->template === 'api-page') { // handle request here... $otherEvent = $e->arguments(0); // grab event provided to PageRender::renderPage $e->replace = true; // prevent PageRender::renderPage from being called } } It worked nice for me, but I cannot say if caching or multi-language works better in this hook. pageNotFound should be called later than execute, so there is a chance that it helps ?‍♂️
    3 points
  2. @Gadgetto My bad. I misled you a bit. I can't find it now, but @teppo made an excellent post about the executeWhatever() aspect of Process modules. In Process Modules, unlike URL segments in the frontend, ProcessWire will 'jealously guard' the first URL Segment, i.e. the Whatever part of execute....(). In other words, if your Process module has a first URL segment, it will look for a method in your Process module named executeYourFirstURLSegment(). If it doesn't find that, rather than render what is in execute(), it returns the error, Processwire: Unrecognized Path and the content The process returned no content. However, this only applies to the first URL Segment. After that, i.e. 2nd, 3rd, etc URL segments will resolve to whatever you decide based on the code you have in the method of the first URL Segment. For instance, in the case /admin/mymodule/firsturlsegment/whatever/, ProcessWire will not complain if there is no 'whatever' as long as firsturlsegment has content. Please find an example Process module below and the demo of it. The example is a bit rudimentary but you get the idea. Normally, I don't include the content of what I want the 2nd, etc URL segments to resolve to within the executeWhatever() method itself. I usually throw those in their own methods or even class. Example In this example, executeColours() is our gateway to anything we want the 2nd URL segment to resolve to. The 'red', 'green', etc segments do not exist independently (i.e. no corresponding executeXXX() methods for them). ProcessWire does not complain since the first segment /colours/ exists as executeColours(). Demo
    2 points
  3. Please don't use this module any more. I think in the end it just adds more complexity (and dependencies) than benefits. See this tutorial how simple it is to create a custom runtime-only Inputfield: WHY? I've started building this module because the existing solutions by @kongondo and @kixe (https://modules.processwire.com/modules/fieldtype-runtime-markup/ and https://github.com/kixe/FieldtypeMarkup) did not exactly fit my needs. Actually this module is aimed to be a base module that can easily be extended by other modules. It takes care of the heavy lifting that has to be done when working with custom fieldtypes in ProcessWire (injecting scripts and styles, handling JS events, doing translations). See RockTabulator as an example. I'm quite sure more will follow (eg ChartJS)... WHAT? This module helps you injecting ANY php/html/js/css into any PW backend form (either on a page or in custom process modules). It also comes with a sandbox process module that helps you setup your fields and provides handy shortcuts that integrate with TracyDebugger and your IDE: WHERE ...to get it? At the moment the module is released as early alpha and available only on github: https://github.com/BernhardBaumrock/RockMarkup2 If you have any questions or ideas please let me know ? PS: This module shows how easy it is to extend this module for your very own needs. All you need to do is providing the module's info arrays and then overwrite any methods that you have to modify (eg the InputField's render() method): https://github.com/BernhardBaumrock/RockMarkupExtensionExample
    1 point
  4. Hello folks! Recently we published a new website for Brightline, a Project Management Institute (PMI) initiative together with leading global organizations dedicated to helping executives bridge the expensive and unproductive gap between strategy design and delivery. The previous website was made in Hugo as in the beginning it was a very simple website, but as the business needs changed, I decided to build this version in ProcessWire. Nothing fancy occurs behind the curtains, the need was more on getting some data in a way that makes it easier to create reports and to give access to PW's great admin to another team member. For the other website, that you can see here, I didn't implement a CMS on top of Hugo because for me it was quicker to edit the files and push to the repository. Some content is still being copied but 98% is done. A quick list of modules used: - ProCache, FormBuilder, ProFields, SeoMaestro, PageHits, TracyDebugger, MenuBuilder, AutoSmush, and other custom ones. I'm biased, but there a lot of good and useful content created by us and also by partners and all is free to download. :)
    1 point
  5. For anyone having a similar issue, I finally resolved the issue after reading this post... https://processwire.com/blog/posts/pw-3.0.111/ Adding: $event->name = $pages->names()->uniquePageName($event->name) before: $event->save(); sorted it. Many thanks Nik
    1 point
  6. The newest version of RockGrid now supports RockFinder2 as data source ? $finder = new RockFinder2(); $finder->find('template=basic-page'); $finder->addColumns([ 'title', 'body' ]); $this->setData($finder); Data is available on the JS side via the RockFinder2 property in the GridItem object:
    1 point
  7. In RockFinder2 I'm hooking into ProcessPageView::pageNotFound: https://github.com/BernhardBaumrock/RockFinder2/blob/master/RockFinder2.module.php#L127
    1 point
  8. Thank you for the reply @louisstephens The reference you send seems very promising! Because some project specific reasons, (one is that in a near future the sites could be moved to a dedicated hosting for each one) i prefered the site duplication. In the end i used the "ProcessExportProfile" (Export Site Profile) module, that worked beautifully.
    1 point
  9. Nothing in that regard yet. Let's just try to meet over a drink and learn from that point on whether to set up any form of "infrastructure" at all ?
    1 point
  10. d0h... I'll be in Hamburg that day but please have a beer "auf meinen Deckel"! @marcus is there a https://www.buymeacoffee.com/ or beer button we can join in for the meetup?
    1 point
  11. Hey folks – a quick update: Wireframe 0.5.0 was released couple of days ago. Compared to 0.4.x this version mainly fixes bugs and improves performance – nothing particularly major, but if you're using Wireframe, it's a recommended update. On a loosely related note, Tracy Debugger has been really helpful in figuring things out, identifying bottlenecks, etc. Brilliant module ?
    1 point
  12. Hey @opalepatrick – just a heads-up that I'm moving this thread to the Module/Plugin Development area. The main "Modules" area is only intended for support threads of existing modules.
    1 point
  13. From the docs https://code.google.com/archive/p/jquery-asmselect/ addItemTarget: Where to place new selected items that are added to the list. Allowed values: 'top' or 'bottom' Default: 'bottom'
    1 point
  14. @J_Szwarga are you wanting to implement in frontend or backend? There's no secret or magic for how to set it up, you can look at a demo here for example: https://fullcalendar.io/docs/initialize-globals-demo and when you see the initialization code, you just need to take a look at the events array, which you could generate in PHP using the API, and then JSON endcode, and output in your script tag.
    1 point
  15. You could also use either of these methods/modules: Module Menu Builder - create custom menus, including external links. You decide what will be in it. Module Jumplinks - just create the pages you want and create redirects within Jumplinks (/old/path -> https://wherever.test/). It's easier and it handles more than redirects - like 404s and counts every click on your redirects.
    1 point
  16. Just in case, I use those alias to install or upgrade my installs : # ProcessWire Wireshell bash alias # grab and install the latest ProcessWire development version from the latest commit alias pwnew='wireshell new --sha=`git ls-remote https://github.com/processwire/processwire refs/heads/dev | cut -f1`' # upgrade to the latest ProcessWire development version from the latest commit alias pwup='wireshell upgrade --sha=`git ls-remote https://github.com/processwire/processwire refs/heads/dev | cut -f1`' https://gist.github.com/flydev-fr/addcf54fa8348de20115d3c1314ddb3d
    1 point
  17. Well, I use personally use UIkit 3 + TailwindCSS. Tailwind you are going to hear a whole lot more about in the upcoming months. I know you are talking about file size and this is exactly why UIkit + Tailwind is great! I don't really use UIkit's CSS at all. I just use the JavaScript because the amount of utilities they have manage to pack into 130kb (less than most images) is amazing. I'm talking Parallax, Sliders, Lazy Loading Images, Srcset utilities, placeholder generators, scrollspy, sticky. Most of which can be and usually is utilised in any project. I challenge you to get all of that under 130kb. Also it doesn't have any dependencies. Tailwind you can get down to about 3KB per website using Purge and Gulp/Webpack. It truly is amazing and Utility first CSS is such a refreshing way to work with CSS. I know all the arguments, and I'm a minimalist. I don't like all the classes too. But Tailwind's benifits out weigh the cost. 1. You don't have to struggle with inherited styles, or coming up with class names to define each section, some of which may look the same but be very different in content. 2. Consistency, it puts pressure on you to keep things consistent. So you hardly stray to loads of different type sizes and colours. 3. With Purge, you can have an entire website styles in ~3kb. I believe Ryan chose UIkit 3 because he has learnt the classes and is confident with the framework, and is impressed with the JavaScript utilities. And because you can build website much quicker using it. I see it as a hybrid between utility and a standard framework. It offers many utility classes. You could also Purge UIkit's CSS and get it around 160KB. I don't believe that this isn't a good fit for ProcessWire as you have previously mentioned. Many who use ProcessWire love UIkit. It follows the same philosophy: A powerful framework, that is easy to understand and learn to get things done quicker. Just like ProcessWire gives developers confidence in that they can do challenging bits of functionality easily with the power of ProcessWire's amazing API (like seriously, I built a real estate system using ProcessWire, something I wouldn't have dreamed of doing on any other platform). Well UIkit also gives that confidence to the front-end. But if I was to choose for myself, I much prefer pairing Tailwind for the CSS and UIkit for the JavaScript. That ~140KB (Tailwind + UIkit) covers me for most websites I build.
    1 point
×
×
  • Create New...