Jump to content

Leaderboard

Popular Content

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

  1. https://twitter.com/apeisa/status/462216383557033985
    8 points
  2. It's not often I'm impressed, so I only feel that it's right to express my appreciation to those behind the development of PW. I've only been using PW since March this year, but it's been a joy to work with. I knew nothing about PHP beforehand, and now I'm able to achieve my goals without too much stress thanks to the excellent PW API. For my current project, I'm jumping in at the deep end by creating an online community where my members will have a basic forum, comments system, gallery, private messages etc. At first I thought this would be an impossible task, but my custom comments system seems to be coming along nicely, all without any stressful programming. I'm fairly sure I'm doing a few things wrong, and I'm sure there are more efficient ways to deal with my problems, but that's what I love about PW, we can do it our way. For my comments system (which I've started from scratch as a learning exercise) I simply wrote some template code to check for a sub-page called "comments" under the current page, article etc. If it's not there, it will be created when a comment is posted. This comment would then appear as a new page under the comments page, as would all the other comments. I'm not sure if this is a good way to go about it, but it works, and I can keep developing it to allow comment editing, quoting etc. Anyway, thanks again. I look forward to see what the future holds for PW, but as it currently stands, it's exceptional.
    6 points
  3. The picture is so much better with me already gone (and Antti behind the camera).
    4 points
  4. I agree. Only the young and pretty ones left!
    3 points
  5. If you like, please check out one of our latest projects - A tiny website to a local veterinarian. As usual beautifully powered by the stunning Processwire: http://www.tierarzt-partale.de Thank you so much for all your efforts and support.
    3 points
  6. Thanks guys, that was a lot of fun! I hope we can make this a habit.. and Antti, don't forget that tournament we talked about
    3 points
  7. Hi ankh2054! You can use it like this: try { if($session->login($user, $pass)) { $session->redirect("/"); } else { $login_errors = "Username or Password is incorrect"; } } catch (Exception $e) { $login_errors = $e->getMessage(); }
    3 points
  8. Wish I was there. Next time I'm on a plane.
    2 points
  9. did you enable access for that role on the home template and the admin template? i think user access has to cascade from the home
    2 points
  10. I was round at my mother's house earlier in the week and needed to make some notes, so I used her old "portable" manual typewriter. I had forgotten how much fun it is to use - how tactile and complete. One of the problems with modern tech is that despite being hugely quicker, it does not have the tactile immediacy or reactiveness off a pen and paper or typewriter or coloured pastels and so on. There is something about not having a delete key and having to put lines through mistakes or rub things out that can really help the creative process. And I see little point in trying to recreate that using computers - it already exists. We just need to remember to use it.
    2 points
  11. Landscape piece of paper and map out all necessary templates and fields that belong to them. I normally start with a base folder with my commonly used modules also. Pretty simple stuff.
    2 points
  12. Hi Max, I'm still making my way around PW so I'm nowhere near a power user, but here's my process for now: 1. First plan the site out and try to get a conceptual idea of what its components will be - templates, users, user roles, custom functions, modules, etc. 2. I'm not a front end dev, so I get a design done and coded into HTML/CSS for me, or I purchase one, or a client hands me one. 3. Create the database and install PW on a staging server 4. Create a template and page with fields just for the site configuration stuff - site name, site slogan (if needed), admin email, etc. and other things that the site owner might want to edit later from one central place. 5. Create the fields, templates, user roles, etc that I came up with in the planning stage, install modules 6. Port in the HTML/CSS, create pages, get the basic site skeleton done. I have a cheat sheet I'm slowly creating for myself as well as a collection of code snippets I reuse from project to project to make my work faster (because I understand things better when I simplify them for myself) and these help me to port templates into PW fast. 7. After I've done the simple template porting in I then code in any custom functions I need that I planned out before. 8. Fix any glitches I then test the site and move it from staging to production. This varies from project to project and sometimes I do things completely differently but this is my general process. Hope this helps somewhat
    2 points
  13. I start with a piece of paper and draw out the site. Then I work out what templates and fields I need Then I work out what framework (or none) that I will use. After that, I install PW with either a blank profile or something useful I might have kicking around and start creating fields, creating blank template files and whatever templates are on my list. By that point the site is really half created - I just need to make it play nice!
    2 points
  14. Good for? Why add another language on top of an already existing capable language (PHP?)...Yes, I know I used MODx and its templating language and loved it..but that was before I decided to take the plunge and learn PHP.......Anyway, this is like mermite...some people love smarty and similar while others don't. I like Ryan's summary here: http://processwire.com/api/why-php-syntax/. If you know PHP I suggest to forget template engines like smarty. They are just another layer of complexity you don't need...
    2 points
  15. Here is a quick guide to using the comments system. We start from the simplest usage, and get down into more configuration options further in the post. Making use of the Comments fieldtype 1. Make sure that Comments fieldtype (FieldtypeComments) is installed from the Admin > Modules menu. 2. Now go to Admin > Setup > Fields and create a new field. Select "Comments" as the fieldtype and give it whatever name you wish (I usually call it just "comments", and code snippets here assume it's called that). 3. On the next screen, you'll have several options to configure the comments field. Make sure that you enter a Notification email. This is the email address that gets notified when new comments are submitted. Currently it is the only way you will know when new comments are posted (short of checking the admin page yourself), so using this is important. 4. Now edit the template where you want your comments to appear. Enter this: <?php echo $page->comments->render(); 5. Likewise, in your template, enter this where you want the comments entry form to appear: <?php echo $page->comments->renderForm(); 6. Your comments are now ready to use. Note that any templates that use comments for posting should not use Template caching unless you configure the comments to post to another template/page. You'll see an option for this in the renderForm() options shown further down on this post. Adding the Akismet Spam Filter I highly recommend that you use the Akismet spam filter with your comments. To do so, you'll need an Akismet or Wordpress API key (http://en.wordpress.com/api-keys/). Once you have it, click to Admin > Modules > Akismet (CommentFilterAkismet). Enter your API key in the space provided and Save. Then go to Setup > Fields > and edit the comments field you added. Check the box for "Use Akismet". You'll also see a field that says how many days it will keep spam before deleting it. I usually set this at 1 or 2 days, just in case Akismet identifies something as spam that isn't (though it's yet to happen!). Hit Save, and your comments are now hooked into Akismet. Styling the Comments See the file attached to this message (at the bottom). It is a starting point for styling the comments. It's just pulled from the comments styling at processwire.com, so it should be seen as an optional starting point rather than as a ready-to-go stylesheet. Or, you may prefer to start from scratch on styling the comments, depending on your need. OPTIONAL: Customizing the Comments Output You may want to change some of the basics of the comments output. You can do this by passing arguments to the functions you called above to render the comments list and comments form. Included below are examples with all options. You may specify any one or more of the options -- only specify the ones you want to change: <?php // comments list with all options specified (these are the defaults) echo $page->comments->render(array( 'headline' => '<h3>Comments</h3>', 'commentHeader' => 'Posted by {cite} on {created}', 'dateFormat' => 'm/d/y g:ia', 'encoding' => 'UTF-8', 'admin' => false, // shows unapproved comments if true )); // comments form with all options specified (these are the defaults) echo $page->comments->renderForm(array( 'headline' => "<h3>Post Comment</h3>", 'successMessage' => "<p class='success'>Thank you, your submission has been saved.</p>", 'errorMessage' => "<p class='error'>Your submission was not saved due to one or more errors. Please check that you have completed all fields before submitting again.</p>", 'processInput' => true, 'encoding' => 'UTF-8', 'attrs' => array( 'id' => 'CommentForm', 'action' => './', 'method' => 'post', 'class' => '', 'rows' => 5, 'cols' => 50, ), 'labels' => array( 'cite' => 'Your Name', 'email' => 'Your E-Mail', 'text' => 'Comments', 'submit' => 'Submit', ), // the name of a field that must be set (and have any non-blank value), typically set in Javascript to keep out spammers // to use it, YOU must set this with a <input hidden> field from your own javascript, somewhere in the form 'requireSecurityField' => '', // not used by default )); Lets say that you just wanted to change the headlines for the comments list and comments form. You'd do this: <?php echo $page->comments->render(array( 'headline' => '<h2>Read Comments</h2>', )); echo $page->comments->renderForm(array( 'headline' => '<h2>Join The Discussion</h2>', )); OPTIONAL: Generating your own output If you wanted to generate your own output (rather than use the built in render() methods), you can iterate the $page->comments field: <?php foreach($page->comments as $comment) { if($comment->status < 1) continue; // skip unapproved or spam comments $cite = htmlentities($comment->cite); // make sure output is entity encoded $text = htmlentities($comment->text); $date = date('m/d/y g:ia', $comment->created); // format the date echo "<p><strong>Posted by $cite on $date</strong><br />$text</p>"; } You can likewise do the same for the comment form. But I don't want to get too far into this level yet since this is supposed to be a quick guide. Whats on the Comments roadmap? In my mind the biggest missing part is a central place to manage all your comments. Currently you manage them on a page-by-page basis, consistent with where the comment was posted. This is fine for simple uses, but becomes more challenging on larger sites, where you have to rely upon the notification emails to let you know where comments are posted. I would like to expand this so that comments can optionally be managed in a central place. In addition, I would like to make them as easily API accessible as pages. The comments are also not hooked into the user system. Every time you post, you are essentially posting as a guest. While the comments fieldtype will recognize your email address if you have posted an approved comment before, I would like to make it recognize the user system, and also recognize other user systems (like Twitter, Facebook and Gravatar). There is more needed too, like comments pagination and support for basic markup (comments can only contain text at present). If your needs are relatively simple, the Comments fieldtype is a good way to go. If your needs are more advanced, systems like Disqus and Intense Debate are excellent options to consider. The only issue I would have with those options is that they are javascript-based by default, so comments don't become part of your site's indexable content (to search engines like Google). comments.css.zip
    1 point
  16. Here's a video of a module we're working on that I thought you guys might like. The module, Lister, provides a different type of Page List than the tree that you usually interact with in ProcessWire. It gives you a table of pages with customizable columns, filters and actions. Rather than try to explain what it does, I figured I'd show you. This module also uses a new (soon to be released) Inputfield invented by Apeisa, developed by me, and sponsored by Avoine, called InputfieldSelector – it's what you see on the configuration screen as well as the Filters tab. I recommend bumping up the size/quality to 720p so that you can properly see everything. The video has no sound... I tried to do one with narration, but that didn't work out.
    1 point
  17. Update 09.05.2014: new version of minimize.pw released. I've updated this post and you can read more here. ProcessImageMinimize A service and module to make images lightweight: minimize.pw Our new commercial service for ProcessWire: minimize.pw With minimize.pw, you can shrink your images (JPG and PNG) without noticeable visible differences up to 80%. This makes pages load faster and helps you to work with people not familiar with command line image compression. You can try it for free. Learn more Download the module Github Page Module features Hooks into any Pageimage with ->minimize() (short ->mz() ) Automatic compression with a 1-click-setup (new) Overwrites original files or keeps both versions (new) Image compression with minimize.pw Fail-safe mode so that your visitors won't notice any problems if we're offline or you have no volume left. Usage with templates First, download and install the module. You have to enter a license key. Get a free license key hereTo embed a minimized image into your web page, simply call the method mz() or minimize() on your Pageimage-object. Please note, that is has to be a single Pageimage. We also support apeisa Thumbnails module. $img = $page->image; $img->minimize(); Or put in context $img = $page->image; echo "<img alt='A minimized image' src='{$img->minimize()->url}'>"; You can also use it combined with other Pageimage methods: $image->size(300,400)->mz()->url; Read more at Github Pricing While the module is free, our service is fee-based. We have to pay for servers and traffic With this version we've dropped our year-based pricing structure and introduce a new volume-based pricing. Everyone gets 2000 images for free and you can buy additional volume anytime. Free: 1000 images once 5000 images / 19€ 15000 images / 39€ 50000 images / 89€ Buying more volume will also drop the site limit of three. Questions Feel free to ask any question you might have.
    1 point
  18. Hi there, in need for a light knowledge base software and not happy with solutions such as MediaWiki, Dokuwiki or Confluence I decided to try to build such a tool based on ProcessWire. At the moment this profile is lacking of features, but doing well in the context it is created for - a somewhat protected simple knowledge base for internal use. It has some basic features but I'm aware that there's still way to go. So if anyone is interested, please find the code attached here or on GitHub: https://github.com/marcus-herrmann/ProcessWire-KnowledgeBase-SiteProfile I exported the data from a PW 2.4 installation, but not have tested it yet against older versions. Installation Before running the installer of ProcessWire copy/replace /site-default/install/ /site-default/templates/ /site-default/modules/ with the folders from this zip. Constraints It's not possible to export user roles with ProcessWire's Site Export Module this profiles templates are checking just whether they are accessed by an anonymous or logged in user. Features Tagging of wiki-articles Set articles to globally sticky ( = for all users) Personal bookmarking of articles for logged in users When using markdown to author wiki-articles, code highlighting via highlightjs Included modules Fredi MarkupSimpleNavigation Hopefully this profile is useful for you in any way. Best, marcus Edit: Forgot GitHub link... ProcessWire-KnowledgeBase-SiteProfile-master.zip
    1 point
  19. You're welcome But I think this module is not very helpful for your task. It's mainly useful if you want to provide one corresponding PDF per page. It does also store the PDFs under /site/assets/files/ for caching purposes - not what you want actually if I understand you correctly. In your case, I guess i would be easier to use for example mpdf to create your PDFs dynamically on the fly. About security: If your booking is somehow linked to the user in ProcessWire, this could be as easy as creating a new template with a corresponding page. This template, let's call it confirmation_downloads first checks if the user is logged in, otherwise throws a 404. Then you can pass along a get parameter with the booking ID. Next, the important check would be if the user of the given ID is the user who booked. If this is the case, you could use mpdf to generate a nice PDF and directly download it. I'm planning to improve this module by switching from TCPDF to mpdf and write a wrapper class which helps to generate PDFs. I think this will be a separate module. Pages2Pdf itself then uses the new class only to generate the PDFs.
    1 point
  20. Yeah, it was great fun, thanks all for coming! Dosbox and some old school indie games for next meetup, that is sure!
    1 point
  21. [sOLVED] http://httpd.apache.org/docs/current/mod/core.html#allowoverride File 'httpd.conf' in this section: <Directory "/home/*****/www"> ... # AllowOverride controls what directives may be placed in .htaccess files. # It can be "All", "None", or any combination of the keywords: # AllowOverride FileInfo AuthConfig Limit # AllowOverride None ... </Directory> Change: AllowOverride None To: AllowOverride All
    1 point
  22. By crop image field, do you mean you are using the cropImage module? You can use a normal image field for your Avatars. You interact with that image field like any other image field..only this time you are dealing with the 'user' template. Also remember that in the DB 'users' are stored as 'pages' so, similar API syntax... See this post by Ryan: https://processwire.com/talk/topic/10-how-do-i-interact-with-the-image-field-in-processwire/ and the docs https://processwire.com/api/fieldtypes/images/ Btw, do you need a profile image to be that big?
    1 point
  23. Manaus, Not sure what your App does or its design, but I'm not getting why you need to store IDs (basically integers) using JSON? Can't these be stored as comma separated values? If you want to go the JSON route, there's various threads on the forums you can have a look at (Google )
    1 point
  24. i think there are some unnecessary steps here, you could just do this: $mw = $pages->find("template=repeater_mitwirkend, check_access=0"); http://cheatsheet.processwire.com/selectors/built-in-page-selector-properties/check_access-0/ then you have all the performers; to get the page you use: $event = $mw->getForPage(); https://processwire.com/talk/topic/958-repeatable-fields/page-12
    1 point
  25. Joe, you still can list them directly on the event page and you don't ever have to go to a separate page to add new ones. You can create new performers directly from the event page. It would work as follows: 1) Create two templates - "performers" and "performer" (can have their own file or not) 2) Create a page on the pagetree called performers and give it the "performers" template. Now any children of this can be individual performers. 3) Create a field of type "Page" call it "performer". On the input tab, set the selectable pages parent to be "Performers" and the template to be "performer" and at the bottom click the checkbox "allow new pages to be created from field". Now add this performer field to the event template. You don't ever have to worry about performers again. Just add them as needed to the event page. Note: You can set this field to allow 1 performer or multiple performers. This is generally the advisable way to perform this sort of relationship in PW (it is far easier to search, sort and work with the API when the performers have their own page)
    1 point
  26. Hi and welcome to Processwire. Sounds like you've dived in and are having a good play around. The fun thing with PW is there's never one particular way to do things, and you can use it as a framework and bend it to your will. Looking forward to reading more from you. Enjoy the journey
    1 point
  27. I had the same question last year =) https://processwire.com/talk/topic/3044-why-is-there-no-user-title/
    1 point
  28. Great to have you here Guru and I think you summed up perfectly why we all love ProcessWire - it's just an incredible tool that allows us to do what we want and in many different ways. Your appreciation for what Ryan (and contributors) have created here will grow as you realise its true potential
    1 point
  29. Not needed in PW so leave them out of the way Outside PW, though, Savant looks interesting since it also uses pure PHP http://phpsavant.com/ -- Edit: :D just realised that Savant was first written by the guy that wrote that article you linked to.
    1 point
  30. Bash, mostly Kongondo explained the main reasons already and the rest was pretty much summed up by Paul M. Jones in his 2008 blog post titled "Another Smarty Emigrant": To be fair templating engines do have valid use cases, but those are almost entirely related to keeping things secure if you need to allow external or otherwise untrusted users (however limited) access to your codebase.
    1 point
  31. Nothing wrong with asking, but the scope of your question here makes it difficult to answer in sensible timeframe. There's also a lot of valuable content floating around here that already answers different parts of your question, but I'm assuming you've browsed through those, considering that you even started a thread about that. Something you said in that thread made me cringe a bit, though: "I need to chat less and read more". As I've been repeatedly told, we all learn in different ways, but IMHO you need to read less and do more. As they say, "the best way to improve at building software is to build software", and that applies to sites too. Build a couple of sites of your own and you'll have a lot better idea about what works for you.. and what doesn't. Nevertheless, this is an interesting subject, so I'll start by trying to answer your questions briefly based on my typical process: I don't "create a database and install PW", I've got a script for that. Repetitive tasks are boring and automating them is fun. I use a previously created site as my starting point. This base site includes common templates, template files organised exactly as I like (something derived from Zend Framework file structure and an implementation of the front controller pattern), various include files (functions.php with common and usually render-related functions etc.) and modules I often end up installing. I don't know what a "base template code system" is, but if you're talking about template engines (Twig, Smarty etc.) the answer is "never". Those things are are horrible and wrong. If you're referring to something like partials (as in "not full template files but files you'll include within your template files") and helper functions, then yes -- both are useful in their own ways. The projects we've built before are my "code clip folder". I could go on and on about this and probably will at some point post something about the directory structure, template logic etc. but don't really have time for that now. If you'd like to know something more specific, please don't hesitate to ask. You'll definitely get more (and more helpful) answers if you limit the scope of your questions a bit.. though don't be offended if people point you to existing threads either, as that's just the way things work around here. In some ways this forum serves as our collective data bank and the more discussions about same subject are grouped together the easier it is to dig into that subject later
    1 point
  32. Interesting https://github.com/raphaelbastide/ofont http://usemodify.com/
    1 point
  33. Launched just a few days ago: http://yummimami.de - a presentational website for a German startup supplying healthy and kid-compatible presented food to schools. Some features Responsive Forms via FormBuilder Navigation via MarkupSimpleNavigation (which, at least in my use case, evolves into something super essential for PW - like Views for Drupal for example ) Widget handling via having a big pool with pages of template type "widget", then referencing (and hence, rendering) them on content pages Editorial influence on the homepage teasers main color via SVG + field + ColorPicker (not necessary to that extent since the customer doesn't need to change the color to any other that magenta, green or brown - but still: proof of concept)
    1 point
  34. I have several ideas in mind for directory-based websites, and came across ProcessWire in my search for a starting point about a year ago. There are several good WordPress themes that are commercially available, but all the ones I've seen have various limitations that would preclude their use for what I have in mind. As a starting point for experimenting with ProcessWire, I had access to a list of churches and used that to develop a map-based directory here: Baptist Blue Book. The central issue for me was the map interface, and how to handle a reasonably large number of listings (~6,000) in that view (Most of the WordPress themes I had come across restricted the map view to a certain city, which I suspect was to limit the number of markers that had to be loaded.) A few notes: I'm using Ryan's Form Builder to accept suggestions for new listings. I liked having the packed solution for this, and the ability to control what happened to those submissions on the back end (e.g., the ability to hold them in a queue for review rather than posting immediately to the site). The church pages are subdivided by state (e.g., Directory > Texas > [church name]) by using a script to push a new listing to the proper sub-directory once it's approved. In hindsight, this may be an overly limiting approach, particularly for adapting it to international use, but once I had started on that path I needed to stick with it and focus on other issues. For the map view, a separate script pulls the latitude, longitude, and page-id from all listings and caches that in a JSON file. When the Map page is viewed, that file is retrieved and used to generate the markers. The content for the popups is only loaded as needed to minimize bandwidth. (Side note: I'm using MapBox for this, along with Leaflet and the MarkerCluster add-in.) All in all, I've been very pleased with the flexibility of ProcessWire, as well as the helpfulness of the community. I've also noticed several directory-type sites listed in the showcase, so I'm wondering if it might be useful to develop a module tailored to that application (or is each one so unique that this would not be feasible)? Any comments or feedback would be welcome. Brian
    1 point
  35. When the need is there for separate DB configurations and something more than config-dev.php, I've done it like this in my /site/config.php file: switch($_SERVER['SERVER_NAME']) { case 'localhost': // set database settings for localhost break; case 'dev.domain.com': // set database settings for staging server break; default: // set database settings for production server } You should give preference to SERVER_NAME in this case (over HTTP_HOST) just because HTTP_HOST is coming from the client rather than the server (open to tampering). Though it doesn't really matter as long as your last "default" condition assumes the production server.
    1 point
  36. This is sort-of built in to ProcessWire already on a basic level. If you make a copy of your config.php file called config-dev.php, then that one will take priority over config.php. Just ignore the -dev version in DeployHQ settings, or add it to .gitignore so it doesn't even get committed - up to you. As long as config-dev.php on your local system has your local settings in, and your config.php is treated as your live version, it should be fine
    1 point
  37. Use filter on template screen above to show system templates. Select user template add fields to it you want.
    1 point
  38. For security reasons, PW forces a "403 forbidden" if someone tries to directly access any PHP files in the /site/templates/ dir, as well as several other locations in PW's file system. So it's best not to put any PHP files that you need to directly access in any of ProcessWire's directories, because there's a good chance it'll block access to them. Here are a few alternatives: Option 1. Place your sendemail (and optionally phpmailer include) files somewhere outside of PW's directories. For instance, maybe you could create a dir called /form/ off your web root and place them in there. Then set your form to: action='/forms/sendemail.php' Option 2. Use your sendemail.php as a ProcessWire template. Create a page using that template, and make your form post to that page. Option 3. (the one that I use most often) Make your form post to the same page that it's on (i.e. action='./'). When you see one of your POST vars present, include your form processing script. i.e. <?php if($input->post->submit) { // process contact form include("./includes/sendemail.php"); } else { // output contact form }
    1 point
  39. Hi Ryan, Good to see you in the forums! This will make it into the main API documentation. I've been posting stuff here first, and then transitioning it to the main API docs after making sure I've accounted for everyone's questions, and haven't made any typos. Ryan
    1 point
×
×
  • Create New...