Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 05/01/2020 in all areas

  1. I hope that you all are having a good week and staying healthy. I’ve been very much focused on preparing a new ProcessWire-powered client’s website for launch, hopefully sometime next week. This is a site that’s already pretty well established with the search engines and such, so I’ve been going through all of the pre-launch QA in terms of optimization, SEO accessibility, mobile testing, getting the multi-language translators everything they need to translate, adding ProCache to the picture, and so on. For me this is one of the most fun parts of development, with relentless optimization and having it all come together… but also one of the most time intensive. This is where all the little details surface, things that need improvement become more apparent, and new ideas keep popping up. It’s also where lots of the bugs are discovered and fixed, and where I sometimes have to slap myself on the head for missing one thing or another, but then of course taking care of it. So that’s been most of this week, and I think likely at least half of next week too. But then it’s back to work on the core and modules, covering issue reports and more. I’ve actually been at work on some parts of the core and ProCache this week as well, but not to the point of finishing anything major. So you’ll see some updates on the core this week, and there’s also lots of stuff pending that’s not yet committed, and it’s all work in progress, so stuff to review later. With kids at home I’m still moving at a little slower pace than usual, but starting to get the hang of it, doing well and building momentum. While I don’t have much new to offer in this update, thanks for reading anyway, and I hope that you have a great weekend!
    6 points
  2. The class files should always be named the same as the class by convention, yes. So either use ProductsPagesType -> ProductsPagesType.php or Products -> Products.php. This is in accordance with PSR-4, but it's also just for your sanity. If you want to find something when you come back to this project after some time, having a direct mapping between the class namespace & classname and the folders / files they're located in will be a huge timesaver in finding what you're looking for. Especially if you start to use sub-namespaces. If you want to use Products as your classname, why not just name the file Products.php as well? I don't completely understand what classLoader->addSuffix does by it's documentation, but you could just go the easy route and add your classes directory to the autoloader for the ProcessWire namespace: wire('classLoader')->addNamespace('ProcessWire', '/path/to/classes/'); This way you don't have to load classes manually and can add as many as you want. I don't know how this all interacts with the page classes support in 3.0.152, but the autoloader stuff should work in any case. By the way, the PagesType is an older feature, the new classes directory is for custom Page types, not PagesType classes as far as I understood it ... maybe that's why ProcessWire is not loading your classes correctly. Hope this helps!
    3 points
  3. If you work with deeply nested / large JSON data and you use Adminer, the latest update will allow you to speed things up significantly with a few new config options. I've also included a PR to the JSON preview plugin which this functionality relies on - my changes ensure the max text length setting is applied to json that is kept as a string due to the max level setting.
    3 points
  4. That dev version number is automatically updated from Github (AFAIK) but not sure how often it is called. It is showing 3.0.155 as of right now. Regardless it will always download the latest dev version.
    2 points
  5. If I do understand you correctly I have build a Module for this some years ago: https://github.com/Da-Fecto/ProcessPageListerUrls Haven't used it in ages, but maybe it stil works.
    2 points
  6. Never tried this module, but it looks like this is what you are looking for:
    2 points
  7. @zoeck , thanks! It's a problem with the caption of download button. It says 3.0.153 but in fact it triggers the download of 3.0.155. Only the caption should be changed!
    2 points
  8. Okaydokes, I've opened an issue here https://github.com/processwire/processwire-issues/issues/1166
    2 points
  9. This is the relative URL that @Jan Romero was referring to here: ? Welcome to the forums @Sabine
    2 points
  10. 2 points
  11. CodePen support for Flutter https://medium.com/flutter/announcing-codepen-support-for-flutter-bb346406fe50
    2 points
  12. A new module that hasn't had a lot of testing yet. Please do your own testing before deploying on any production website. Custom Paths Allows any page to have a custom path/URL. Note: Custom Paths is incompatible with the core LanguageSupportPageNames module. I have no experience working with LanguageSupportPageNames or multi-language sites in general so I'm not in a position to work out if a fix is possible. If anyone with multi-language experience can contribute a fix it would be much appreciated! Screenshot Usage The module creates a field named custom_path on install. Add the custom_path field to the template of any page you want to set a custom path for. Whatever path is entered into this field determines the path and URL of the page ($page->path and $page->url). Page numbers and URL segments are supported if these are enabled for the template, and previous custom paths are managed by PagePathHistory if that module is installed. The custom_path field appears on the Settings tab in Page Edit by default but there is an option in the module configuration to disable this if you want to position the field among the other template fields. If the custom_path field is populated for a page it should be a path that is relative to the site root and that starts with a forward slash. The module prevents the same custom path being set for more than one page. The custom_path value takes precedence over any ProcessWire path. You can even override the Home page by setting a custom path of "/" for a page. It is highly recommended to set access controls on the custom_path field so that only privileged roles can edit it: superuser-only is recommended. It is up to the user to set and maintain suitable custom paths for any pages where the module is in use. Make sure your custom paths are compatible with ProcessWire's $config and .htaccess settings, and if you are basing the custom path on the names of parent pages you will probably want to have a strategy for updating custom paths if parent pages are renamed or moved. Example hooks to Pages::saveReady You might want to use a Pages::saveReady hook to automatically set the custom path for some pages. Below are a couple of examples. 1. In this example the start of the custom path is fixed but the end of the path will update dynamically according to the name of the page: $pages->addHookAfter('saveReady', function(HookEvent $event) { $page = $event->arguments(0); if($page->template == 'my_template') { $page->custom_path = "/some-custom/path-segments/$page->name/"; } }); 2. The Custom Paths module adds a new Page::realPath method/property that can be used to get the "real" ProcessWire path to a page that might have a custom path set. In this example the custom path for news items is derived from the real ProcessWire path but a parent named "news-items" is removed: $pages->addHookAfter('saveReady', function(HookEvent $event) { $page = $event->arguments(0); if($page->template == 'news_item') { $page->custom_path = str_replace('/news-items/', '/', $page->realPath); } }); Caveats The custom paths will be used automatically for links created in CKEditor fields, but if you have the "link abstraction" option enabled for CKEditor fields (Details > Markup/HTML (Content Type) > HTML Options) then you will see notices from MarkupQA warning you that it is unable to resolve the links. Installation Install the Custom Paths module. Uninstallation The custom_path field is not automatically deleted when the module is uninstalled. You can delete it manually if the field is no longer needed. https://github.com/Toutouwai/CustomPaths https://modules.processwire.com/modules/custom-paths/
    1 point
  13. The collection panel does allow for an ›Add New‹ button. It's just not documented at the moment. You can either specify the child page's template or the parent page and it'll figure it out. For the template option to work, the child template must have a default parent defined. This should work: $panels->add([ 'panel' => 'collection', 'title' => 'Widgets', 'data' => [ 'collection' => 'template=widget, limit=6', // Option A: Add to child template's defined parent page 'template' => 'widget', // Option B: Add to specific parent page (page, ID or selector) 'parent' => 'template=widget-list', ] ]);
    1 point
  14. For me it's still showing 3.0.153. Tried it using different browsers so it's definitely not the caching issue. Maybe it's because i'm in Russia? ?
    1 point
  15. Interesting... My Download Page looks like this
    1 point
  16. Unfortunatelly it is a long standing issue, which dates back to years. There is some sort of automation which should update it (as Ryan explained in the past), but it works rather hackticly (as it turns out).
    1 point
  17. If the target page (new parent) doesn't have already children you need to mark (click) it before moving the other page.
    1 point
  18. I use this 5 lines of code, placed in an access controlled folder under root, to run a cronjob at fixed time. Just set 'cycle' in module settings to 'none' to prevent database backups triggered by LazyCron as well. <?php namespace ProcessWire; $root = dirname(__DIR__); include_once("$root/index.php"); $cdb = $modules->CronjobDatabaseBackup; $cdb->cronBackup(); Thanks for the input. I thought about it. In the end, I'll leave it as it is, and the inclusion of manually created dumps in the cleaning routine remains the standard. When I manually create a dump, I usually move or download it immediately. I rarely (never?) leave it on the live server and I want the files removed automatically. The default name created by ProcessDatabaseBackups is the database name. Just use this as the 'stopword' and use a different name format in the setup of CronjobDatabaseBackup and voila it works exactly as you want it. Furthermore there is also the option to save the files in a user-defined directory. Manually created dumps are then never affected by the CDB's cleaning routine.
    1 point
  19. https://modules.processwire.com/modules/process-hanna-code/ https://modules.processwire.com/modules/hanna-code-dialog/
    1 point
  20. http://www.openwebanalytics.com/ ?!
    1 point
  21. Try to url instead of httpurl <img src="<?php echo $bild->httpUrl; ?>"> to <img src="<?php echo $bild->url; ?>">
    1 point
  22. Just Go to the Downloads Page: https://processwire.com/download/core/ theres the current Master and dev Version (3.0.155)
    1 point
  23. Ah, I think the missing certificate is actually the reason Chrome refuses to load the images, because they’re coming from a different domain (www. vs. no www.). This happens in Firefox as well. If you use a relative address like you did in the sidebar, it should work. Edit: so the problem was in fact visible in your initial code snippet. My apologies ?
    1 point
  24. Kind of doubt it’s a difference in how Chrome and the other browsers interpret the HTML ? It’s probably a CSS or JS thing. Have you been looking at the developer tools? Maybe there is something helpful in the javascript console. It’s going to be difficult to debug from afar. Is the site online anywhere?
    1 point
  25. This post covers a few of the bigger updates in ProcessWire 3.0.154 and 3.0.155 on the dev branch. This includes a new function for live replacement of text in core and modules, a new method for creating canonical URLs, and some major upgrades to our $input->urlSegment() method that I think you’ll like! This continues from last week’s post in the ProcessWire support forum about 3.0.154 core updates and includes several new details— https://processwire.com/blog/posts/pw-3.0.155/
    1 point
  26. This one is because you cannot use case sensitive filenames on systems like windows. If you would have myFileName.jpg and then you would get and save MYfileNAME.JPG, the latter would overwrite the first. And for the issue in general, I would file an issue on Github, so that Ryan get recognition of it. Maybe he than knows what is the best place to fix that.
    1 point
  27. FYI, I include an "ignore" field to my templates that allows for control over a page's visibility in menus, search results, and the sitemap. Then, I add that logic to the appropriate template files: // Hide from XML sitemap case ($page->hasField("ignore") && $page->ignore->hasValue("sitemap_ignore")): return ""; break; // Hide child pages from XML sitemap case ($page->parent->hasField("ignore") && $page->parent->ignore->hasValue("sitemap_ignore_children")): return ""; break; Here is the exported field in case anyone else wants to do the same: { "ignore": { "id": 392, "name": "ignore", "label": "Visibility", "flags": 0, "type": "FieldtypeOptions", "inputfieldClass": "InputfieldCheckboxes", "collapsed": 2, "optionColumns": 0, "tags": "meta", "icon": "ban", "initValue": "", "showIf": "", "themeOffset": "", "themeBorder": "", "themeColor": "", "columnWidth": 100, "required": "", "requiredIf": "", "defaultValue": "", "export_options": { "default": "1=menu_ignore|Hide page from navigation menus\n2=menu_ignore_children|Hide child pages from navigation menus\n3=search_ignore|Hide page from site search results\n4=search_ignore_children|Hide child pages from site search results\n5=sitemap_ignore|Hide page from XML sitemap\n6=sitemap_ignore_children|Hide child pages from XML sitemap" } } }
    1 point
  28. Yes that was the issue however shouldn't I get an exception?
    1 point
  29. Quick 'n' dirty guide if you want a single page tree with the same content in different languages. The URLs will then look like example.com/en/my-article or example.com/de/mein-artikel 1:) Download and install ProcessWire 2:) Install the modules you find under the "Language" Tab. 3:) Go To Setup->Languages and add new languages. Please note, that the default one is also the default language of your site* 4:) For every field type text or textArea change the Type to TextAreaLanguage or TextLanguage. (e.G. body with TextArea becomes body with textAreaLanguage). You fields should now have multiple tabs for each language, if you edit a page. 5:) Go to the root page (/) and look under "Settings" Setup an URL for every language, e.g. en,de,ru,... . Looks like this: http://take.ms/34Tq5 6:) Create pages and fill in the content. You can build a front end language switch as described in Ryans API Language page. ProcessWire will take care of changing URLS (e.g. /en/example to /de/beispiel) and you can access the current language via $user->language; *It's possible later to define another language as the default language.
    1 point
×
×
  • Create New...