Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 03/12/2014 in all areas

  1. Short tip Use the ajax powered search to find pages you want to edit—it's a super-fast way to get around the admin. Longer (but same) tip I was on the cusp of not writing this because it is likely so obvious to so many, but just in case you are like me in terms of navigation in the Admin for editing pages... In PW 2.4 the new search makes finding pages lightening fast. While some themes from before 2.4 was released display recently edited pages to help speed navigation, the new default theme in 2,4 doesn't; and I missed that a bit. But the new search is super fast so now whenever and wherever I am in the Admin, if I want to edit a page I just type in the search box, it ajax-pops, one click and I'm in the page ready to edit—no need to visit the page tree Thanks to Ryan and crew for this small but great advance OK, back to work.
    10 points
  2. It's possible, but you have to script it your self. I do think captcha is not a good solution it's a problem on it's own. ( many times I can't read them and always can't stand them ) And i'm not alone in thinking this. Better to use a "honeypot" with javascript. Or write a simple turing test. (I don't want to be rude here, but I found a nice infographic that I want to show)
    5 points
  3. Hey, [NOTE] I have no idea if there's a better way, already a module that does the same or slightly different I just made this and I love to share this in case someone needs it! Onto the intro: every time I use the PHP Mail() function I find myself frustrated in the way I receive these e-mails so I found a library PHPMailer that lets you use SMTP fairly simple and because I love processwire I made this into a module Get it here: Github Basicly you use it almost the same as the PHP mail function, but this time you setup your SMTP (I've tested it with gmail) and call a method called send() on $phpmailer. Here's settings for gmail: - security: tls - port: 587 here's a example of usage: $subject = 'test'; $message = "Test message"; $r = $phpmailer->send($subject, $message, array($user->email => $user->first_name. " " .$user->last_name)); Arguments: - Subject: string - Message: string(html or whatever) - Recipient: array(email:string => name:string) - Attachment: array(path:string) !OPTIONAL It returns a 1 on success and an error string on failure. Use it, or don't. See you all around
    4 points
  4. muzzer, I think you will be compelled to change your profile photo to something happier when you are done. Perhaps smiling and drinking a beer.
    4 points
  5. Ellipsis on collapsed fields looks good here. If you want to add this now. _inputfields.scss (Line: 131) Current: .InputfieldStateCollapsed { .InputfieldHeader { /* different style for collapsed header */ display: block; padding-bottom: 0.75em; background: $label-link-collapsed-bg; border: 1px solid $subtle-border; color: $label-link-collapsed-color; &:hover { /* style for collapsed header when hovered */ color: $label-link-hover-color; border-color: $subtle-border; background: $text-bg; } } .InputfieldContent { /* collapsed Inputfields don't show their content (only header) */ display: none; } } Replace with .InputfieldStateCollapsed { .InputfieldHeader { /* different style for collapsed header */ display: block; padding-bottom: 0.75em; background: $label-link-collapsed-bg; border: 1px solid $subtle-border; color: $label-link-collapsed-color; &:hover { /* style for collapsed header when hovered */ color: $label-link-hover-color; border-color: $subtle-border; background: $text-bg; } /* Add ellipsis to collapsed fields per ceberlin */ &:after{ content: " \2026"; } } .InputfieldContent { /* collapsed Inputfields don't show their content (only header) */ display: none; } }
    4 points
  6. 3 more ideas (I hope I am not repeating something this time): 1. For the titles of collapsed fields add an ellipsis… (for example with CSS for the collapsed field's title something like: ::after {content: "…";} ) Why? My clients have difficulties to identify collapsed fields as expandable with more content available inside. 2. If repeater or group is collapsed, infos about required missing content are hidden. I would suggest that in this case those blocks are auto-expanded to show the spots to fix. 3. Repeaters - 1st element already visible Option in repeater settings to aways show the first element for new pages without requiring the click on "+add" helps clients to identify, what this area is for.
    3 points
  7. This module creates a blank dashboard page in your site admin and sets it as default when you login instead of the page list. It came from a need in a few projects where I was creating modules for various user roles to use and I didn't want them to see the page list at all, but needed to display various stats and quick access buttons. For example, if you have a person who is creating invoices or doing other back-office stuff in various other Process modules then as an admin you wouldn't want them to access the page tree anyway, and there are other scenarios where you might want to have a dashboard instead of launching straight into the page list. It also requires (and adds) a permission - "dashboard" - so you can create new roles and assign the dashboard permission to those roles - something you might want to do fairly commonly if you have a lot of admin modules that you want to restrict access to. Editing the template is simple - there is a dashboard.php template file in the /site/modules/ProcessDashboard/ folder (decided to leave it in there to keep it safe, but I might be tempted to move it into /site/templates/ ) as well as .js and .css files ready to add your code to. You can use the API as you usually would to create your dashboard experience. For example, display data based on user roles or even specific users using code like this: if ($user->hasRole('invoices') { echo "Hi staff member $user->name. View invoices to be processed below: ... ..."; } if ($user->name == 'pete') { // Show some super-awesome stuff here } You can also do away with the dashboard.php template file and edit the module directly, putting your code and output in the execute() function (the way most Process modules are written) but I decided to include the separate template file to make it easier for more people to use. This does touch on areas a few other modules have addressed to some degree (like diogo's Custom Admin Pages) but this is designed for one purpose - instant dashboard creation. You can download the module here: http://modules.processwire.com/modules/process-dashboard/ This module also uses code from diogo's ProcessHomeAdmin module so that the default admin page can be overridden.
    2 points
  8. Like the rest of us. Although soma's photo is from day after...
    2 points
  9. None that I know of, but you can always do this: $fs = array("body", "title", "summary"); foreach ($fs as $f) $page->save($f); According to Page.php, for single field save you'll want to hook into Pages::saveField(). Isn't this exactly the same question that Wanze answered quite a while ago, or am I missing something? If you still need those wildcards, then it could, of course, get more complicated
    2 points
  10. Thanks for this Harmster. There has been a great deal going on regarding a mailing class, etc. Have a look at this thread: http://processwire.com/talk/topic/5693-new-module-type-wiremail/ ProcessWire now has a new mail base class that you can use with other mail classes. See Horst (WireMailSmtp) and Teppo's (WireMailSwiftMailer) for instance...You might want to make use of the new base class in your module..
    2 points
  11. Guess this will follow us for the next years to come This setting that is.
    2 points
  12. Any chance that those links point to localhost? If this is a PW 2.4 site, make sure that you've got your sites current domain in /site/config.php httpHosts array (or that this array is empty, i.e. there's no "localhost" there).
    2 points
  13. To me, It's like converting mercedes to VW Golf.
    2 points
  14. And for those of us in need of a JSON to CSV convertor: http://konklone.io/json/
    2 points
  15. Like that phrase It is indeed strange. I mean, if you understand the workings of pw that good that you can make a convertor for it, then it wouldn't make sense anymore to convert it. Probably is just a try to make money out of ignorant site users. Edit: Website/Template convertors or generators output hopeless bloated code. Who would like to have such a website ? Can never match a cms/cmf with hand coded templates. Not even speaking about a cms/cmf with a low level abstraction layer like pw. Good example: artisteer. Just look how that outputs bloated code.
    2 points
  16. Recently I got a brand new iMac so I needed to install PHP SQL and configure Apache. I'm using the same web develop environment for years and I'm really happy with it. Raymond is also using this and Arjen did the same recently. I love to share how I setup this environment in a step by step tutorial. Let's setup PHP, MYSQL and activate mail using gmail smtp for OSX 10.6 and up, perfectly suitable for ProcessWire. It doesn't install Apache, it uses the Apache installation, which comes with OS X. The PHP installer package is created by Liip and it is based on entropy's php package. For MYSQL we gonna install the DMG Archive (x86, 64-bit). After we installed PHP, we configure Apache & PHP so that we’re able to run the ProcessWire sites in our own ~/Sites directory. For El Capitan see Arjen's https://processwire.com/talk/topic/5797-setup-a-processwire-environment-on-a-fresh-macos-x-install/?p=103674 Install PHP We gonna use the PHP installer created by Liip. (more information) Go to: /Applications/Utilities/ Open: Terminal.app Type: curl -s http://php-osx.liip.ch/install.sh | bash -s 5.5 Press: RETURN Type: your admin password Press: RETURN ( download starts and continues with a the install ) note: If you want to have an older PHP version, replace 5.5 with 5.4. (PHP 5.5 is the current stable) After the install is completed Apache is restarted and complains about “Could not reliably determine the server's fully qualified domain name, using your-computer-name.local for ServerName”. This notice is not a problem, we only use this Mac for local website development. Setup Apache Open a new finder window. Press: shift + command + g ( Go to folder ) Type: /etc/apache2/ Press: go Open: httpd.conf Find the line: #Include /private/etc/apache2/extra/httpd-vhosts.conf Remove the # infront to enable. Press save and enter your password when asked. Enable the use of ~/Sites folder:Open the folder /etc/apache2/users/ * Duplicate the Guest.conf and name it martijn.conf Open the duplicated file that we created * Change: <Directory "/Users/Guest/Sites/"> to <Directory "/Users/martijn/Sites/"> Change: AllowOverride None, to AllowOverride All Save the file. The file should look like: <Directory "/Users/martijn/Sites/"> Options Indexes MultiViews AllowOverride All Order allow,deny Allow from all </Directory> Configure the vhosts includes Open /etc/apache2/extra/httpd-vhosts.conf Comment out the 2 VirtualHost examples by putting a # in front Be sure that NameVirtualHost *:80 doesn’t start with a # sign. * Add the include: include /Users/martijn/Sites/_vHosts/*.conf at the bottom of the file. Save the file, password will be asked. The file should at least have these two lines: NameVirtualHost *:80 include /Users/martijn/Sites/_vHosts/*.conf * ( Replace martijn with your short admin name ) The ~/Sites folder (Users/martijn/Sites) Goto your user Home folder. Create the Sites folder in your user home ( if not exist ) Create inside the Sites folder a folder called _vHosts Create the folder domains inside the ~/Sites folder Create a folder inside the domains folder called processwire ( processwire will be the domain name ) Inside the processwire folder create 2 directories: 1. htdocs 2. logs ( make this writeable by right click the folder and choose Get info ) Create inside the htdocs folder a file called index.html with some content. The folder structure should look like: ~/Sites |`-- _vHosts | `-- domains | `-- processwire | |-- htdocs | `-- index.html | `-- logs Configure PHP Open the file: /usr/local/php5/php.d/99-liip-developer.ini ( This file is the last ini file that gets loaded, so perfectly suitable for your personal settings ) Make your personal changes here. ( setting xdebug.max_nesting_level=1000 for example if needed ) Save the file ( password will be asked. ) Make an alias the this file by right click and choose: Make Alias Name the alias _settings.ini or what ever you want to name it. Move the alias to your ~/Sites folder Create a vHostIn our ~/Sites folder we created a folder named _vHosts. This folder we gonna use for the vHosts. All files ending with .conf in this folder will be loaded when we (re-)start Apache. Create a new file with your favourite text editor. Type the following in the file: ( Replace martijn with your short admin name ) <VirtualHost *:80> DocumentRoot /Users/martijn/Sites/domains/processwire/htdocs/ ServerName processwire ErrorLog /Users/martijn/Sites/domains/processwire/logs/error.log.txt CustomLog /Users/martijn/Sites/domains/processwire/logs/access.log.txt common </VirtualHost> Save the file with the filename processwire.conf in the folder _vHosts The hosts fileGo to the Finder Press: shift + command + g ( Go to folder ) Type: /etc/hosts & press return Open the hosts file with you favourite editor Type 127.0.0.1 processwire below 127.0.0.1 localhost but above 255.255.255.255 broadcasthost Save the file Right click the file & choose: Make Alias Move the alias that you created to your ~/Sites folder Rename it to _hosts The file should look like: ## # Host Database # # localhost is used to configure the loopback interface # when the system is booting. Do not change this entry. ## 127.0.0.1 localhost 127.0.0.1 processwire 255.255.255.255 broadcasthost ::1 localhost fe80::1%lo0 localhost Test the Apache & PHP setup Go to: /Applications/Utilities/ Open: Terminal.app Type: sudo apachectl restart Press: RETURN Type: your admin password Press: RETURN At this point Apache & PHP will be up and running.Go to a browser and type: processwire/ in the address bar and press enter. MYSQL For managing MySQL databases I use Sequel Pro it's a very handy tool and in this tutorial we set the root user password with it. For the SQL server we gonna use the MySQL DMG Archive (x86, 64-bit) Download the following: MySQL DMG Archive (x86, 64-bit) Sequel Pro Open the mysql-5.6.16-osx10.7-x86_64 image * install mysql-5.6.16-osx10.7-x86_64.pkg, MySQLStartupItem.pkg & install the prefPane * if MACOSX complains about: ( mysql-5.6.16-osx10.7-x86_64.pkg” can’t be opened because it is from an unidentified developer. ) You should open your System Preferences, go to Security & Privacy and Allow apps downloaded from: Anywhere Set the root user password Double click the sequel-pro-1.0.2.dmg. The disc image will mount Drag'n'drop the Sequel Pro.app to your /Applications/ folder. Open Sequel Pro Type by name: 127.0.0.1 Type by host: 127.0.0.1 Type by username: root Login Press command + u Select the root user on the left side Fill in the password Press apply We're Done ----- Todo how to use it after the setup is complete
    1 point
  17. Hey, over a year ago I build the website for the bar "Kapitl21" which is really close to where I live in exchange for a beer flat (<- was my idea ). I completely forgot to post it here. Hope you guys like it: http://kapitel21.de / Nico
    1 point
  18. Thanks for the great replies all. No, the port is from modx Evo, not Revo. When Revo came into beta I had a play around and decided it was not my thing (and as pwired mentioned the admin was so damn slow) that's when I went hunting and was lucky enough to stumble on PW. Man, I actually enjoy doing websites again now Thanks for the explanation on the database Joss, exactly what I was looking for. I will get the site up and running and then look at template caching or ProCache.
    1 point
  19. Macrura, Glad to have helped. I will warn you, creating simple ProcessModules are a gateway drug. Once you start creating modules, it's addicting. As has been stated by others, there are definitely cases where using the module is a good choice too.
    1 point
  20. Gotta love bitbucket and SourceTree
    1 point
  21. I am actually pretty shocked that no one has mentioned GIT, github, bitbucket, etc. ? I occasionally switch between my desktop and laptop - which I hardly use. And GIT has been truly indispensable.
    1 point
  22. @renobird - thanks for posting this; I just converted an admin page that was using this module to a process module, and your example helped... guess i'll be moving on and converting the rest of my admin pages to use process modules... thanks again to everyone posting about this!
    1 point
  23. > #3: To have the first element already visible with repeaters, you can adjust the "Ready-To-Edit New Repeater Items" setting. I have set this to 3 (which is the default). From my understanding this only means that you can add that certain amounts of repeating elements without having to save the page in between. It does not mean (at least not in my PW 2.4.1 dev version) that 1 element is already set, visible and ready for input. And that is what I would like to have. If I set one of the repeater's fields to "required" the PW behavior is unexpected (bug?). There comes an error about a missing field content. But that field was not set with the +ADD ITEM at that time. Thank you very much for the code. I would like to avoid applying changes to the wire folder or any modules directly - I do not want to break it when there are updates. It the idea does not find general support, I could consider overriding certain css with some plugin or so.
    1 point
  24. I'm glad I started this thread now! Thanks for the edits Soma; So many times you've helped, VERY grateful!
    1 point
  25. Just thought you guys might like to know that the priority setting just got another user Needed to solve the conflict between RedirectIds and 404Search modules. Thanks again Ryan for thinking of everything!
    1 point
  26. Hello Peter, PW 2.3.0 uses PDO and it seems that with some server configurations this can happen. There is a fix from Hari KT, that I have used instead of the existing WireDatabasePDO.php in a PW 2.3.5 Installation. And since then I haven't had that (rare) error anymore. Ryan already has included it into the current Dev Branch (PW 2.4.1), too. Maybe you like to try it. WireDatabasePDO.zip
    1 point
  27. ooh, better find my own self portrait then. This one was made from plasticine:
    1 point
  28. I'm probably not the slowest but by faaar not the fastest. I have my own finger system and writing English and code half blind and writing on computer since 26 years now may helps a little. But by no means do I master coding or using all potential of editor. I'm a creative who loves coding.
    1 point
  29. Here you go....400 fields! http://processwire.com/talk/topic/4442-pw-performance-with-hundreds-of-fields/ Be sure to read Ryan's comments there.. Also see: http://processwire.com/talk/topic/1527-largest-project-performance-multi-server/?p=13779
    1 point
  30. I think ProcessWire would handle this fine. You can use ProCache to make it lightening fast too. See one of Ryan's sites: http://www.villasofdistinction.com Each villa seems to have a lot of data associated. I'm working on an invasive plants species site right now. Each species has about 30 fields (some of which are repeaters). It's still really fast. There are lots of people making very large scale sites around here. I'm sure someone else will chime in to offer additional reassurance.
    1 point
  31. @horst thank you for helping and pointing out a way to log the file names to see what is going on. I have placed both lines inside the WireMailSmtp.module and posted the form a few times to find out that nothing is logged. The code is right because putting the following line in the __construct() created the expected log file correctly. wire('log')->save( "debug_attachments", "tralalala");I came to the conclusion that form builder is not realy sending the files as attachments. All it does is save the attachments to /assets/cache/form-builder/form-x/entry-x/ and rendering a 'special' link to those files. So now i'm sure the bug is form-builder related and not in your WireMailSmtp and/or WireMailSwiftMailer module.I will report it in the form-builder forum and see if i can find out something more to backup the bug report with. Update: Haha Ryan is always 3 steps ahead I found this line in InputfieldFormBuilderFile.module // @todo this is producing invalid file links when more than one file on the page
    1 point
  32. Well it requires some knowledge and understanding of ProcessWire, so I lied when I saids soo easy. It's the where to hook what and how and when and what is returned and what are the arguments. Some are rather simple to figure out and some are very hard. Some even took me long time to get right, try and error But nonetheless the basic concept is easy to grasp and some good and simple hooks are in the HelloWorld.module, that's where I started too 2 years ago. This is example module that does remove the "new" on second level basic-page pages in the page tree. This only modifies the actions and does not prevent adding child pages via API elsewhere. This hook is tricky as it also is all called via ajax in the page tree, so you can't simply echo something to debug. ProcessPageList.module is the module where the actions are done, but it contains 3 classes actually, and you need to hook into ProcessPageListRender::getPageActions, catch the $options array this method returns which contains all actions as a nested array. If a method returns something you can catch it with the $event->return. So all you need to do is to remove the "New" action from the array and set it back to the $event->return. Easier said than done. Here's a basic example module https://gist.github.com/9493877
    1 point
  33. I agree — ProcessModules are the way to go. They might look intimidating at first, but if you start with a very simple example, they really are very easy. Here is a super simple example that lists all pages with the template "news". (I'm sure there are others out there, but it only took a few minutes to write so...) <?php /** * Simple Process Module Example. * This is a very basic example to learn from. * I have no intention of expanding on this sample module. * * @author renobird * * ProcessWire 2.x * Copyright (C) 2011 by Ryan Cramer * Licensed under GNU/GPL v2, see LICENSE.TXT * * http://www.processwire.com * http://www.ryancramer.com * */ class SimpleProcessModule extends Process { public static function getModuleInfo() { return array( 'title' => 'Process Module (basic example)', 'summary' => 'A very simple process module as an example on how easy they are to create.', 'version' => 100, 'href' => '', 'permission' => '' ); } public function init() { // initialize the parent parent::init(); } public function ___execute() { // Find some pages $items = $this->pages->find("template=news"); /** * Create a table to display results * There are other ways to do this using MarkupAdminDataTable module, but let's keep this simple for now. */ $out = "<table width='100%'>"; $out .= "<thead>"; $out .= "<th>Title</th>"; $out .= "<th>Date Created</th>"; $out .= "<th>User</th>"; $out .= "<thead>"; $out .= "<tbody>"; // If $items pageArray is not empty if ($items->count() > 0){ foreach ($items as $item) { $out .= "<tr>"; $out .= "<td><a href=". $this->config->urls->admin . "page/edit/?id=" . $item->id .">" .$item->title . "</a></td>"; // title $out .= "<td>" . date("F j, Y", $item->created) . "</td>"; // date created $out .= "<td>" . $item->createdUser->name. "</td>"; // user that created $out .= "</tr>"; } } else { // empty pageArray message $out = "<tr><td>No pages matching your criteria were found.</td></tr>"; } $out .= "</tbody>"; $out .= "</table>"; return $out; } } Usage: Install the module Create a new page under /admin/ Set the process for the new page to SimpleProcessModule If you have never created a module, just focus on the execute() method. Most of what is there is coded exactly as you might from a page template.
    1 point
  34. I don't know FormBuilder. wireMail()->attachment() needs an absolute path for every (disk) file it should attach to a message. You can pass it as array or have to call it multiple times. Here are all is working as expected. Maybe you can debug what is passed to the attachment function when running with FormBuilder? You can call a log here wire('log')->save( "debug_attachments", strtolower(__FUNCTION__).' :: '.serialize($filenames)); // ATTENTION this is $filename(s) ending with s and here wire('log')->save( "debug_attachments", strtolower(__FUNCTION__).' :: '.serialize($filename)); // ATTENTION this is $filename, without s Trying this with passing an array logs something like: 2014-03-11 14:04:36 guest http://pw4.kawobi.local/mailtest/ attachments :: a:2:{i:0;s:75:"W:/WEB_MIRRORS/_ProcessWire/pw4/htdocs/site/assets/files/1/hyatt2.0x100.jpg";i:1;s:79:"W:/WEB_MIRRORS/_ProcessWire/pw4/htdocs/site/assets/files/1/westin_interior1.jpg";} 2014-03-11 14:04:36 guest http://pw4.kawobi.local/mailtest/ attachfile :: s:75:"W:/WEB_MIRRORS/_ProcessWire/pw4/htdocs/site/assets/files/1/hyatt2.0x100.jpg"; 2014-03-11 14:04:36 guest http://pw4.kawobi.local/mailtest/ attachfile :: s:79:"W:/WEB_MIRRORS/_ProcessWire/pw4/htdocs/site/assets/files/1/westin_interior1.jpg"; Calling it multiple times (2) with string filenames: 2014-03-11 14:10:10 guest http://pw4.kawobi.local/mailtest/ attachments :: s:75:"W:/WEB_MIRRORS/_ProcessWire/pw4/htdocs/site/assets/files/1/hyatt2.0x100.jpg"; 2014-03-11 14:10:10 guest http://pw4.kawobi.local/mailtest/ attachments :: s:79:"W:/WEB_MIRRORS/_ProcessWire/pw4/htdocs/site/assets/files/1/westin_interior1.jpg"; 2014-03-11 14:10:10 guest http://pw4.kawobi.local/mailtest/ attachfile :: s:75:"W:/WEB_MIRRORS/_ProcessWire/pw4/htdocs/site/assets/files/1/hyatt2.0x100.jpg"; 2014-03-11 14:10:10 guest http://pw4.kawobi.local/mailtest/ attachfile :: s:79:"W:/WEB_MIRRORS/_ProcessWire/pw4/htdocs/site/assets/files/1/westin_interior1.jpg";
    1 point
  35. Each page that is shown is only a template file with fields rendered on it. So, if the front page of this site, the landing page, is meant to be the users home page, then this is not a problem to use just home.php as default. Once a user logs in, then the page will display information relating to that particular user. You can also decide what to display based on role - if a user has a particular role (like admin) then you can just check if they have that role before displaying that information. On the front end of the site, you can display anything you like in any order you like. You do not have to reflect the page tree element for element - people tend to do that simply because it makes it easier to manage, but it is not vital. So. the ROOT of the site is home. (core has nothing to do with anything here - forget about it). Home is your landing page and you can use it for anything. So, you could use it for an entire dashboard which is only shown if a user is logged in, or you can use it for something else. You could write in php if($user->isLoggedin()){ lots of page stuff }else{ login form } All websites have a landing page and, logically, that page is ALWAYS at the top of a tree. Once they are logged in, you can stay on the home page (and home template file) and show them all the bits they need to see on their landing page. Then you can just build stuff under home: Home --Profile ---- Manage ---- Messages ---- My picture ---- My docs -- Company News -- Club ---- Club venues Whatever you need to do. You can either have a top menu that follows the same logic (but perhaps tell it not to display certain elements unless they are logged in) or you can just have a menu in each section that calls information from any part of the tree you like. THIS IS IMPORTANT - when we create menus that follow the tree, you will notice that they ignore the home page initially then add it back on. This means, as far as the front menu is concerned, Home, Profile, Company News and Club would all be on the same level. Even though Profile, for example, is actually a child of Home. So, for your front end, Home is your landing page, and the others are you toplevel main menu items.
    1 point
  36. True, true - I use that sometimes too when dealing with small json snippets, but head to one of those others when things get larger. Lots of options I guess - in general it blows me away all of the cool dev tools we have available now - almost too many - could spend all your days investigating new things and not getting anything done
    1 point
  37. Makes sense I usually do that with Chrome dev tools. It's not that pretty, but handles the job of collapsing, displaying data types and lengths etc. quite well.
    1 point
  38. Ha! A couple of years ago I got a call from a station saying a client had a jingle which needed an edit on it - some old thing they had used for years. So I said to send it over. When it arrived, not only was it some thing I had composed years before for a different client and so was not licenced for them to use, but it had never been licenced for any of the stations they had been on and the singer's licence had run out ten years before. I did quite well out of the ensuing letter from my lawyer...
    1 point
  39. Wow, that is incredibly elegant. It doesn't quite do what I want, but replacing %d with %w does (all pages on a Sunday, then all pages on a Monday etc.) Thanks, soma!
    1 point
  40. There's also a way to add day to page on the fly. foreach($result as $res){ $res->day = strftime("%d",$res->getUnformatted("date")); } $results->sort("day");
    1 point
  41. Good Morning Everyone! As you know, we're a proud Processwire website that (thanks to this awesome CMS) hasn't looked back since moving from WordPress. We're so pleased, we're launching a couple of new sites also based on the same feel that Mr. Amazing (Ryan) developed. (For future reference, he shall now henceforth be referred to as Mr. Amazing whenever I write a post). I'm planning out the upcoming 2014 Critics' Choice CMS Awards and would love to hear some creative thoughts as to how to use Processwire (or some other method) to come up with a creative voting and nominations process. Last year, I used FormBuilder and made a simple form that people needed to submit and while it worked fine, I'm wondering if there's a better solution that might be a bit more engaging. I'd love to hear anyone's ideas / thoughts as to what options might be out there. Thanks in advance for your time! ~Mike (ps: processwire rocks)
    1 point
  42. LOL. 8. I like pictures of cute animals and surf them all day while pretending to be working.
    1 point
  43. For voting I would require fb, google, twitter (etc...) or email authentication. Makes it harder to cheat the system.
    1 point
  44. Hi and welcome Its easier to sort of go through this in a very boring way ProcessWire has a fairly basic construction: Fields > Templates > Pages As you would have already noticed. Firstly, it is important to realise that Templates and Template Files are not the same thing. Templates are your way of grouping fields together and template files are for markup for displaying pages. PW has no practical limits for the amount of fields, templates, template files and pages you create, so really you can do as many variations as you need - it really wont matter. The API in ProcessWire allows you to manipulate the field data associated with either the page you are currently viewing ( so $page->title, for instance) or it allows you to get or find fields from other pages or groups of pages. One of the most important areas for you to look at in the API is probably the section on selectors as this will give you a lot of details about relationships and retrieving field data. So, looking at Profiles for the moment. You might create a file in sites > templates called profile.php Then in the backend, you would create a new template - it will show that profile.php is available as a template file and you would choose that, obviously, then give your template a name - profile would be good! You now create a bunch of fields that you want to use for the profile. In some ways this is a bad example because there is already a template in the system for users, but we will pretend for the moment there isn't! However, when you create a template in the backend, after you create it you can associate other template files with it, should you wish. Add your fields to the profile template and you are half way there. From this point on, it is simply a case of using PHP and the API in profile.php to create what you need - and it is much simpler than starting from scratch. The API is very powerful and will do a lot of the work for you, while leaving you to do whatever layout you wish. That template and template file combination can now be used for creating thousands of profiles. When you link to one of those profiles, it will use the template and associated template file to render the data. The template file can be used for both displaying data and for creating input forms for editing data. (Other people can give you more of a lead about that). Now, with other pages, if you need to create completely different templates for each page because they are all completely different, then that is what you do. Not a problem. Though remember that any field can be used in any template. So, if all your templates need Title, page_meta, mani_text and so on, then you can reuse field as you wish (note, you can only have one instance of each field in a template, for obvious reasons - so if you need two textareas, you will need to create two textarea fields) The point with PW is that apart from following the relationship between fields > templates > pages, it is flexible enough for you to work however you wish, more or less and very fast once you get the hang of it.
    1 point
  45. Take a tip from the PW tutorial I am currently writing: Make a coffee, get a huge piece of paper, a pencil and an eraser, lie on the floor and get planning. You will get your approach worked out ten times as fast as you will on some new-fangled computer gizmo!
    1 point
  46. Did you ftp .htaccess and double check ? Was there some upgrade done on the server ? http://processwire.com/talk/topic/4434-pw-not-installing-correctly-admin-not-found/#entry43493 -------------------------------------- Here are a few things to check: setting chmod of /site/assets/sessions/ to 777 from: http://processwire.com/talk/topic/1175-cant-login-to-existing-processwire-site/#entry10427 create the "/site/assets/sessions/" folder new by hand from: http://processwire.com/talk/topic/2786-request-seems-to-be-forged/#entry30109 http://processwire.com/talk/topic/2786-request-seems-to-be-forged/#entry32545 changing the session name from: http://processwire.com/talk/topic/4011-cannot-login-to-admin-area/#entry40203 turn on debug from: http://processwire.com/talk/topic/490-how-to-reset-your-password-how-to-enable-the-forgot-password-function/#entry7987 http://processwire.com/talk/topic/2965-sys-admin-problem-cant-login/#entry29256 reset password from: http://processwire.com/talk/topic/2965-sys-admin-problem-cant-login/#entry35624 http://processwire.com/talk/topic/1736-forgot-backend-password-how-do-you-reset/ http://processwire.com/talk/topic/4144-need-help-locating-or-creating-admin-user/ run mysqlcheck --repair from: http://processwire.com/talk/topic/3643-cant-access-login-on-existing-site/#entry35697
    1 point
  47. I once created a pseudo/subdomain CDN like this: I created 10 subdomains cdn1.mydomain.com cdn2.mydomain.com,.. all pointing to the same folder as the mainsite. In my templates I had some simple logic to output my assets with one of these subdomains (If i remember correctly i used the last number of the page id, which worked quite good in my case). The only thing you need now is something like this in your .htaccess right after the www-redirect: # subdomain CDN for my image assets RewriteCond %{HTTP_HOST} ^cdn(.*)$ RewriteCond %{REQUEST_URI} !^.*\.(jpg|jpeg|png)$ # all other requests are redirected to the main site to avoid duplicate content: RewriteRule ^(.*)$ http://www.mydomain.com%{REQUEST_URI} [L,QSA]
    1 point
  48. Give three programmers individually the task for a specific application and you'll get three complete different solutions. Ask them to look through each others code and all will correct each others.
    1 point
×
×
  • Create New...