Leaderboard
Popular Content
Showing content with the highest reputation on 03/15/2017 in all areas
-
Has been discussed before in several threads. I my self grow my own library with processwire themes. It takes time to grow your own library with processwire themes but it is worth it as you can adapt/modify/change a processwire theme into anything a client wants. After you finished a website, clients are always going to call you back and want something changed, modified or added. With processwire, having everything open, no problem. My experience with Wordpress is you depend heavily on plugins or need to learn how to "hack" a wordpress theme into what the client wants. All wasted time as you will never get it right 100% this way and you learn nothing useful new in coding. Besides that, wordpress theme support will never help you with code questions and is limited to functional support. This processwire forum is the best support you can ever wish for if you have any question about processwire.5 points
-
4 points
-
wow the conversation has moved on here, totally missed this. YES @modifiedcontent the module is supposed to be writen into your templating, i.e. use the functions to create login, forgotten username, register etc. Then the user is added as a subscriber role (or role of your choosing). For my project I create some pages only available to subscriber role, I dont want anyone from the public seeing the PW install so I effectively created protected parts of the site where they can see and do stuff for their role e.g. see restricted content. I'm happy to develop the module further... the idea wasn't that it was a replacement for the PW admin but a way of creating login to parts of your site for differing role types. Hope that makes sense. Also, yes the username creation is not good, any recommendations would be appreciated. Currently they are created out of the email address as i didn want to add a username field which then needed to be checked for duplication on the client side with PW for a nice experience... lots of cans of worms there. It also doesn't have a two step email verification as it wasn't needed for my purpose at the time, but does mean your likely to get spam. I use: user has role in my private templates to check for logged in users. $user->hasRole($role) if($user->hasRole("subscriber")){ /* * my private info for subscribers */ }else{ /* * show login form or similar */ }2 points
-
To go a bit deeper in what Robin explained. When you are on the last page of a level, you want the first page of the next sibling of it's parent. For this to work, you have to be actually positioned on the child page, and not the parent — you can do that by redirecting to the first child when positioned on one of the parent pages. As for the next and prev links something like this should work to get the correct pages; $prev = $page->prev->id ? $page->prev : $page->parent->prev->child; $next = $page->next->id ? $page->next : $page->parent->next->child("sort=-sort");2 points
-
I f you prepend an _init.php to each template this would be a good place to switch the locale. There is no need to merge setlocale and number_format. Since the output after changing the locale isn't enough for your needs I would go on with number_format. I don't know if   for the smaller space as thousands separator is well supported by browsers (fonts). So I would try the following: $code = $pages->get(1)->localName($user->language); switch ($code) { case 'en': $number = number_format($page->prixAuMetreCarre, 2, '.', ''); break; case 'fr': $number = number_format($page->prixAuMetreCarre, 2, ',', '<span style="font-size: 0.3em;"> </span>'); break; case 'de': $number = number_format($page->prixAuMetreCarre, 2, ',', '.'); break; default: $number = number_format($page->prixAuMetreCarre, 2, ',', '<span style="font-size: 0.3em;"> </span>'); } echo "$number €"; There is also a php function money_format. You maybe want to use this? http://php.net/manual/en/function.money-format.php2 points
-
If you're asking for ready to use plugins I doubt ProcessWire is the correct system for you. There are various modules for processwire, but they tend to keep a small footprint and most don't even create any predefined markup. While it's still a nice system you'd need to be able to implement (at least most of) your business logic on your own. In regards to webapps we're probably closer to some php framework than we are to wordpress, where you just have to install some stuff. So it really depends on your skillset and/or willingness to learn some things on the way.2 points
-
Wire Mail SMTP An extension to the (new) WireMail base class that uses SMTP-transport This module integrates EmailMessage, SMTP and SASL php-libraries from Manuel Lemos into ProcessWire. I use this continously evolved libraries for about 10 years now and there was never a reason or occasion not to do so. I use it nearly every day in my office for automated composing and sending personalized messages with attachments, requests for Disposition Notifications, etc. Also I have used it for sending personalized Bulkmails many times. The WireMailSmtp module extends the new email-related WireMail base class introduced in ProcessWire 2.4.1 (while this writing, the dev-branch only). Here are Ryans announcement. Current Version 0.8.0 (from 2024-09-25 -- initial version 0.0.1 was pushed on 2014-03-01) Changelog: https://github.com/horst-n/WireMailSmtp/blob/master/CHANGELOG.md Downlod: get it from the Modules Directory || fetch it from Github || or use the module-installer in PWs admin site modules panel with its class name "WireMailSmtp". Install and Configure Download the module into your site/modules/ directory and install it. In the config page you fill in settings for the SMTP server and optionaly the (default) sender, like email address, name and signature. You can test the smtp settings directly there. If it says "SUCCESS! SMTP settings appear to work correctly." you are ready to start using it in templates, modules or bootstrap scripts. Usage Examples The simplest way to use it: $numSent = wireMail($to, $from, $subject, $textBody); $numSent = wireMail($to, '', $subject, $textBody); // or with a default sender emailaddress on config page This will send a plain text message to each recipient. You may also use the object oriented style: $mail = wireMail(); // calling an empty wireMail() returns a wireMail object $mail->to($toEmail, $toName); $mail->from = $yourEmailaddress; // if you don't have set a default sender in config // or if you want to override that $mail->subject($subject); $mail->body($textBody); $numSent = $mail->send(); Or chained, like everywhere in ProcessWire: $mail = wireMail(); $numSent = $mail->to($toEmail)->subject($subject)->body($textBody)->send(); Additionaly to the basics there are more options available with WireMailSmtp. The main difference compared to the WireMail BaseClass is the sendSingle option. With it you can set only one To-Recipient but additional CC-Recipients. $mail = wireMail(); $mail->sendSingle(true)->to($toEmail, $toName)->cc(array('person1@example.com', 'person2@example.com', 'person3@example.com')); $numSent = $mail->subject($subject)->body($textBody)->send(); The same as function call with options array: $options = array( 'sendSingle' => true, 'cc' => array('person1@example.com', 'person2@example.com', 'person3@example.com') ); $numSent = wireMail($to, '', $subject, $textBody, $options); There are methods to your disposal to check if you have the right WireMail-Class and if the SMTP-settings are working: $mail = wireMail(); if($mail->className != 'WireMailSmtp') { // Uups, wrong WireMail-Class: do something to inform the user and quit echo "<p>Couldn't get the right WireMail-Module (WireMailSmtp). found: {$mail->className}</p>"; return; } if(!$mail->testConnection()) { // Connection not working: echo "<p>Couldn't connect to the SMTP server. Please check the {$mail->className} modules config settings!</p>"; return; } A MORE ADVANCED DEBUG METHOD! You can add some debug code into a template file and call a page with it: $to = array('me@example.com'); $subject = 'Wiremail-SMTP Test ' . date('H:i:s') . ' äöü ÄÖÜ ß'; $mail = wireMail(); if($mail->className != 'WireMailSmtp') { echo "<p>Couldn't get the right WireMail-Module (WireMailSmtp). found: {$mail->className}</p>"; } else { $mail->from = '--INSERT YOUR SENDER ADDRESS HERE --'; // <--- !!!! $mail->to($to); $mail->subject($subject); $mail->sendSingle(true); $mail->body("Titel\n\ntext text TEXT text text\n"); $mail->bodyHTML("<h1>Titel</h1><p>text text <strong>TEXT</strong> text text</p>"); $dump = $mail->debugSend(1); } So, in short, instead of using $mail->send(), use $mail->debugSend(1) to get output on a frontend testpage. The output is PRE formatted and contains the areas: SETTINGS, RESULT, ERRORS and a complete debuglog of the server connection, like this one: Following are a ... List of all options and features testConnection () - returns true on success, false on failures sendSingle ( true | false ) - default is false sendBulk ( true | false ) - default is false, Set this to true if you have lots of recipients (50+) to ($recipients) - one emailaddress or array with multiple emailaddresses cc ($recipients) - only available with mode sendSingle, one emailaddress or array with multiple emailaddresses bcc ($recipients) - one emailaddress or array with multiple emailaddresses from = 'person@example.com' - emailaddress, can be set in module config (called Sender Emailaddress) but it can be overwritten here fromName = 'Name Surname' - optional, can be set in module config (called Sender Name) but it can be overwritten here priority (3) - 1 = Highest | 2 = High | 3 = Normal | 4 = Low | 5 = Lowest dispositionNotification () or notification () - request a Disposition Notification subject ($subject) - subject of the message body ($textBody) - use this one alone to create and send plainText emailmessages bodyHTML ($htmlBody) - use this to create a Multipart Alternative Emailmessage (containing a HTML-Part and a Plaintext-Part as fallback) addSignature ( true | false ) - the default-behave is selectable in config screen, this can be overridden here (only available if a signature is defined in the config screen) attachment ($filename, $alternativeBasename = "") - add attachment file, optionally alternative basename send () - send the message(s) and return number of successful sent messages debugSend(1) - returns and / or outputs a (pre formatted) dump that contains the areas: SETTINGS, RESULT, ERRORS and a complete debuglog of the server connection. (See above the example code under ADVANCED DEBUG METHOD for further instructions!) getResult () - returns a dump (array) with all recipients (to, cc, bcc) and settings you have selected with the message, the message subject and body, and lists of successfull addresses and failed addresses, logActivity ($logmessage) - you may log success if you want logError ($logmessage) - you may log warnings, too. - Errors are logged automaticaly useSentLog (true | false) - intended for usage with e.g. third party newsletter modules - tells the send() method to make usage of the sentLog-methods - the following three sentLog methods are hookable, e.g. if you don't want log into files you may provide your own storage, or add additional functionality here sentLogReset () - starts a new LogSession - Best usage would be interactively once when setting up a new Newsletter sentLogGet () - is called automaticly within the send() method - returns an array containing all previously used emailaddresses sentLogAdd ($emailaddress) - is called automaticly within the send() method Changelog: https://github.com/horst-n/WireMailSmtp/blob/master/CHANGELOG.md1 point
-
Hi everyone, I'd like to start a conversation about your view and practices for profitable web design and development (unless there is already one that I didn't find). I use ProcessWire for most of my sites currently. Wherever I look though I can see plenty of web design freelancers and even larger agencies running exclusively on WordPress and themes. Many people are running "web design" businesses even without any development skills. There are just so many that I started to doubt if that's the way to go. - Do you use Wordpress + themes to cut cost and increase your bottom line? If yes, what is the middle ground? Is it worth to put up with WP? - If not, what alternatives you use for micro/small businesses? - And finally, how do you use ProcessWire to speed up small, basic brochure websites? Clients care more about budget and results than "custom" design. I love working with ProcessWire but only if it doesn't mean lost opportunities. Any opinions are welcome, especially from those of you who are advocates for themes yet are skilled developers.1 point
-
1 point
-
For someone just coming in from the Wordpress world it is tempting to look for a module/plugin that does everything out-of-the-box to avoid having to learn about the form API, hooks, PW native features, etc. If I have to know all that before I get anything usable, I might as well skip your FrontendUser module + two required helper modules that may or may not be compatible with the latest PW version and just use those PW native features to put my own solution together.1 point
-
Some people do this via HannaCodes or other, self created markup-modules added to the ckeditor boxes. Something like that: [[image=theimagename.jpg, crop=thecropname]] The above could be used by a custom markup module, if you have not installed HannaCode. Assumed you have only one image field on that templates/pages, you have to search for that image in the field and replace that marker with the img tag and src pointing to the crop. if you have more than one imagefield on a page, you need to add a third param: [[image=theimagename.jpg, crop=thecropname, fieldname=teaserimages]] If you are willing to get your hands dirty with code and build an own markup module, this is a nice way to learn much about PW and PHP. Otherwise you can install Hannacode and do it there. Hannacode is a flagship! Pretty usefull for a lot more use cases.1 point
-
@netcarver true, also im not easily offended1 point
-
<moderator hat: on> Hi everyone, Just want to point out that discussion of Ben's module really belongs in its own thread and not under this one - which is specifically for discussing pwFoo's module. If anyone wants to discuss a possible merger between the two modules, please start a new thread to discuss the possibility and then post a single pointer to the new thread here and in Ben's module's thread. Many thanks! <moderator hat: off>1 point
-
Thank you for not taking this personal, @benbyf. In my solution here I use a custom function for username creation from a fullname. I haven't added a check for diplication yet - and kinda hope the system would catch that somewhere. I have used a similar username-from-fullname process in Wordpress for years and never had a problem there. Apparently in Processwire 'it is not a requirement that the "email address" field of a user page be unique'. I think I have tried the username-from-email solution myself when I first tried to develop this process in Wordpress, with similar results.1 point
-
@mikel I guess you use the current master. This version is not supported anymore. New versions (dev, dev2) https://github.com/somatonic/Multisite/tree/dev2#add-multisitedomains this config was changed to be in site/config.php for various reasons . So the domain array is added to $config and it doesn't matter where. it could also be in a module. I'm not sure what doesn't work in your example, it could be that it is in ready.php or the hook ::add should be ::added. Just wanted to mention that this if you use the master version it won't be compatible in future versions.1 point
-
Getting just the folder means $file is actually not a file (Pagefile), but a Pagefiles object. File fields are internally always handled as list of files, so you might need to use the following or alike: $file = $upload->file->first();1 point
-
1 point
-
@DL7 I haven't used this module, but I see that it's not autoload in templates so try this before you save the page via the API: $modules->get("PublishToTwitter");1 point
-
Thanks Harmen and Macrura for trying to help. It was a permission problem . Forgot to check and change permissions after the extraction... I' m too old to learn from my repeated mistakes...1 point
-
1 point
-
If you are using cloudflare.com you might also want to create a page rule like: *mydomain.com/processwire/* Security Level = High Cache Level = Bypass Disable Apps Disable Performance This should prevent any of the Processwire admin from being proxied by cloudflare.1 point
-
Seems to be caused by the divider, hiding them fixes the problem.1 point
-
Hi @wbertl - firstly, welcome to the forums! Please upgrade to the latest version which should fix the issue for you.1 point
-
Just removing that line won't work. It's just there so PW knows under which db engine it was installed. Changing it will not modify the database in any way to actually resolve the issue.1 point
-
I don't think you need to rename anything, although I haven't used phpDocumentor myself. I use apigen (as seen here). You can tell it in a configuration file what file extensions to parse. I see phpDocumentor has a similar feature as explained in its documentation here (see extensions). Meaning, something like below should work. <parser> <target>output</target> <encoding>utf8</encoding> <markers> <item>TODO</item> <item>FIXME</item> </markers> <extensions> <extension>php</extension> <extension>module</extension> </extensions> </parser>1 point
-
Hi @DL7, First of all I assume you are using the module for version 3.x I think the first thing to change is the 'autoload' option in the getModuleInfo() method to 'autoload' => true (or add another template you are using for the creation of pages). Please let me know if that's working for you. Cheers!1 point
-
Welcome @carloswinkel ProcessWire frontend "templates" are called "site profiles" and while there are plenty free ones to choose from, I can't think of anything which might provide what you need out of the box. There is only one commercial site profile, but that one might be a bit off topic: http://seavuel.com/ however, even this site profile is not "updatable" anyway, so you are free to change anything in the ProcessWire world as long as you do not change the core (files in /wire) There exists a PayPal module: http://modules.processwire.com/modules/payment-paypal/ PW 3 compatibility is not stated, but it does not mean it can't work, it just means the developer had not had the time to sort it out. Should you have issues with it, you can ask the developer Apeisa, who is still heavily involved in ProcessWire development so I guess this module should be supported in the future as well. Regarding tutorials, I recommend this one: http://blog.mauriziobonani.com/processwire-basic-website-workflow-part-1/ http://blog.mauriziobonani.com/processwire-basic-website-workflow-part-2/ http://blog.mauriziobonani.com/processwire-basic-website-workflow-part-3/ http://blog.mauriziobonani.com/processwire-basic-website-workflow-part-4/ and this one: https://medium.com/@clsource/understanding-processwire-templates-fields-and-pages-201aecd0a1a4#.upwyztack Hope this helps. Also, as @rick said: "...you can always ask for specific advice..." Anything is possible with ProcessWire, but you will need to code. However, it is relatively easy to put together complex solutions with PW.1 point
-
Hi @MuchDev, there is a module by @renobird which stores changes based on individual pages.1 point
-
Hello Carlos! Welcome aboard! Your application can certainly be developed with ProcessWire. Not knowing your experience developing applications, I can only point you to the tutorial section, and to the ProcessWire blog, as places to begin. If you already have something designed, you can always ask for specific advice. Everyone here will be glad to help. Again, welcome.1 point
-
Yes, it navigates between sibling pages, so you would use it when you are on a child page of Section 1, Section 2, etc. If you are on page Section 1 and you want to get the first child of that page you would use $page->child(). So if you want to navigate between levels as well as between siblings you would use some logic in your template to determine how you generate the navigation links. For example, check if $page has children and if so use $page->child(), otherwise use $page->next() - that sort of thing. Edit: I just noticed this... You can't have a page actually be another page (e.g. it's first child). Each page is an independent entity in the tree hierarchy. But you can have a page redirect to another page when it is viewed on the front-end. See $session->redirect().1 point
-
Hi, I just wanted to point out that we recently ran into the same issue when using Cloudflare's CDN. Weird is the fact that we were able to reproduce the logout issue with a specific user when editing a specific page. Every time the user clicked "Save" for this specific page, she was kicked out. I assume that at this point the IP address changed - from Cloudflare to the actual user's IP address or the other way around. The error is the same as in the quoted post above: User 'somebody' - Error: Session fingerprint changed (IP address or useragent) (IP: 162.158.XX.XX) The IP address is - just as above - in the Cloudflare range: https://www.cloudflare.com/ips/ We are currently working around this issue by using a different Domain name to access the ProcessWire backend. This domain is not routed through Cloudflare and the approach works fine for us so far. I can provide further information if required.1 point
-
1 point
-
@benbyf, I just installed/tried your module. It doesn't have account validation/email confirmation etc.? After adding test info on the register form, I was immediately logged in, but apparently with no permissions to do anything in the admin area. I was unable to log in again with my administrator account. I am now locked out of my own site. Edit: I used the same email address for the test as I have in my main admin account, so the subscriber with no permissions hijacked my main administrator account - how is that even possible? Going into the database now to try to restore my site... Edit: Unable to restore the site via database. Completely fucked. Now reinstalling everything from scratch.1 point
-
What I would like to know, and haven't found if it exists, is a mapping for the order of files invoked by PW. I see quite a few references to init.php and ready.php, etc. files, but have no idea where they are executed in the precedence order. Is there a 'map' that shows the files in order of execution, and their corresponding definition (use this file when...) ? similar to: index.php | blah...blah | init | ready | blah...blah |1 point
-
Blackfire is nice, but ProcessWire is not as linear as this Screenshot does look like. ProcessWire's graph is more circular as most method calls go through Wire::__call() to be hookable.1 point
-
I recently discovered an app that maybe help you on that, it's called Blackfire https://blackfire.io See a screenshot of an example from its website. Install on your server (or local) and give it a try and maybe compare with @teppo's diagram above. Edit: this is a Symfony app, and not mine, just to clarify.1 point
-
I posted something like this a few years ago, but that's obviously not up to date with current versions of ProcessWire. Would be interesting to create an updated version and compare these side by side, just to see how far we've come since then1 point
-
index.php ProcessWire Bootstrap Module Init (Hooks to ProcessWire::init) init.php ProcessWire Core ready Hooks to ProcessWire::ready ready.php Template Rendering prependedTemplateFiles template.php appendedTemplateFiles Hooks to ProcessWire::finished finished.php Shutdown This should be almost complete, but I don't guarantee about anything1 point
-
I just made the 0.3.0 version the new stable version. I've also added 0.3.1-beta with a new migration type: AccessMigration. This migration is only meant to change access rules for templates like shown below. List templates with changes, prepend a + or - if the useRoles setting does need to change. For those templates then list all roles which have changes (can be none) and supply which types of access should be added or removed. <?php class Migration_… extends AccessMigration { public static $description = "Update template access rules"; protected function getAccessChanges() { return [ '-blogpost' => [], // Remove useRoles from blogpost template '+basic-page' => [ // Add useRoles to basic-page 'subscriber' => ['+view'], 'editor' => ['+view', '+edit'], 'admin' => ['+view', '+edit', '+create'] // +create does require +edit ], 'tag' => [ 'subscriber' => ['-edit'], 'admin' => ['+full'] // view, edit, create and add ] ]; } } Edit: Had to remove the automatic +edit for +create, otherwise it's not clear to what to revert on rollbacks.1 point
-
Hi, Ben, I just looked ino the WireMailChimp module: It does require the Subscribers module, doesn´t it? For my needs I altered the part whre this module is loaded and the role "subscriber" is checked. (I just run a check against my own subscriptions field) I will then allways get the same error message, no matter if subscribing or unsubscribing: 400: [EMAILADRESS] is already a list member. Use PUT to insert or update list members. Did you already got it to work properly?1 point
-
Updated the module to version 0.8.3 for working with PW 3.x (use version 0.8.2 for PW 2.x).1 point
-
If you have a static IP, you may log UAs for this IP a short time. I assume, you then will find what causes the issue: <?php // somewhere in site/ready.php, for example $myPrivateSaticIP = '123.123.123.123'; if(!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) { $ipAddress = $_SERVER['HTTP_X_FORWARDED_FOR']; } else { $ipAddress = $_SERVER['REMOTE_ADDR']; } if($ipAddress == $myPrivateSaticIP) { // log infos of IPs, user agent and more, ... $items = array(); $items[] = 'REMOTE_ADDR: ' . (isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : 'N/A'); $items[] = 'HTTP_X_FORWARDED_FOR: ' . (isset($_SERVER['HTTP_X_FORWARDED_FOR']) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : 'N/A'); $items[] = 'HTTP_USER_AGENT: ' . (isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : 'N/A'); // add more if needed ... $log->save('my_ip_useragents', implode(' || ', $items)); } https://processwire.com/api/ref/log/save/1 point
-
There are basically four different environments to talk about. TemplateFile TemplateFile is core class, which does include your template files, but does also power things like $page->render(), wireRenderFile(), wireIncludeFile() and others. This class will automatically make all API Variables available as local variables. Meaning all those included files can directly use $pages, $page, … . It won't work inside any functions defined in those files, because of the way PHP does scope variables. Classes extending Wire Every class, which is extending the Wire class will have access to API variables via $this->pages, $this->page, if the properties or __get() are not overwritten. Also there's $this->wire('pages'), which is less likely to be overwritten (even some core classes need to use $this->wire()). Anonymous functions There are some methods in the processwire code, which accept anonymous functions as parameters (e.g. WireCache). Those anonymous functions can retrieve api variables as parameters, even though I'm not sure how exactly this is working or if that's often used. Everywhere else Outside of wire classes, template files and special anonymous functions there's the wire() function, which is basically the same as $this->wire() in wire classes, but as a global function, which is accessable anywhere after pw is started. With PW 3.0 and multi-instance this is the option to avoid. Places, which technically are number 2, but it may not be apparent to everybody: Custom PHP code for fields like FieldtypePage or FieldtypeMarkup: As those PHP code is evaluated/run inside those (input)field classes there's (besides manually available local api variables) always the option to use $this->pages or $this->wire('pages'). All those template files included by the TemplateFile class: For the same reason as above there's not only $pages available in those template files, but also $this->pages, $this->wire('pages').1 point
-
CSS awesomeness! Enter this into the "Text color" field in the module settings: transparent; width: 70px; height: 70px; border: none; background: transparent; border-radius: 100%; overflow: hidden; padding: 0; margin-right: 0.7em; color: #aaa Also set the first field value to "70,70". No matter what you write elsewhere, the code above will overwrite it.1 point