Leaderboard
Popular Content
Showing content with the highest reputation on 05/14/2015 in all areas
-
Want to use Mandrill for sending emails using their HTTP API rather than SMTP? Read on! I've been working on a WireMailMandrill module for a site I'm currently adding some features to. So far, the module has been tested for simple mail sending, with basic options, and attachments. I haven't tested the full range of things that are possible with the official Mandrill PHP library, but I think I've implemented the ability to set most, if not all, of them. This should be considered beta and not entirely relied upon for sites in production. Testing and feedback welcome. I'm sorry about the lack of code comments at the moment as well, I was just throwing this together as I went along so I could move onto the next part of what I was building... This was originally mentioned in a discussion about SendGrid and Mandrill options in a thread in the Form Builder support area. Not everyone has access to that, which is why I'm putting this here WireMailMandrill on GitHub Quick example (taken directly from a site I'm working on): $mail = wireMail(); $mail->from('info@example.com', 'ExampleCOM Enterprises'); $mail->to($toMail, $toName); $mail->subject('Entry confirmation'); $mail->bodyHTML($bodyHTML); $mail->attachment($myPage->files->first()->filename); $count = $mail->send();9 points
-
Not sure which forum category this should go in, but I spent my lunch break today training a few staff members of a pretty large client of mine on how to use a new processwire website I designed for them. They currently have a wordpress website and were dreading the training process. She said she didn't like how the wordpress widget system worked, and it was confusing to use. (Knowing where to go to update what.) After showing her how to use processwire, she said it was much more intuitive and user friendly. She likes how the page tree logically lays out the website, and how I designed their staff to be a page that other pages could read from so they only needed to update one spot. (Instead of typing it in to many different pages and widgets.) They gave it a big thumbs up! Just wanted to let you guys know!6 points
-
It would be great to add a copy button for content fields on multilingual site. F.e.: You have written a complex text with images, tables and so on in your body field in your default language (fe English). After that you want to translate the content to other languages (German, French). Therefore you have copy all the content. If there will be a copy button to copy the whole content of the default language body field to all the other language body fields with only one click. You will only have to translate the content. There will be no need to insert all the elements once more by copy and paste. This would be a great addition to make working with multilingual sites much more comfortable. Best regards2 points
-
I was put on to Mandrill by Pete (thank you Pete). In my experience if your website sends emails to people, for example you have a booking app and people get confirmations, then the confirmation emails may, sometimes, get rejected as spam, regardless of the fact that they're not. TL;DR Whenever in the PW admin there is a field to do with delivery of email from PW, there ought to be a note / link to an article about the benefits of sending email via Mandrill (or similar service) rather than direct. Boring rant version I had tried to solve this lack of 100% reliable email delivery with DKIM and SPF records (good things in their own right) tuning the content of the email so perhaps it would be less likely to apparently trigger some spam pattern recognition code (for example having few(er) HTML links banging my head shouting Nothing worked. I would appear to have a period of reliability where all emails were getting through, relax... Then BAM! Another spam rejection. The only variance? The receiving email systems. As visitors to the site were many and varied so were their email systems and some of those email systems spam detection algorithms were simply too sensitive for their own good. So it was not my fault but nevertheless my client whose website used the booking system kept gettings infrequent but repeated 'lost' email confirmations. So I made one other change, I sent email via SMTP to Mandrill rather than directly to the client. Mandrill then sent it to the client. This resulted in an unprecedented (and continuing) period of 100% success—zero false positive spam rejections. The reason is simple: my client's domain (or your client's domain) has a reputation as a source of email. It is probably average or good. Whereas Mandrill, who send (Mandrill is part of MailChimp and these are the overall numbers) with this many emails have to have an exceptional reputation, and they do. Nothing I can do on a domain or in DNS can compete with this firehose of good reputation provided by Mandrill. Recommendation If I were a newbie to emailing from PW to people then I could well go through this learning curve myself. To help others I would like to suggest that perhaps wherever there is a field in PW that is responsible for sending email that one of those helpful 'Notes' be auto populated with a link to an article on on the benefits of sending email via an intermediary such as Mandrill.2 points
-
Pagination only works with wireArrays taken directly from the database. When you do $pages->get("/fonts/")->find("keywords=mykeyword") you're filtering a wireArray that is already in memory. Try to find a way to form the same array in one go, for example: $pages->find("has_parent=/fonts/, keywords=mykeyword")2 points
-
There is this module: http://modules.processwire.com/modules/download-guard/ You might also find some useful info in these posts: https://processwire.com/talk/topic/5820-protected-downloads/ https://processwire.com/talk/topic/5292-proctecting-files-from-non-logged-in-users/ https://processwire.com/talk/topic/6463-website-with-protected-download-area/ https://processwire.com/talk/topic/869-protected-files/2 points
-
This is exactly what I'm doing, and I've had the same experience: no more false SPAM. Such a great service. This new module is going to open up new possibilities I'm sure!2 points
-
This is great Craig, thanks. These guys certainly note the benefits of using their system via API rather than SMTP: Not tried their system but it looks good, like another Mandrill. The benefits of using Mandrill as an intermediary for sending email are many. For me, switching to Mandrill (using Horst's excellent Wire Mail SMTP module) meant that all emails got through—I no longer had occasional false spam fails.2 points
-
In the last few weeks I've notices some request (e.g. here and here) to be able to get pages based on if they are selected in page fields of other pages. I think adding a method for this would be a nice addition to ProcessWire, as it's often the case that the pages itself are options we just want to get, if they are used somewhere. Currently the task "Get all tags used by some blogposts" has to be done manually like this: $tags = $pages->find("template=tags"); foreach($tags as $tag){ // Filter unavailable if(! $pages->count("template=posts, tags=$tag") ) continue; // Do stuff with it } Now it would be nice to have something like this, where we don't need to have a selector for tags (this is done by the pagefield already). // Find all pages, which are selected in the "tags" field of the selected posts $available_tags = $pages->findSelectedPages("template=posts", "tags"); I'm not that big a MySQL guy, but I can imagine this not only improving readability, but also reducing database calls.1 point
-
Thanks Adrian! (And thanks for the ProtectedMode module, too.) I just used the config settings referenced in a couple of those threads: $config->pagefileSecure = true; $config->pagefileSecurePathPrefix = '-'; And made sure the "guest" permission was disabled for the templates that have image attachments. For some reason, it seems to have taken about an hour to propagate (some links were still showing up unauthenticated), but everything appears to be locked down now.1 point
-
1 point
-
Maybe it's not really supported - I just saw if you select a Tecxtarealanguage field you are then presented with IDs in the second dropdown in the 'What can they view?' 'What can they edit?' options (and only when you add them as 'subfields') see image below:1 point
-
DEV branch is updated, should be PW 2.6 compatible now. And InputfieldImage is not parent of InputfieldPDF anymore. Check it out.1 point
-
That is strange, i don't see anything wrong with your query. When i run it on my two-row table it works as expected. UPDATE mytest SET mytext = REPLACE(mytext, '<p> </p>', '') Result, 2 rows affected<p>This is a test</p><p> </p><p>Cool!</p> after update: <p>This is a test</p><p>Cool!</p> <p>Another test</p><p> </p><p>Cool!</p> after update: <p>Another test</p><p>Cool!</p> EDIT For you second question: I'm sure that you've already Google'd it yourself but MySQL does not seem to support regexp based replaces. So unless we're lucky enough to be running on MariaDB https://mariadb.com/kb/en/mariadb/regexp_replace/ , the fastest way i think is to just dump the database and perform the regexp replace with a different tool/php/mariadb.1 point
-
I've come across this module Dynamic Roles from Ryan that after some playing round with I notice let's you make roles specifically to do with a language. So for example, on the field 'article_body' I am actually presented with multiple IDs on the dropdown for viewing/editing options. These IDs are listed named in the format 'data1017', 'data1018' and so on and seem to refer to the language tabs on the field. So I wonder is there some way to combine roles and dynamic roles to let specific users only view/edit specific languages on fields? It feels like there are some clues here?!1 point
-
1 point
-
I have this working as expected on a site I'm currently building, on 2.5.28 dev. Have you followed each step from the instructions?1 point
-
Over time we have often had discussions about the nature of Pages and the fact that the term 'Pages', in context of ProcessWire(PW), can be misleading. Pages can represent a lot of things and serve multiple goals. (fun read: https://processwire.com/talk/topic/2296-confused-by-pages/ ) You are right that Pages can be seen as (URL accessible) data objects. What data a particular Page can hold is defined via the page his Template and the Fields added to that template. So a Template can, amongst other things, be seen as a data model. ProcessWire has its own way of organizing and relating data. While the underlying database structure might be different than most MVC-ish systems, the Page tree and the Page fieldtype allow for really flexible ways of achieving most, if not all, of the traditional model associations like in Rails' Active Record. Finding and working with pages/data couldn't be easier thanks to the great API, so i don't think there is a need for an 'ORM' because in a way PW already has this.1 point
-
Mainly its has pages which contain a newsletter, these are grouped by site (there are a couple of sites that have their own newsletter) All newsletters have child pages which resemble the items in the newsletter. These vary from article, image, banner, agenda (feed), rss (feed) and twitter (feed), and such items. Another part of the tool is sort of a scraper tool, it fetches agenda, rss and twitter feeds and stores the content as pages in the database so they can easely be fetched from and used in a newsletter item. There is somesort of cleaning calls in the scraper page (which is called from a cron task). This removes all scraped pages that are older than a given date in the past.1 point
-
Just started toying with wireshell, this is great stuff. Some remarks about the 'new' command: - Unless i'm missing something the new command will always install 'site-default'. Wouldn't it be nice to be able to choose between the bundled profiles that ship with PW? - Currently the unused profiles (site-languages, site-classic etc.) are not being cleaned up after install. - I can't exactly figure out how or where ('timezone' => "366"??), but the timezone in config.php after install seems to be 'Europe/Zurich'. Not a big deal but this does not make a lot of sense as some kind of default. Keep up the good work guys!1 point
-
Thank you for your fast response. It works perfectly... Perhaps my following simple solution of your suggestion will help someone with an similar problem. This is the login.inc which is included at the top of every concerning template. <?php // return if is the user currently logged in function loggedIn() { // check, if a gallery is set if(wire("session")->gallery) return true; else return false; } // perform login if($input->post->userLogin) login($input->post->login, $input->post->password); // login user and set the corresponding gallery function login($login, $password) { if($login != '' && $password != '') { // get page to login/password // gc = Gallery Customer $gc = wire('pages')->find("galleryLogin=$login, galleryPassword=$password"); // check exactly if only one login/password combination fits if(count($gc) == 1) { // set gallery in session wire("session")->gallery = $gc->first; return loggedIn(); } else // login data incorrect (or bad configuration) return false; } else // login and/or password are not set return false; } // perform logout if($input->post->userLogout) logout(); // logout user function logout() { // unset gallery in session wire("session")->remove("gallery"); // return current login status to proof success return loggedIn(); } // redirect if(!loggedIn() && $page->name != 'kundengalerie') // redirect to loginform if not logged in, but only if not already on loginform $session->redirect($pages->get("/kundengalerie/")->url, false); elseif(loggedIn() && $page->id != $session->gallery->id) // redirect to gallery if logged in and not the correct gallery page $session->redirect($session->gallery->url, false);1 point
-
I'm responding from phone so keeping it short: $image = $pages->get("template=page-headers, sort=random")->images->getRandom();1 point