Leaderboard
Popular Content
Showing content with the highest reputation on 02/08/2021 in all areas
-
Hi all, I won't always post here when I update Tracy, but I will when I think the update is an important bug fix that you really should update to. There was a bug in the new 2.8 branch of core Tracy package that was sometimes causing recursion and really slow load times and sometimes memory exceeding errors. This has been fixed and is available in 4.21.41 of Tracy released today.3 points
-
Without needing to buy a Pro module (although they are excellent!), there is indeed a ProcessWire way for this. You can use $files->render()/wireRenderFile() to achieve what you want: https://processwire.com/api/ref/wire-file-tools/render/ https://processwire.com/api/ref/functions/wire-render-file/ The advantage of using this over your own functions is that it will automatically keep access to all of PW's API variables (no need to pass them in). Here is a simple example based on your use-case description: /** * In your generic template file. * Note: it assumes there is a directory under 'templates' called 'layouts' (it could be called anything). * Just create your layouts in the 'layouts' dir and name them the same as the '$item->template' names you are using. */ // Get the content of the specified layout into a variable. // This example looks for '/site/templates/layouts/name-of-template.php' (the .php extension is assumed) $pageContent = $file->render('layouts/' . $item->template); // Just echo it out wherever you need it. echo $pageContent; Read the docs on it, there is more you can do with this method/function, including passing custom variables, and some other options to make it more flexible. There is also a $files->include() method which is the same except it directly echos out the content instead of returning it to a variable.3 points
-
I haven't used it, but I think that is what Croppable Image module is intended for: https://processwire.com/modules/croppable-image3/2 points
-
2 points
-
Interesting question, I've had a look at PWImageResizer.js, apparently this wasn't built with retention of EXIF data in mind. Take a look at the source code of the scaleImage function: It uses a canvas to draw the image on it, then resizes it according to the maximum width/height settings (including some fancy math to scale the image). The canvas is then turned into a data URI using HTMLCanvasElement.toDataURL() and which is then parsed back to a Blob (binary image data). The intermediary canvas can't hold EXIF metadata, so it is lost during that step. If you wanted to retain EXIF data, the script would need to read it from the original image and add it back to the final Blob / binary data. This SO thread has some examples of how to do that. Not sure if you can add it to the image inputfield from outside, it would probably need to be added to the core. Maybe open a feature request for that, though you should be aware that this is not trivial if the script needs to handle all kinds of edge-cases and support legacy browsers ...2 points
-
Just my 2 cents: it should throw an exception here - this current logic is not good in my opinion.2 points
-
@Pete - your "allowed superuser" option is now available in the latest version. @Robin S - I implemented your quicklinks filtering - I think it's a really nice improvements - thanks! Also, I haven't forgotten about your shortcut links panel idea - it's next on my list.2 points
-
Sorry for the delay guys - the latest version hacks back in the file / line number so that both the bd() call and the file/line is visible. Let me know if you find any layout issues.2 points
-
Hello, I would like to present you a new module which aim to facilitate the productivity of your editors/publishers when working on ProcessWire. The idea begun when my co-worker told me that when typing in ProcessWire CkEditor field he was feeling "loosing motivation" when writing big wall of text and/or inspiration. So he opened his web-browser and show me a site looking to Wordpress - feel free to put your preferred emoji here - then he opened Gutenberg... typed some text and moving some "blocks". I understood immediately why he got this feeling with CkEditor. If you or your client feel like this guy, then you will love this module ! What is currently supported ? Features Auto-save Medias upload support HannaCode support Blocks Implemented Heading Image Paragraph Embed Quote Code Link Table (beta) Block Delimiter Raw HTML Note (custom block markup) Feature Request Frontend Edition And there you go for the preview - sorry I am to lazy and bad at typing text so I had a copy/pasta moment : Module featured in the ProcessWire Weekly #317 - Thanks @teppo1 point
-
This week ProcessWire gained powerful new tools for finding pages and controlling how they are loaded. If you like to maximize performance and efficiency, you’ll like what 3.0.172 brings— https://processwire.com/blog/posts/find-faster-and-more-efficiently/1 point
-
Here is the first very early concept of a Page Builder. As per the conversation in the 'ProcessWire beyond 2021' conversation, I set myself a challenge to make a clone of YOOtheme Pro's Page Builder. This was mainly spurred by @Jonathan Lahijani's excellent overview of ideas of a page builder for ProcessWire. This is still in very early stages and I am not really sure where it is headed. I would like to hear the thoughts of like-minded persons ?. I would especially love to hear from @Jonathan Lahijani, @szabesz, @AndZyk and @flydev ?? please. Concept The page builder in its current state is a Fieldtype + Inputfield supported by other behind-the-scenes Fieldtypes without Inputfields. There are no hidden or extra pages in contrast to Repeater Matrix. All values are stored in the Page Builder fields for the page being edited. The fields do not store values as JSON. Definitions for elements, rows, grids, etc as stored as JSON. Currently, for storage purposes, 4 datatypes are supported - Text (HTML), images, plain text and headlines. From a storage perspective, the latter two are one and the same. Just texts with different 'schemas/definitions'. More on this below. The fields are multitype fields. This means one page can hold multiple texts, allowing for repeatability. Similar datatypes are stored together in one field/table. For instance, there is no reason why a (future) URL element (datatype) should not be stored in the same table as plain text. At the database level, they are both just texts with similar requirements. At the processing level, URLs vs other plain texts (headlines, etc) are handled differently (validation, sanitisation, etc). Each 'element' represents a row in a table for most types (e.g. slideshows are slightly different). Querying and access of field values is via the main Fieldtype - FieldtypePageBuilder. However, the supporting Fieldtypes can be also be accessed and queried individually, if one wishes, using normal ProcessWire selectors. The supporting Fieldtypes, if such need arises could easily become custom tables instead (but best to keep them as Fieldtypes - easier querying with selectors, etc). It is totally CSS-agnostic in relation to frontend output. You bring your own CSS. In the preview, you can also use your own CSS. In the frontend, you can choose to output raw values as you wish or use inbuilt render methods to render the whole layout for you or to render the value of an element as per its tag definition (e.g. headlines as h2, h4, etc) where applicable. Fully multilingual (although the editing UI not yet implemented). Issues The main issue is the real estate needed for InputfieldPageBuilder. Any such page builder would require the whole width of the window. As you can see from the screenshot below, this obviously throws things out of kilter with respect to the ProcessWire page edit UI, in any theme (I believe). I am not a designer so would love to hear from you about possible solutions. My current thoughts are: Modal Open the page builder in a modal for editing. Pros Would allow for use of whole real estate. Title and other fields would not be in the way. Cons Editing in modals can be tricky? Other..? Process Module Pros Solves the real estate issue. Cons Disconnect between the page being edited/created and the page tree. Screenshot No attempt has been made to theme it as per any current ProcessWire theme (that I know of). This was a quick and dirty-ish clone of YTPB. As stated, however, the current ui is not acceptable as an Inputfield for, mainly, real estate reasons. Video Demo This is a demo for the Page Builder app outside ProcessWire. Thoughts? Thanks. PS: I currently have no time to continue working on this (Padloper, etc..)1 point
-
Shetland.org is a website run by Promote Shetland which inspires people to visit Shetland, encourages people to move to Shetland to live, work and study, and attracts people to invest in commercial activities in the isles. We (NB Communication) have run the Promote Shetland service on behalf of the Shetland Islands Council since 2017, and as part of the contract undertook a project to redevelop the existing Shetland.org website. In this showcase we’ll highlight a selection of modules we used and what they helped us achieve. Visit the site: www.shetland.org Pro Modules ProCache We use this on almost every site we build. Indispensable. The cache settings used are pretty simple – most templates are set to 1 week, with the entire cache being cleared on save. We use ProCache’s CDN functionality to serve assets from CloudFront via c.shetland.org. We also use the API provided by ProCache to compile (SCSS), minify and collate our styles and scripts via $procache->css() and $procache->js(). We then use the URLs returned to preload the assets, making the site even faster! ProFields: Repeater Matrix Again, we use this on almost every site we build. Another must have Pro module. This module allows us to create a really powerful page builder field (we call it ‘blocks’) that handles the majority of the content on the site. On a simple development, we just use two block types - Content and Images - the latter displaying as a gallery or a slideshow. On this site we have 13 different types, including ‘Quotes’, ‘Video’, ‘Accordion’, and ‘Links’. Additionally many of these are configurable in different ways, and some render in different ways depending on the template and context. Have a look at the links below for some examples: https://www.shetland.org/visit/do/outdoors/walk https://www.shetland.org/blog/how-shetland-inspires-me-artist-ruth-brownlee https://www.shetland.org/life/why/teach-shetland-school NB Modules We also used a number of modules we've authored: Instagram Basic Display API Used to retrieve the 6 latest images from instagram.com/promoteshetland. Markup Content Security Policy Used to implement a CSP for the site. Currently scoring a C on observatory.mozilla.org – not the best score possible but significantly better than all the other destination marketing websites I tested (all got an F but one which was a D-). Pageimage Srcset Used throughout to generate and serve images of different sizes via the srcset and sizes attributes. This module is really useful if you are looking to optimise the serving of images to improve page speed times/scores. Video markup for YouTube/Vimeo This module was developed specifically for use on this website, as we wanted more control over the rendering of the oEmbed data. In the example below, the video thumbnail is displayed with a text overlay – when clicked the video (YouTube embed) opens in a lightbox. And a big shout out to… Page Path History The previous site was also built by us in ProcessWire, but a number of years ago now. The new site has significant changes to the sitemap, but 1000+ blog posts were also migrated. Instead of an .htaccess file with thousands of 301 redirects, we were able to use the functionality provided by this module to implement redirects where required, and in the case of the blog posts which were migrated via an import script, implement the redirects via the API - $page->addUrl(). ... The above is just a fragment of the features present on this site, and the development just a part of a much larger project itself. We're really proud of what we've achieved, and we couldn't have done it without ProcessWire. Cheers, Chris (NB Communication)1 point
-
@Robin S YES! Thank you! This is exactly it. Not sure how I missed it?! ...!1 point
-
Hi @Violet The issue is that you set start as 0 on every page. Thake a look at this thread1 point
-
Hi @MoritzLost - sorry about this. I have copied your settings and can't reproduce the issue - I think it might be related to the new "restrict superusers" option I added for Pete, but can you please let me know if you are running this site on a local dev environment or remote server? Also, does checking "force superuser into development mode" fix it?1 point
-
InputfieldHCaptcha 1.0.2 I've just released a bugfix update to this module which should fix an issue with malformed API requests when using cURL. This should help if you had the following problems with the module: Captcha validation always fails with error codes missing-input-response and/or missing-input-secret (error codes are logged to the hcaptcha log file). General network / API request errors. The new version 1.0.2 uses cURL only if it's supported on your system and the ProcessWire version is 3.0.167 or above (see this post for an explanation). Otherwise, it uses fopen with a fallback to sockets. If you're having trouble with the updated module, please let me know which ProcessWire version you're running and if your system supports cURL so I can try to replicate the problem. Update: v1.0.2 contained a small error that prevented fallback to socket if fopen is unavailable (on systems that don't support cURL or below ProcessWire 3.0.167). Fix is live as version 1.0.3 Next steps I'm planning to implement a couple of additional options for this module soon. In particular: An optional permission allowing users to bypass captcha validation. A global 'kill-switch' for the module – i.e. a option in the module config or a $config value that disables hCaptcha validation globally, passing all requests. Let me know if those features would be useful to you or if you have other suggestions to improve this module!1 point
-
Thanks @wbmnfktr I think the Markup/HTML option refers to the where internal links go to rather than the format. Thanks @Robin S. I do often add that in the notes but it does seem to confuse some users — of they just don't read it. I like your hook idea though; that could be very effective.1 point
-
Found one that was new to me: https://plotly.com/javascript/ based on D3 and seems to have a LOT of options/possibilities! ? Anybody any experience with it?1 point
-
Just wondering... A client called me yesterday: "Bernhard, I deleted a project, can you restore that?" It was not that simple, because that project had related pages that have also been trashed. Restoring those pages would have been a lot easier if the trash in the page tree showed the trashed pages sorted by time of deletion. What do you think? How to you find such pages quickly? Am I missing anything? I've used a custom $pages->find() in tracy console to get what I want...1 point
-
Thx - no answers seems that I'm not missing anything obvious here ? If you like, give this request a thumbs up: https://github.com/processwire/processwire-requests/issues/3861 point
-
It's a premium module but I believe Repeater Matrix will do exactly what you need. It's one of my 'must haves' on every site I create. It's part of the ProFields pack and I use other features on every site too, like Functional Fields . I'll be using the new Combo field as well. The time it saves me is well worth the investment not to mention the great support in the forum from other ProField users & Ryan himself. https://processwire.com/store/pro-fields/1 point
-
Hi @Confluent Design, This issue has already been fixed in Media Manager. Re-download Media Manager and copy over your current install. Please let me know if you still need help. Thanks.1 point
-
hi, honestly, being a little bdd obsessive, in this case i would use a query to retreive from the "pages" table the pages where parent = 7 order by modified desc for example the funny thing is in this table, deleted pages new name is their id followed by their parent id, useful to restore them with the right parent... don't know if it is a very pw way to do things ? maybe a hook to have template 2 sorting its children by modified desc when page id is 7... have a nice day1 point
-
Hi @MoritzLost, i has solved a problem, thanks for your solution, it's very help me. After i saw my code again, i realise that no function to proccessing an image and after i make it, the image is uploading, but i still create another function, so i can upload a $newImg and $newFiles with one function. Thank you for your help1 point
-
I think this might finally be properly fixed, but please let me know if you still see issues.1 point
-
Update: Found out why LazyCron stops working sometimes. Have added an issue for the fix here. If you are using PHP7 or above, you can improve the reliability of LazyCron by wrapping your hook in a try {} catch (\Throwable $e) {} block. (Note the catch - it's a \Throwable, not an \Exception, so it catches errors as well as exceptions.)1 point
-
@LMD Thanks, it looks like a last minute optimization screwup on my part, changing a $page->set() to a $page->setForced(), when there was bug in $page->setForced() preventing it from populating $page->settings when it should. I have pushed a fix for it on the dev branch. Please let me know if you continue to see any errors.1 point
-
Do you mean that editors are pasting absolute internal links into the link dialog in CKEditor? If so you could try an education approach first, i.e. "Please create internal links via the fields in the link dialog". That way you won't get absolute internal links in the first place. Beyond that you could use a saveReady hook to do a string replacement in the relevant field(s): $pages->addHookAfter('saveReady', function(HookEvent $event) { $page = $event->arguments(0); // Perhaps limit by template as needed if($page->template == 'basic-page') { // Internal links: replace absolute href with relative href $page->body = str_replace('href="https://www.domain.com/', 'href="/', $page->body); } });1 point
-
1 point
-
If you check this tutorial https://support.plesk.com/hc/en-us/articles/213367429-How-to-upgrade-MySQL-from-5-1-to-5-5-on-Linux, you can see a note that says "The PHP package can also be updated during this procedure". I did not pay attention to this because I had installed the latest version of PHP, but it seems that anyway the package and its configuration were changed during the upgrade. maybe.. and during the user login at admin too.. because like in my example, it can happen after the installation... At least we need a topic, or a recipe at https://processwire-recipes.com/ or wherever the option we have, to guide beginners like me. Explaining all the test that must be done after "This request was aborted because it appears to be forged" because after my investigation I found several causes for this, and almost 127 forum entries about it. https://www.google.com/search?q=site:processwire.com+"This+request+was+aborted+because+it+appears+to+be+forged" Now, at this moment I can breathe! I want to say a BIG THANK YOU to @flydev who won my admiration and has been a wonderful human being1 point
-
The reason, after the upgrade of Plesk and PHP, by default the PHP setting session.save_path point to /var/lib/php/session and not /var/tmp where before he got r/w permissions (I don't know if Plesk was already installed or not before the upgrade). The final problem was not MySQL.1 point
-
I think it could be checked on the installation process, checking if these path are writable or not and thus sending a warning that potential session issue could arise. I can't tell you, I think nothing, but I never tried to install this CMS ?1 point
-
It was a server issue and not a ProcessWire one - the reason behind the message "This request was aborted because it appears to be forged" on this case was because the PHP session path was not writable. The website is back online with backend working like a charm ?1 point
-
@dragan, you can add the inputfield like this: $wire->addHookAfter('ProcessPageAdd::buildForm', function(HookEvent $event) { $form = $event->return; // If adding page under particular parent if($this->input->parent_id === '1234') { // Add inputfield to form after existing title field // If you name the inputfield the same as the field you want to populate // then the entered value will be saved automatically $f = $this->modules->InputfieldText; $f->name = 'vertec_code'; $f->label = 'Vertec-Code'; $f->required = true; $f->attr('required', 1); // use HTML required attribute too $title_field = $form->getChildByName('title'); $form->insertAfter($f, $title_field); $event->return = $form; } }); Because of this section in ProcessPageAdd::processInput, if you name the inputfield the same as the corresponding field in the template of the new page then the entered value will automatically be saved to the page.1 point
-
http://familleverville.org A new website made with PW. ProCache has been installed and it works like a charm. The site was previously built in Flash, so I kept the overall structure. This photo album stops at 2007, because the previous site was a built specially for the 50th wedding anniversary of my parents. It will be completed soon. Nothing fancy. Three level of pages, three templates. One extra field. Five sections which can be translated as: Ancestors, Jacques and Irène, The years, Anniversaries, Photo Index. Every photo has been tagged so they can populate the Photo Index section. My mother has her own website (http://irenegiguere.com), made also with PW. She is 75 and has adopted quite easily the CMS. She is eager to begin working the new site, along my sisters who are thrilled to help. Congratulations, Ryan, you've conceived a really great tool!1 point