Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 04/14/2020 in all areas

  1. Hi @palacios000 There is no setting to strip HTML tags, you'd need to use the following hook to transform the value prior to being rendered by the module: https://github.com/wanze/SeoMaestro#___renderseodatavalue Cheers
    2 points
  2. Hello Everyone, Sorry that I have not been on the forums much of late. As my development team moves to use ProcessWire as our main cms tool for clients. We have needed to make sure that ProcessWire works on nginx platform. We use both apache and nginx, we found as many already have that nginx is faster and easier to configure. It scales well and when you really need speed it is a great solution. Anyways with all that being said ProcessWire was surprisingly easy to configure for nginx and did not require adding or modifying any code. Using the same "try_files" directives used for Wordpress and Dupral I was able to run it under nginx, here is a sample config: upstream php { server unix:/tmp/php-cgi.socket; server 127.0.0.1:9000; } server { listen 80; server_name hostname; root /websites/path/to/processwire; index index.php; try_files $uri $uri/ /index.php?it=$uri&$args; location ~ \.php$ { fastcgi_split_path_info ^(.+\.php)(/.+)$; include fastcgi.conf; fastcgi_intercept_errors on; fastcgi_pass php; } } There are a few things that still need to be done like protecting the wire and certain directories like assets but so far everything looks to be working correctly. If ProcessWire has a test suite, I could run it against this server to see if everything is functioning properly. I think that advertising the fact that ProcessWire works under nginx would greatly help to attract more eyes to the project(not that it isn't doing great already) and to give options to hosting and scalability. If you would like help working on this for official support of the platform, perhaps with adding detection algorithms to the install or anything else that is needed, I would be glad to help. Anyways I hope someone finds this post useful.
    1 point
  3. TrelloWire This is a module that allows you to automatically create Trello cards for ProcessWire pages and update them when the pages are updated. This allows you to setup connected workflows. Card properties and change handling behaviour can be customized through the extensive module configuration. Every action the module performs is hookable, so you can modify when and how cards are created as much as you need to. The module also contains an API-component that makes it easy to make requests to the Trello API and build your own connected ProcessWire-Trello workflows. Warning: This module requires ProcessWire 3.0.167 which is above the current stable master release at the moment. Features All the things the module can do for you without any custom code: Create a new card on Trello whenever a page is added or published (you can select applicable templates). Configure the target board, target list, name and description for new cards. Add default labels and checklists to the card. Update the card whenever the page is updated (optional). When the status of the card changes (published / unpublished, hidden / unhidden, trashed / restored or deleted), move the card to a different list or archive or delete it (configurable). You can extend this through hooks in many ways: Modifiy when and how cards are created. Modify the card properties (Target board & list, title, description, et c.) before they are sent to Trello. Create your own workflows by utilizing an API helper class with many convenient utility methods to access the Trello API directly. Feedback & Future Plans Let me know what you think! In particular: If you find any bugs report them here or on Github, I'll try to fix them. This module was born out of a use-case for a client project where we manage new form submissions through Trello. I'm not sure how many use-cases there are for this module. If you do use it, tell me about it! The Trello API is pretty extensive, I'll try to add some more helper methods to the TrelloWireApi class (let me know if you need anything in particular). I'll think about how the module can support different workflows that include Twig – talk to me if you have a use-case! Next steps could be a dashboard to manage pages that are connected to a Trello card, or a new section in the settings tab to manage the Trello connection. But it depends on whether there is any interest in this ? Links Repository on Github Complete module documentation (getting started, configuration & API documentation) TrelloWire in the modules directory Module configuration
    1 point
  4. Last week I posted in the blog about current projects in progress, and consistent with that, this week I’ve been working primarily on the upgrades to our file/image fields. To start, this focuses on storing additional info in the DB table, including file size, created/modified user info, and for image fields: width and height. This is useful in making these properties searchable from page-finding selectors, but also a necessary pre-requisite to supporting external file systems. A “ratio” floating point property is now available on image fields as well (and also stored in the DB) and this value reflects the width divided by the height. This is a searchable property and will be useful for quickly finding portrait images, landscape images, square images, or any proportion you need to find. If you want to find images that are at least twice as wide as they are tall, then you’d be looking for a “ratio” of 2.0 or larger (“ratio>=2”). If you needed to find perfectly square images (i.e. 300x300) then you’d be looking for a ratio of 1.0. If you needed to find portrait images, then you’d be looking for images with a ratio under 1.0 (or twice as tall as wide would be 0.5). You can figure out what ratio you are looking for just by taking your target width and dividing by your target height. Longer term, combined with the other added properties, the goal is that this will help with finding pages that have images suitable for specific placements, proportions and dimensions. These new properties won’t be useful at first on existing sites because the data just isn’t present in the DB, even if the columns to store them are. They are populated over time whenever the page is saved. But I’m going to enable an option to have it populate all of this automatically whenever the field is even loaded. It’s actually there in the core right now, but I’ve got it disabled so I can test it out on a few more of my installations before others start using it. There were some other upgrades to the core as well, including improvements to the Selector and Selectors classes, addition of a $database->columnExists() method, lots of new (mostly internal) methods in FIeldtypeFile/FieldtypeImage, and some refactoring of the FieldtypeMulti class, among other minor updates. While there were a lot of changes and additions this week, it’s not stuff that you’ll likely be using right away, so I’m going to hold off on bumping the version till next week. Thanks for reading and have a great weekend!
    1 point
  5. @Jan Romero Thanks! The positioning of output formatting was the issue. The code just needs to be- $page_to_change->of(false); $page_to_change = $pages->get("name=xyz"); $page_to_change->resume->deleteAll(); //OR //$page_to_change->resume->delete($page_to_change->resume); $page_to_change->save(); This will make $page_to_change->resume be a Pagefiles array rather than just an object; thus both the deleteAll() and delete($Pagefile) functions work on it now.
    1 point
  6. Hi there, first the answer depends on that if your array "children" is PageArray. If yes I believe if you want currently viewed page you must check if child->id is simalar like page->id not parent->id. Secondly if you want to check if checkbox is checked the right way will be: $child->checkbox_field == 1 Also I think you know this but else if must be put before else statement :D. Lastly maybe consider using custom menu builder for this. Menu Builder. In addition this checking can be done before building actual markup for menu. So you can consider this solution an then you won't need else if. $menuPages = $pages->find('menu_item=1'); //and add additional selectors for template etc., also you can use selector like this for method children() Cheers.
    1 point
  7. What does the error in Google Chrome console say, Processwire $config->urls->templates works, there must be an error message and if you are on a unix system, what is your permission level too ?
    1 point
  8. Just added onother fix that has been bugging me for years: https://github.com/processwire/processwire/pull/169 https://github.com/BernhardBaumrock/PwQuickFixes/commit/74c1378d0274bd6a99147bac597490d0113c2633
    1 point
  9. Hi Chris, sure I don't mind. Please just share your thoughts and findings, so we can improve this language pack where needed. Have a great week! Pozdrowienia! ?
    1 point
  10. Hi! Thanks a lot for the updates! I took me over a year to finally dig into PW and start to use it in more serious way and I've been doing it for few weeks now. First of all I'm catching up with A LOT of things here and trying to do things properly. Learning to use Git and GitHub for a start... ? Now. I've started a new project with PW which will be a base for other projects and our customs solutions. Your package is a gift from heaven here but there are still minor typings errors or tentative translations. I'll try to step up here a little bit and instead of opening an issue I'll try to fork your project and make some commits where necessary. Hope you don't mind such a path. Zdrowych (!!!) i radosnych Świąt Wielkanocnych! ? Pozdrawiam, Krzysztof
    1 point
  11. Your code as well as eelkenet’s should work if you set output formatting to false at the top instead of at the bottom. AFAIK, without output formatting, File fields always return a WireArray, or rather, a Pagefiles array, which inherits from WireArray. In general the reason you disable output formatting is that you can work with the “raw” data before saving. Changing the formatted data and then only disabling output formatting before the save() should be pointless and/or introduce errors. For example, if you have a field with Markdown formatting and you modify its contents without disabling output formatting, you’re modifying and saving the rendered HTML, destroying your original Markdown markup.
    1 point
  12. An easier way to set the status code: http_response_code(303); Available since PHP 5.4.
    1 point
  13. @Roope, a feature request: it would be great if it was possible to avoid the email replacement within elements that are given a particular HTML class, e.g. "no-emo". My current issue is that if I show an email address as the value of a text input or textarea then EMO replaces those strings, which create invalid markup. Probably EMO shouldn't touch emails that are the values of form elements, but it would also be handy to be able to disable EMO inside other elements so I thought I'd request that class option.
    1 point
  14. Hey Ryan — just wanted to say thanks. Assuming that I've got this right and this could mean that eventually ProcessWire can natively (or at least with a module that doesn't have to rely on any weird tricks) support something like S3 or Google Cloud Storage, this is a brilliant move! Very much looking forward to that. Thanks again, and keep up the great work ?
    1 point
  15. Hi Ryan, as always great to hear about the progress ? I have no idea how that will work internally, but this sounds like it might be a good time to also think about having a setting for a custom storage path in core file fields. Maybe that will be possible anyhow by default (like providing an external file system driver that actually stores files on the local file system). But if not this would be a huge improvement in many cases: File fields in module config File uploads with custom storage path in processModules Maybe having a file field on multiple pages sharing one single storage location (like a global gallery) Thx ?
    1 point
  16. Sorry, forgot to mention that @David Karich added support for options fields and slide ranges, so there is no need for manually doing joins like shown before ? How to create custom column types It is really easy to create custom column types that can retrieve any data from the PW database. See this commit for two simple examples: https://github.com/BernhardBaumrock/RockFinder2/commit/54476a24c78ae4d3b6d00f8adfb2c8cd9d764b9d If the fieldtype is of broader interest please consider making a PR. If you are the only one needing it add the type via hook. Adding a custom column type is as simple as this: $f->addColumns(['FieldOptionsValue:your_options_fieldname']);
    1 point
  17. Hey @ryan I tried setting a different templates folder today but the result seems weird to me. Am I doing it wrong? I'd have expected that if I set the templates location to /site/templates/theme1 the homepage should show /site/templates/theme1/home.php but in fact it shows a 404 because /site/templates/home.php does not exist and the page is taken as not viewable... Is that expected?
    1 point
  18. That reminds me what I proposed before, make 2 versions of Processwire: 1) a version just for small websites, without cmf, no database or an xml database 2) the current version with the powerful api for both cmf and cms
    1 point
  19. Hey everyone searching for this topic — if you're using Let's Encrypt with URL validation, don't forget to replace the part blocking dotfiles location ~ /\. { deny all; } With block denying everything BUT .well-known location ~ /\.(?!well-known).* { deny all; }
    1 point
  20. 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
  21. 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
  22. Anybody got a working config for 3.0.x I can steal?
    1 point
  23. Hi, I do it this way: in /site/modules/InputfieldCKEditor/styles.js I have: CKEDITOR.stylesSet.add( 'mystyles', [ { name: '1/2 left align', element: 'img', attributes: {'class': 'align_left uk-float-left uk-width-1-2@s site-mar-r-10'} }, { name: '1/2 right align', element: 'img', attributes: {'class': 'align_right uk-float-right uk-width-1-2@s site-mar-l-10'} }, { name: '1/3 left align', element: 'img', attributes: {'class': 'align_left uk-float-left uk-width-1-3 site-mar-r-10'} }, { name: '1/3 right align', element: 'img', attributes: {'class': 'align_right uk-float-right uk-width-1-3 site-mar-l-10'} }, { name: '1/4 left align', element: 'img', attributes: {'class': 'align_left uk-float-left uk-width-1-4 site-mar-r-10'} }, { name: '1/4 right align', element: 'img', attributes: {'class': 'align_right uk-float-right uk-width-1-4 site-mar-l-10'} }, { name: 'center image', element: 'img', attributes: {'class': 'align_center uk-align-center'} }, ]); align_left and similar are for the default I copied over from /wire/modules/Inputfield/InputfieldCKEditor/contents.css uk-float-left and similar are for UIkit 3 This way I do not have to load the whole UIkit 3 css for CKEditor, instead I write my custom rules for the RTE in order the get what will be seen on the frontend. It is some extra work but there are not too many styles needed to be used in the RTE anyway.
    1 point
  24. I'm using this function in places, seems to work well: /** * Given an email address render the obfuscated version * * @param $strEmail - an email address * */ function createMailto($strEmail) { $strNewAddress = ''; for($intCounter = 0; $intCounter < strlen($strEmail); $intCounter++){ $strNewAddress .= "&#" . ord(substr($strEmail,$intCounter,1)) . ";"; } $arrEmail = explode("&#64;", $strNewAddress); $strTag = "<script type='text/javascript'>\n"; $strTag .= "<!--\n"; $strTag .= "document.write('<a href=\"mai');\n"; $strTag .= "document.write('lto');\n"; $strTag .= "document.write(':" . $arrEmail[0] . "');\n"; $strTag .= "document.write('@');\n"; $strTag .= "document.write('" . $arrEmail[1] . "\">');\n"; $strTag .= "document.write('" . $arrEmail[0] . "');\n"; $strTag .= "document.write('@');\n"; $strTag .= "document.write('" . $arrEmail[1] . "<\/a>');\n"; $strTag .= "// -->\n"; $strTag .= "</script><noscript>" . $arrEmail[0] . " at \n"; $strTag .= str_replace("&#46;"," dot ",$arrEmail[1]) . "</noscript>"; return $strTag; } also works well in a hanna code, and doesn't require any additional js files
    1 point
  25. I think this is wrong - you don't want to be doing another $pages->find() inside your pagination function (I don't think you need to execute your pagination in a function, TBH). The basic flow of your search template should be: // sanitize and build your $selector from $input->get() // ... // find your search results $results = $pages->find($selector); // output your search results foreach($results as $result) { //... } // render your pagination from the $results PageArray echo $results->renderPager(array('arrayToCSV' => false));
    1 point
  26. NGINX isnt just good for VPS with small amount of memory, its good for websites with tons of traffic as well! Even easier to get working than trying to make apache work right. Looking forward to the official support for this!
    1 point
  27. Hi all. I have a successfully installed and running PW site on NGINX on a Rasp Pi 3. It all went well and easy thanks to the hints and tricks in this thread. However even though I hits the frontpage nicely then any navigation to anything on the site returns a 404 - even the admin panel URL. I suspects that it does not properly pass the URL to processwire but is instead trying to move to a directory. Any ideas?
    1 point
  28. I've just tested these with 2.5 and everything is running nice and smooth.
    1 point
  29. Hi. (My first post in this forum after creating my first site with Processwire ) Only to let you know that the u-nikos's nginx configuration works perfect with Processwire 2.4 I think you can add "official" support and link to his comment for the configuration. I had doubts about how difficult it would be at the beginning and maybe there are people in the same position without knowing that it's really easy to make it works. I'll work a little more with nginx caching (or microcaching). I'll let you know if I do some advances in this area. Best
    1 point
  30. This worked like charm for me with Debian 7 + Nginx 1.2.1 + PW2.3 setup. Only change I did is instead of 'fastcgi_pass unix:/var/run/example.com_fpm.sock;' I am using 'fastcgi_pass 127.0.0.1:9000;' Any advantages of using one over other ? Thank you for posting complete config file @u-nikos
    1 point
  31. Anything new on this subject? Apparently nginx is really faster and less ram consuming than apache.
    1 point
×
×
  • Create New...