Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 02/02/2023 in all areas

  1. $session->foo = 'Foo!'; $wire->addHookBefore("Page::render", function ($event) { bd('hook fired'); bd($this->wire->session->foo); bd($this->wire()->session->foo); bd($event->wire->session->foo); bd($event->wire()->session->foo); bd($event->session->foo); bd($event->session->get('foo')); bd(wire()->session->foo); }); Choose whatever you like bist ? I prefer $this->wire->session->foo
    3 points
  2. So ... we're ditching Google Analytics for one of our sites (hooray) and switching it over to Fathom. Because we wanted to be able to make a comparison between the old stats and the new ones we've had both installed on the site for a couple of months. On top of that the site is behind Cloudflare so we also have stats directly from them. I've just pulled together the stats for the last 30 days: So thats: 37K visitors according to Google, 42K for Fathom 80K for Cloudflare My guess is that a Google is both fussiest about tying requests to real people (cos hey that's what they're after), but also most likely to be blocked by ad blockers and privacy tools. Fathom is probably less likely to be blocked by privacy tools; we use a bespoke domain which hopefully isn't blocked that often. Cloudways isn't is going to be blocked by anything (it's gathering stats at sever level) but maybe is more lenient about what constitures a 'visitor'. I'm not really sure about that but it is a big jump from Google. Anyway - I thought it was an interesting comparison and handy for when you need to explain to clients that analytics are useful for trends but not much cop if you're after real numbers.
    2 points
  3. I totally agree and would have expected RM to work like that. No use for a module-related migration if the module is not installed.
    2 points
  4. www.herzschlag-der-erde.de made with love and Processwire ???
    2 points
  5. Have you tried $body=$files->render('path/to/my/mail-template.html''); ? Are your files namespaced?
    2 points
  6. Modules Directory: https://processwire.com/modules/rock-frontend Github: https://github.com/baumrock/RockFrontend
    1 point
  7. PAGEGRID – A visual page builder for ProcessWire. Design fully responsive websites (or parts of them) without writing any code. Use ProcessWire's native templates (and fields) to create your own blocks. Rearrange and resize items in a visual way and use inline or modal editing to quickly edit the content of your website. Try PAGEGRID for free PAGEGRID is not free software. However, you can try PAGEGRID on your local machine or on a test server as long as you need to make sure it is the right tool for your next project. … and when you’re convinced, buy your license. Get it here Download from GitHub Download from Module Directory Requirements ProcessWire 3.0.210 or greater Installation Go to “Modules > Site > Add New“ in your admin Paste the Module Class Name "FieldtypePageGrid" into the field “Add Module From Directory“ Click “Get Module Info“ On the overview, click “Download And Install“ On the following screen, click “Install Now“ More install options Module install guide Site profile install guide Get up and running Quick start Create your own blocks or install the PageGridBlocks Module (installs premade templates and fields for PAGEGRID blocks). What's PAGEGRID? page-grid.com – Get to know PAGEGRID. Documentation – Read the official documentation. Issues – Report bugs and other problems. Forum – Whenever you get stuck, don't hesitate to reach out for questions and support. Why I build it ProcessWire is super flexible in itself and lets me build whatever I want. But building a custom website can be a lot of work. For some projects, I've ended up using a lot of templates and fields. To make my pages more flexible, I sometimes build my own little page builder based on the RepeaterMatrix or PageTable module. While these page builders were great for the specific site I was building them for, they were never flexible enough to be used for new projects, so I ended up customizing them frequently. The more complex they became, the harder it became to use them for my clients. After playing around with some WYSIWYG page builder tools, I realized that while they can save me a lot of time, they can also be very limiting or have expensive subscriptions and somehow tie you to their ecosystem. So I decided to build my own page builder based on the most flexible CMS I knew. Concept This fieldtype Renders block templates and adds drag and drop functionality in admin, as well as enable inline editing for text, and file fields. It also let's you manipulate CSS in a visual way to design fully responsive websites (or parts of them) without writing code. The fieldtype comes with an optional style panel to manipulate CSS properties directly on the page. You can customize the panel or disable it completely from the module settings (and just use a CSS file that you include in your template). The data to style the items is stored directly on the item using PW's meta data (no extra fields are created). Don't want to give your client all that power? Use ProcessWire’s powerful permission system to control what your clients can edit. You can then also grant access individually to the style panel, resize or drag functionality using ProcessWire's build in permission system. Features Blocks are just pages Blocks are defined by native PW templates and fields Manipulate CSS grid or flexbox based layouts in a visual way to design fully responsive websites (or parts of them) Encapsulated frontend code (PAGEGRID renders the template of your frontend inside an iframe in the backend) Design and editing features can be disabled for certain roles (using ProcessWire's build in permission system) Inline editing of text, textarea, TinyMCE (supports latest version), ckeditor and file fields Simply drag and resize to manipulate grid items directly inside the backend Manipulate grid columns and rows directly on the page (use any number of columns you want) All style manipulations are saved as JSON and used to generate dynamic styles that you render in your main template (no inline styles) Nested groups/grids (child pages of nested blocks are created under group parent) The style panel supports adding custom classes and assigning styles to them. These classes can be used globally on all pages (a css class is also a page) The style panel supports selecting html tags to style tags globally across the whole site Global blocks work with page reference field (changes on one page, changes all blocks on all pages) Manual and auto placement of grid items blocks and nested blocks can be cloned Redo/undo and copy/paste shortcuts Editing block items in modal sidebar immediately updates frontend (Ajax Save). Define custom icons for your blocks via native template settings (template -> advanced -> icon) Automatic page save (Changes are getting saved via ajax, no need to click the save button) NEW: Option to automatically load lazysizes lazyloader (V 0.1.0) Changelog V 0.1.0: Feature: Option to automatically load lazysizes lazyloader (Module Settings > Plugins). V 0.1.5: Fixed bug: Tabs not working when editing items via modal panel. V 0.1.6: Fixed bug: Setting height in VH unit was not working. V 0.1.7: Feature: Option to hide save button (and use automatic ajax save ) if there are no other fields than PAGEGRID on the content tab (Module Settings > Interface). V 0.2.0: Fixed bug: Custom block wrapper element <p> was not working with inline editor. V 0.2.0: Fixed bug: Inline editor would sometimes not save after clicking cancel and then edit item again. V 0.2.0: Feature: Now it's possible to add classes to elements inside richt text fields via style panel. V 0.2.0: Fixed bug: Inline editor was not working after first item was added to the page (needed reloading the page). V 0.2.1: Feature: Updated PageGridBlocks Module: Using TinyMCE as the default editor. V 0.2.1: Feature: Updated PageGridBlocks Module: Group/container wrapper element can now be changed to <div>, <section>, <article>, <header>, <footer>, <nav>. Thanks to everyone who helped me improve my coding skills and for the support of this great community! Special thanks to @diogo for the valuable feedback and @ryan for this great CMS and his support for the PageFrontEdit module!
    1 point
  8. Hello everyone, this is a general support topic. The last time I often had website templates with mega menu including images. So there this is always an advanced topic for me. I normally used ProcessMenuBuilder but this is not suitable for me anymore. So I want to asked the community, how do you build your menus? With module or whatever. Thanks in advance.
    1 point
  9. Hi @MateThemes Usually, If I need something simple I use Repeater field with depth option, if something more advanced I use Repeater Matrix field with depth.
    1 point
  10. The main reason is that outlines are used when tabbing through content and an item is in :focus . So when using outline instead of border the default highlighting in your browser won't work anymore. Another thing is that a border is within or part of the element while an outline is slightly outside of it. So there could be another challenge in more complex designs. Last but not least... using outline wouldn't fix the issue. At least not without further fixes and changes.
    1 point
  11. Of course, it's ProcessWire ?? Just kidding - happy if it was helpful! ?
    1 point
  12. I have the same case where I use a start date and an end one. I add a hook that checks the end date when saving the page and if undefined it copies the start date value, this way you can sort using the end date.
    1 point
  13. Thank you very much, bernhard, it works like a charm ?
    1 point
  14. I think what you are looking for is "outline: 1px solid black;" instead of "border" ?
    1 point
  15. I'm dying to know, am I the only one bothered by (or maybe the only one seeing??) this line under the tabs now? ?
    1 point
  16. Yes, you are right - PHP files will be fetched. Anyway, the strings are still in the default language. No difference to before! ? I guess I have to overthink my template system for sending HTML emails, because the template files are always HTML files. Thank you for your help @gebeer
    1 point
  17. @protro You just need to make sure to pass the files array to the player() method, so your code won't work because you don't have audio on the $page. $page is always the current page; You can reference the other page using $pages->get([pageid]); You can also make your own array of files by creating a WireArray and then adding your audio files to that and then pass the WireArray to the player() method. Based on your description, first you have to get the page array for the playlist, $songPages = $pages->get(/path/to/playlist/parent or Page ID)->children; Then iterate the child pages, adding the audio file from each: $audioFiles = WireArray new(); foreach($songPages as $songPage) { $audioFiles->import($songPage->audio); // if a single audio file field, then $audioFiles-add($songPage->audio); } echo $sm2->player($audioFiles, $options);
    1 point
  18. The way ProcessWire selectors work, this should be sort=-Date_2|Date_1, although I’m neither sure where the hyphens go nor whether sorting allows the pipe operator at all. Alternativey, it’s easy in SQL with coalesce(), or you could add a hidden third field that precomputes to Date_2 ?? Date_1. Edit: doesn’t seem to be supported judging by this open PR https://github.com/processwire/processwire-requests/issues/107
    1 point
  19. Can you rename the include file to .php? Then PW should pick it up for translation.
    1 point
  20. Yeah @Kiwi Chris I think that's the best solution, because then everybody can decide wether he/she wants migrations to run or not. I could disable watching of Module.migrate.php files if the module is not installed, but then you'd have to manually trigger that migrations if you wanted them to be executed and that's harder to do than adding an early exit to the file. I'll add a page to the wiki that describes that behaviour, thx!
    1 point
  21. I didn't have anything in the migrate file to install the module, but I did have code to create a lot of fields and templates and create some pages which all got created. I wanted these to be under the control of migrations, but assumed (incorrectly) migrations would only run on installed modules, ie once the module is installed I do want the migrations file watched and run if there are any changes, but if the module isn't yet installed it doesn't make sense to run its migrations. An easy way to get it to work the way I want is to do a conditional check at the start of the migrations file to see if the module is installed or not, and only run the actual migration code to create fields and templates if the module is installed. That way I won't get a bunch of fields and templates installed for an inactive module.
    1 point
  22. sure, just cleaned it up.. @szabesz
    1 point
  23. Thanks for the info.
    1 point
  24. @Markus Thomas You're a lifesaver! Thanks a lot. It works now on PHP 8.2.
    1 point
  25. You might find this a better approach: https://processwire.com/blog/posts/pw-3.0.173/
    1 point
  26. PR for the above change submitted: https://github.com/processwire/processwire/pull/255 although I expect Ryan might have a more complete solution, but at least that will hopefully get this issue on his radar.
    1 point
  27. I am thinking that this might actually be an easy fix in the PW core. I just did a quick edit, replacing this line: https://github.com/processwire/processwire/blob/cc43f8e67600fc3ad73ea3ac095d67f166c5ca96/wire/templates-admin/scripts/inputfields.js#L1483 with: var field = match[1]; if(field.indexOf('forpage.') == 0) { field = field.replace('forpage.', '').replace(/\_repeater\d+/g, ''); } This lets me use: forpage.fieldname=value as described by @999design in the OP. @ryan - can you see any problems with this approach? Maybe I've overlooked something? Note that this approach currently won't work with AJAX loaded repeater items.
    1 point
  28. @999design - I just found myself wanting this exact functionality. The easiest way for now seems to be Robin's https://processwire.com/modules/custom-inputfield-dependencies/. The custom PHP option does the trick with something like this: $p = $page->getForPage(); if($p->field_name == 'value') return true; return false; The caveat is that the conditions provided by this module are only applied on page load, not instantly via JS like the PW core feature. But definitely better than nothing for now.
    1 point
  29. LogMaintenance A simple ProcessWire module to give some maintenance control over log files. I found myself often having lots of log files for different things that can grow more or less quickly to a size where they can be difficult to maintain. The built in Logger of PW does a good job of giving you the possibility to delete or prune logs. But it has to be done manually and sometimes a log grows into millions of lines, which makes it often impossible to even prune it as it's too large. LogMaintenance uses LazyCron to run the maintenance task and there's several settings you can setup on a global or per log basis. Archive: will create zip files for each log file in logs/archive/ folder and add the log each time the maintenance is run to a subfolder containing the datetime. Lines: keeps logs to a certain number of lines Days: keeps the log to a certain number of days Bytes: keeps the log to a certain amount of bytes Each setting is checked from top down, the first setting to contain something is used. So if you check the "Archive" option, all other settings are ignored and logs are archived everytime the LazyCron is executed. If you want to keep your logs to a certain amount of bytes just leave all other settings to 0 or blank. Per Log Settings There's a textarea that you can use to setup a config for a specific log file one per line. All the logs you define here ignore the global settings above. The syntax for the settings is: logname:[archive]:[lines]:[days]:[bytes] errors:1:0:0:0 // would archive the errors log messages:0:10000:0:0 // will prune the errors log to 10000 lines The module can be found on github for you to check out. It's still fresh and I'm currently testing. https://github.com/somatonic/LogMaintenance
    1 point
  30. This module has several bugs. Line 113 must be: if($archive == '1') { Line 159 must be: if($this->archive == '1') { Line 295 must be: $field->attr('name', 'bytes'); Forked here: https://github.com/techcnet/LogMaintenance
    1 point
  31. hi guys i'm read this thread an find big error in your configs Please do not use try_files - this config keyword add in nginx special for stupid Wordpress users (c) Igor Sysoev [main nginx developer] this instruction in config make nginx lowerest For exemple more fast equival: error_page 404 = @php-fpm; location ~ \.php$ { fastcgi_pass unix:/var/run/php/php7.0-fpm.sock; include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; } location @php-fpm { fastcgi_pass unix:/var/run/php/php7.0-fpm.sock; include fastcgi_params; fastcgi_param it $uri; fastcgi_param SCRIPT_FILENAME $document_root/index.php; }
    1 point
  32. server { listen 443 ssl http2; listen [::]:443 ssl http2; server_name example.com; root /home/forge/example.com/public; index index.html index.htm index.php; charset utf-8; # ----------------------------------------------------------------------------------------------- # Access Restrictions: Protect ProcessWire system files # ----------------------------------------------------------------------------------------------- # Block access to ProcessWire system files location ~ \.(inc|info|module|sh|sql)$ { deny all; } # Block access to any file or directory that begins with a period location ~ /\. { deny all; } # Block access to protected assets directories location ~ ^/(site|site-[^/]+)/assets/(cache|logs|backups|sessions|config|install|tmp)($|/.*$) { deny all; } # Block acceess to the /site/install/ directory location ~ ^/(site|site-[^/]+)/install($|/.*$) { deny all; } # Block dirs in /site/assets/ dirs that start with a hyphen location ~ ^/(site|site-[^/]+)/assets.*/-.+/.* { deny all; } # Block access to /wire/config.php, /site/config.php, /site/config-dev.php, and /wire/index.config.php location ~ ^/(wire|site|site-[^/]+)/(config|index\.config|config-dev)\.php$ { deny all; } # Block access to any PHP-based files in /templates-admin/ location ~ ^/(wire|site|site-[^/]+)/templates-admin($|/|/.*\.(php|html?|tpl|inc))$ { deny all; } # Block access to any PHP or markup files in /site/templates/ location ~ ^/(site|site-[^/]+)/templates($|/|/.*\.(php|html?|tpl|inc))$ { deny all; } # Block access to any PHP files in /site/assets/ location ~ ^/(site|site-[^/]+)/assets($|/|/.*\.php)$ { deny all; } # Block access to any PHP files in core or core module directories location ~ ^/wire/(core|modules)/.*\.(php|inc|tpl|module)$ { deny all; } # Block access to any PHP files in /site/modules/ location ~ ^/(site|site-[^/]+)/modules/.*\.(php|inc|tpl|module)$ { deny all; } # Block access to any software identifying txt files location ~ ^/(COPYRIGHT|INSTALL|README|htaccess)\.(txt|md)$ { deny all; } # Block all http access to the default/uninstalled site-default directory location ~ ^/site-default/ { deny all; } #Amplify dashboard location /nginx_status { stub_status on; allow 127.0.0.1; deny all; } # ----------------------------------------------------------------------------------------------- # If the request is for a static file, then set expires header and disable logging. # Give control to ProcessWire if the requested file or directory is non-existing. # ----------------------------------------------------------------------------------------------- location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|eot|woff|ttf)$ { expires 15d; log_not_found off; access_log off; try_files $uri $uri/ /index.php?it=$uri&$query_string; } # ----------------------------------------------------------------------------------------------- # ProCache Rules # ----------------------------------------------------------------------------------------------- set $cache_uri $request_uri; if ($request_method = POST) { set $cache_uri 'nocache'; } if ($http_cookie ~* "wires_challenge") { set $cache_uri 'nocache'; } if ($http_cookie ~* "persist") { set $cache_uri 'nocache'; } # ----------------------------------------------------------------------------------------------- # This location processes all other requests. If the request is for a file or directory that # physically exists on the server, then load the file. Else give control to ProcessWire. # ----------------------------------------------------------------------------------------------- location / { expires -1; try_files /site/assets/ProCache-b3d534d...d/$cache_uri/index.html $uri $uri/ /index.php?it=$uri&$args; } location = /favicon.ico { access_log off; log_not_found off; } location = /robots.txt { access_log off; log_not_found off; } access_log off; error_log /var/log/nginx/example.com-error.log error; error_page 404 /index.php; location ~ \.php$ { fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_pass unix:/var/run/php/php7.2-fpm.sock; fastcgi_index index.php; include fastcgi_params; } location ~ /\.ht { deny all; } }
    1 point
  33. Not sure why it half-works with role names, but the Roles field is a Page field and the correct way to match a Page field in an inputfield dependency is by ID. https://processwire.com/api/selectors/inputfield-dependencies/#example-page
    1 point
×
×
  • Create New...