Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 01/14/2015 in all areas

  1. Finally bit the bullet and started learning ProcessWire with my own website. I've been using WordPress for about 10 years (and B2/cafelog before that!) but I really like what I see out of ProcessWire. I figured I should eat my own dog food so to speak before trying to use PW on a client site, so I present my redesigned portfolio site. http://builtbydavid.com/ BTW thanks go to everyone in this forum that contributes information. Whenever I wasn't sure how to do something, the site documentation here helped, and the forum posts helped where the documentation left off.
    5 points
  2. @nico I plan on included those changes. I've been working with it like that here, and I like it. Other notable things I've been working on this week: Fixed sidebar and header Save open/close state of sidebar (via cookie).
    4 points
  3. Any thoughts on having a private general discussion area on the forums for members that meet certain conditions? For example, members with 200+ posts etc? It could be called Private Pub or something. It's not so much for PW questions but general industry chat which you don't want public on the forums. Use case: I had a general client/freelancer question today which I didn't want to be public. That type of thing...
    3 points
  4. No one tells me anything!
    3 points
  5. Does your problem persist after removing the dependency, logging out and back in again? If I do that, the error is gone. It seems that the error just doesn’t get cleared properly. To fix this right now, you can hack the core. Open the file wire/modules/Process/ProcessProfile/ProcessProfile.module and change the following line: if(count($form->getErrors())) { To this: if(count($form->getErrors(true))) { The argument clears the errors that occurred during form validation. It should be safe. The errors are not used anywhere else as far as I can tell. Instead of hacking the core directly, it’s probably better to use the new multiple-modules feature. Funnily enough, Ryan uses the exact same file as an example in his blog post.
    3 points
  6. You can either use $pages->count("selector") the same way as find, just you receive a number of pages. Or you could also use $pageArray->count(), but then all the pages of the array have to be loaded, while the first one counts on the database level, without loading the pages into php. The standart php count($pageArray) works the same way as $pageArray->count(). if($design_prin_rel instanceof PageArray){ $related = "<h3>On related design principles</h3>"; foreach($design_prin_rel as $category){ // Only do stuff, if it's not 0; 0 == false, so no real need to have ... > 0 if($readings_dpr->count("selector to get only pages for $category")){ $related .= "<h4>" . $category->title . "</h4>"; foreach($readings_dpr->find("selector to get only pages for $category") as $item){ $related .= "<p> '<a href=$item->url>" . $item->title . "</a>' " . "-" . $item->book_section_reading_time->title . "</p>"; } } } } To learn/discover the api I would suggest having a look at this: http://cheatsheet.processwire.com. Don't forget the advanced mode. For more "in context" examples have a look here: http://processwire.com/docs/
    3 points
  7. Recently made the switch to DigitalOcean from shared hosting for years. I'm still super newb at it, but have learned to install LAMP + git, secured SSH and MySQL, created a couple VirtualHosts, git clone ProcessWire and setup, so far I've been pushing my home dev git repo. I don't know a thing about bash scripting, but one I get started, I'll probably end up writing one out, because so far I have had to duplicate these steps a couple times to get them running the way I want (workflow issues).
    2 points
  8. 2 points
  9. I knew Pete had asked about this ages ago, took me a minute to find it. Check out this reply from Ryan — it's basically an example of the str_replace() idea Soma mentioned above.
    2 points
  10. Because you're the one doing all the talki... err... the one in charge
    2 points
  11. An image is a already separate file from the HTML page, so it will be served independently anyways. You can keep the HTML img tag static and just swap out the image by doing something like this: <img src="/penguin/?of=d00m.jpg" /> <?php if ($input->get->of == 'd00m.jpg') { header("Content-type: image/jpeg"); readfile($page->pics->getRandom()->size(50,50)->url); die(); } Pros: – that url serves a random image every time, no matter how you access it Cons: – the url serves a random image every time, no matter how you access it I’m not really sure how this technique competes against a JS solution, but it’s an approach you can take.
    2 points
  12. That is an interesting thought since there have been times when I have wanted to discuss something client related as well that I didn't want to display publicly. As well I have noticed Processwire posts seem to get ranked on google pretty quickly these days(within minutes sometimes). Maybe 200+ post might be a is a bit excessive before being able to join such a private forum but on the plus side it might give others more incentive to get more involved in the forum before being entered into the Private Pub elite.
    2 points
  13. I do not know if it is an easter egg or our competitors intrigues, but when i write f-a-s-t a-n-d f-u-r-i-o-u-s without the hythens in personal manager, I get "Drupal and Joomla"))))))) Here too! What should I write to get "ProcessWire"? Maybe "Bigger, Faster, Stronger, Easier"?? Or "Faster and more furious"?.. Didn't work .
    2 points
  14. http://lmgtfy.com/?q=processwire+contact+form+api
    2 points
  15. Thanks! Nice find. Has now found its way to PWR.
    2 points
  16. If you'll put the ajax stuff in a template you can use this: http://cheatsheet.processwire.com/config/runtime-configuration/config-ajax/ Otherwise have a look at this: http://processwire.com/api/include/ The recommended way would be the first one.
    2 points
  17. You don’t have to get all pages in one go. Just keep it simple. LostKobrakai is showing a good solution where he looks at each design principle and only gets the pages that belong to it. I would like to suggest one minor improvement: Before you build the markup, you should check whether you actually found some pages. You might come across an empty category with no links, which might look awkward. Also, when you put a hyphen before the reading time, it makes it look like a negative number. Try ' &endash; ' or '&emdash;'. Those are the – much nicer looking – dashes I’m using here. To answer your follow up question, look at how LostKobrakai handles all design principles individually, by putting each one into the variable $category one after the other. What you want to find are readings that have the current $category page as their design principle, not the previous. Try this: "template=readings, design_principle=$category"
    2 points
  18. @adrianmak In the Netherlands there are a lot of rules that must be fulfilled for sending news letters. This brings big responsibility to the end user of the system. When you really trust the user with the sending and subscribe and un-subscribe system you could go that way. When done wrong it's not uncommon that your IP gets blocked or you've to pay big fines as stated by law. The markup generation can be done with ProcessWire ( Don't know any system that handles this better ), but I recommend for the sending an external service. Those services have you covered with good subscribe and un-subscribe systems.
    2 points
  19. I've been working on a module to make it really simple to upgrade ProcessWire from one version to another. Especially as a way to make it easy to upgrade from PW 2.4 to 2.5, or to upgrade from one dev version to another. This tool supports upgrading between any branches of ProcessWire (currently we only have master and dev on GitHub). It will also let you downgrade your ProcessWire version, though no reason to do that. The module keeps up-to-date directly with GitHub, so it works as a long-term tool for every upgrade if you want it to. It works best if your file system is writable. However, if it isn't, the tool can still be used. It will still download the upgrade files to the server and then tell you where to move them. I should also mention that this module is somewhat inspired by a similar module Nico built awhile back called AutoUpgrade. So far I've used this tool to upgrade this site (processwire.com), the skyscrapers site, and the modules site (modules.processwire.com). Before releasing this officially in the modules directory, or suggesting it for production use, I'd like to get some help testing. If anyone has availability to help test this on non-production sites, your help is appreciated. It can be downloaded from GitHub here. As a bonus, it will also be a good opportunity to help test PW 2.5! Thanks in advance. What I'd really like to do as the next step with this is make it support upgrade by FTP. That would provide a nicer and safer solution for those that don't have writable file systems on their servers. This tool should be compatible with ProcessWire versions as far back as 2.3.4. I will also update it to support older versions than that if there's demand for it.
    1 point
  20. Please use Matrix Fieldtype & Inputfield Or the ProFields. FieldtypeJson (module) Álpha I've been busy last 2 weeks with a new fieldtype. I needed a fieldtype that generates JSON strings from CSV (excel data). I needed a way to handle a variable amount of columns & needed a way to manage that data. Wanze & Kongondo already worked on a excel crud module with the excellent Excel-like data grid editor Handsontable and I loved that piece of software. Thank you guys. Handsontable is used in the Inputfield part. What the Inputfield does does: If there's no data in the field, the Inputfield shows you a textarea. You could copy 'n past in CSV text in that field. When you save the field, all data is processed. Processing means: Slice till an x amount of data rows. If minimum amount of columns is not reached, pad the columns till the amount you've specified in the settings If the data contains to much columns, slice the redundant amount of columns. Every data left, is trimmed and sanitized Every numbered string will be converted to integers Saved in 2 formats: 1) json and 2) cvs Server side there's a lot of processing needed to perform all this, that is the reason to set a low amount of data rows. On The Inputfield side, the JSON is generated by Handsontable. So this feels a bit dirty. (Server side it does do all the steps in the above list.) For now it's called FieldtypeJson, but i'm not to keen on this name. Output How to output in your template: $page->fieldname // (string) the table markup $page->fieldname->json // (string) JSON string $page->fieldname->csv // (string) CSV string $page->fieldname->rows // (int) number of rows, not really usefull, but needed internally $page->fieldname->columns // (int) number of columns, not really usefull, but needed internally When to use: If you need a small set tabular json data, and you don't know how many columns it has. If you want to have render tables quicky in your site. When not to use: Store very large sets of query -able data. If you have to rely rely on the data. ( all json is stored in a subfield, and the same for csv ) API Side (JSON): // Json string $json = '[["First Name","Last Name","Company Name","Address","City","State","Post","Phone","Email"],["Rebbecca","Didio","Brandt, Jonathan F Esq","171 E 24th St","Leith","TA","7315","03-8174-9123","rebbecca.didio@didio.com.au"],["Stevie","Hallo","Landrum Temporary Services","22222 Acoma St","Proston","QL","4613","07-9997-3366","stevie.hallo@hotmail.com"],["Mariko","Stayer","Inabinet, Macre Esq","534 Schoenborn St #51","Hamel","WA","6215","08-5558-9019","mariko_stayer@hotmail.com"]]'; $page->of(false); // Turn OutputFormatting of $page->fieldname->json = $json; $page->save(); $page->of(true); API Side (CSV): // CSV string $csv = '"First Name","Last Name","Company Name",Address,City,State,Post,Phone,Email Rebbecca,Didio,"Brandt, Jonathan F Esq","171 E 24th St",Leith,TA,7315,03-8174-9123,rebbecca.didio@didio.com.au Stevie,Hallo,"Landrum Temporary Services","22222 Acoma St",Proston,QL,4613,07-9997-3366,stevie.hallo@hotmail.com Mariko,Stayer,"Inabinet, Macre Esq","534 Schoenborn St #51",Hamel,WA,6215,08-5558-9019,mariko_stayer@hotmail.com'; $page->of(false); // Turn OutputFormatting of $page->fieldname->csv = $csv; $page->save(); $page->of(true); After save, all other subfield are updated. So saving JSON will update CSV and the rows and the columns. And saving CSV will update JSON and the rows and the columns. Saving direct to the fieldname, or saving to both json and csv or saving to the rows & columns wil thow a wireException(). Download: source on github Warning: This Fieldtype is Álpha, don't use it in live projects empty field: paste data: imported data: manage data: settings:
    1 point
  21. Happy Friday everyone! Picked up a new VPS subscription last month after using shared servers for years. Feels great having a space I almost completely manage myself thats not shared etc. What are you guys running your client and business sites on at the moment and are you doing anything cool with it? Probably some of your are on dedicated or even hosting in-house? Generally interested in HDDs, storage, hosting etc so I'm just curious.
    1 point
  22. You can get it in a PHP section of your template files like this... $ref = $_SERVER['HTTP_REFERER']; Be aware that this variable can be unreliable as it is up to the visiting browser to send it and it can also be forged. Most of the time it will be correct though. More info here.
    1 point
  23. Thanks. And big thanks to Ryan and all the developers for a truly stellar product. I am blown away by the way it operates. It will take some getting used to but I think I'm on my way to making it a core part of my business.
    1 point
  24. @Aleksey Popov I think we've uncovered all the options.
    1 point
  25. Why shouldn't jan's example not work? I used a similar tchnique just recently. The image src is just a static url to return a random image. Of course in this case it's only good to serve one image src, limited to whatever image, but I think most of the time theres a need to do a little more with little junks of HTML. That's where js or str replace come in next.
    1 point
  26. This works great with Template cache, but not with ProCache (which completely bypasses php). JS solution works with ProCache also.
    1 point
  27. Would you use this as developer? Because if your end users choose files to upload from their local computer via a form, they are uploaded through HTTP on the server. If you write code to upload a known (big) file from A to B via FTP over PHP, the execution time for your script must be high enough. Cheers
    1 point
  28. @Jan Romero Looks good, but when you enable template caching it will cache the output and therefore show the same image again. Unless you configure the cache to ignore caching when using the GET variable, but in this case there is no caching at all Edit: Sorry didn't look carefully @Aleksey Popov I guess you're after a solution some other template engines are offering where you specify a sction like this: {nocache} Hey, I'm dynamic {/nocache} As far as I know, there is no solution out of the box. Use the techniques from Soma or Reno. A module to build something like this in ProcessWire would be easy, but you wouldn't gain any performance compared to the other solutions. Cheers
    1 point
  29. I would suggest you to use a standartized dateformat, just to be sure the date is parsed correctly. From the comments here: http://processwire.com/api/selectors/#examples
    1 point
  30. Mate, you're the one that started most of that back chatter I was talking about
    1 point
  31. Hi horst, That's what I'm aiming for. I've only had a few minutes to work on it, so I just have the sidebar open/close now.
    1 point
  32. @renobird: Save open/close state of sidebar (via cookie).Does this include: save and recreate show / hide the complete sidebar save and recreate the collapsed state of each group (pages, setup, modules, ...) ? This would be awesome!
    1 point
  33. Dude, your avatar is pretty accurate, I did the same face when it worked !!!!! Thank you very much gents, I love you all, I love ProcessWire and I will come back and try to help if I can. Very nice I'm really happy !!
    1 point
  34. Put "die();" after "echo json_encode($json);"?
    1 point
  35. if you not already know this, here is a grouped collection maintained by @pwired: https://processwire.com/talk/topic/4173-grouped-forum-posts-links-articles-tutorials-code-snippets/ @teppo has some things on his site: http://www.flamingruby.com/blog/php-for-template-designers/ (just ignore this twig stuff, focus on the php side), and there are more articles. The recipes are new but continousliy growing: https://processwire-recipes.com/ ...
    1 point
  36. To answer your question about restricting the visibility. The dependencies are managed in a "in this form" fashion, so the fields your settings depend on must be present in the form, as the form isn't deeply linked to a specific page. I currently don't know if adding the roles field with visibility set to not editable / not visible would solve this.
    1 point
  37. foreach($page->engines as $e) { foreach($e->fields as $field) { echo $e->get($field); } } See here: http://cheatsheet.processwire.com/page/built-in-fields-reference/page-fields/ Edit: changed the echo line, too.
    1 point
  38. $pageArray->remove($page); or $pages->find("id!=$page->id, …");
    1 point
  39. main.inc should keep the largest possible code for all your different layouts and include sub-xy.inc files. Lets say for example you have the default layout with $bodycopy and $sidebar and additionally a onecolumn layout without sidebar: You define a new variable e.g. $myLayout: // here is how it would look like in the /site/templates/init.inc <?php $headline = $page->get("headline|title"); $bodycopy = $page->body; $sidebar = $page->sidebar; $myLayout = "default"; // we only write the name without the fileextension, this way we also can set a CSS-class in the body tag! // or you put it into the head of every template file, here: /site/templates/basic-page.php <?php $headline = $page->get("headline|title"); $bodycopy = $page->body . $page->comments->render(); $sidebar = $page->sidebar; $subnav = $page->children; $myLayout = "default"; include("./main.inc"); Now move the smallest possible segment from your main.inc into default.inc and replace it in main.inc with an include("./$myLayout"): /site/templates/main.inc <html> <head> <title><?php echo $headline; ?></title> </head> <body class="<?php echo $myLayout;?>"> <?php include("./{$myLayout}.inc"); ?> </body> </html> /site/templates/default.inc <div id='bodycopy'> <h1><?php echo $headline; ?></h1> <?php echo $bodycopy; ?> </div> <div id='sidebar'> <?php echo $sidebar if(count($subnav)) { echo "<ul class='nav'>"; foreach($subnav as $child) { echo "<li><a href='$child->url'>$child->title</a></li>"; } echo "</ul>"; } ?> </div> Lets say you don't want the sidebar on your homepage, then you define / overwrite in your /site/templates/home.php the $myLayout var with $myLayout = "onecolumn"; // we only write the name without the fileextension, this way we also can set a CSS-class in the body tag! Create a file called "onecolumn.inc" and put in your desired markup, e.g.: /site/templates/onecolumn.inc <div id='bodycopy'> <h1><?php echo $headline; ?></h1> <?php echo $bodycopy; ?> </div> To stile your onecolumn layout with CSS you need to append to your css something like: body.onecolumn div#bodycopy { width: 100%; }
    1 point
  40. Hi Alex and thanks for your interest. Actually in my first PadLoper version (from summer), nothing was page. But the development speed, extensibility, familiar API etc makes the Pages way almost always a better choice and I have to say I am super happy with my decision to change into pages. Not sure I understand why eCommerce is any harder or easier than any other kind of website in case of continuous integration? It's not easy to do with ProcessWire (or any system with flexible meta model and with systems that keep metadata and actual data both in same database). But in my opinion to really see big issue here (with using pages as orders) is that in your code you would need to reference your pages/templates/fields with ID, and I don't see that need very easily. Although I might be completely wrong though and I am happy to hear more about your process of maintaining local, staging and production server with ProcessWire sites and why you believe eCommerce makes it harder? Like with almost every other big theme, PadLoper tries to stay as close as ProcessWire way of doing things instead of inventing it's own. It tries to be as invisible as possible with your current ProcessWire workflow. It doesn't generate any markup (you can use it's helpers though), it uses templates/pages for data storage and process modules for admin views. It has few custom tables (for cart and downloads).
    1 point
  41. One really great if found today to collect: Soma - Using Imagetags like a Boss.... https://gist.github.com/somatonic/5808897 saved the evening for me - searching this forum is better than to talk with 100 experts while every second forumentry is a hidden treasure sometimes!! Best regards have a nice weekend - mr-fan
    1 point
  42. I have an older DS212j and I can agree with Pete, they would be really nice small serverboxes, but the cpu and ram aren't fit to do so. I use mine just for backups and a local dns / dhcp server, to be able to view local pages all over the network.
    1 point
  43. I'm on a DS412+ with 3x 4TB WD RED drives in it. A little annoyed that WD RED are now 6TB and I could have more space if I buy some of those, but whilst I've still got one bay spare and a lot of space left in this RAID configuration I have no need to upgrade - I just like the idea of having even more space I've not really tried to run it as a server but I'm sure it could, albeit a bit underpowered. What I'd really like to see is one of their smaller units with a punchier CPU and more RAM. That said, it's good enough to stream movies to a smart TV using PLEX (worth a look for those with media collections) without transcoding or buffering - even with large blu-ray files, though it will depend on your TV's ability to read MKV files or other similar uncompressed formats (I know that's not their technical term, but a good way to describe them). I use TeamViewer quite a bit which is similar. Helpful for diagnosing issues customers run into like email config issues or those times when a customercan see an issue but you can't replicate it. TeamViewer also lets you keep contact lists so you don't have to remember the login details every time - just prompt the customer to let you on to their machine and you're away. (I said "customer" instead of "client" there to avoid confusion with software clients ). I have also, on occasion, used it on a laptop when I needed to check something on my PC at home, though that only works if my wife turns the PC on since I always shut it down. You can set that up for unattended access via a password so on the off-chance you did leave the PC on it's just a few clicks away from wherever you are. But yes, with cloud storage there isn't usually much need. With web access to your Synology also a possibility it's like having your very own Google drive but without Google
    1 point
  44. Linux version antiX-13.2 (fast) with Lamp and Zimbra No special hardware like a rack server or nas, just and old box where I have put my own motherboard ASRock Z87 with intel i5 and 8G ram. Instead of UPS I use a 12V car battery with a converter to 220 V ac. It's all placed in a basement so there are no cooling problems. I don't have to pay for electricity or something. The only thing I pay is that I share with them their monthly internet bill. I certainly am curious what will be the downtime during a year. I want to see if the whole thing will be useful to script automate making backups, pings, check webshop email workings, etc. Will free up time to do other things.
    1 point
  45. I have updated Pia with this retinafy: https://github.com/horst-n/PageimageAssistant/commit/d31d743533133b130131d8c5b042bd510bf68bb2
    1 point
  46. Just thought I'd share my git hook (post-receive) that I've been successfully using for a few months now to update my beta site and production site via git (no more ftp!). Might help someone else. As you can see, I only have the "site" folder under version control. But now when I'm thinking about it, site/templates should probably be enough. #!/bin/bash while read oldrev newrev ref do if [[ $ref =~ .*/master$ ]]; then echo -e "Master ref received. \e[42mDeploying master branch to production site...\e[0m" WORKTREE=../site # define your work tree, where you want to push the files cd $WORKTREE # navigate to the work tree GITDIR=../mysite.git # in relation to the "cd" command above # update the working tree git --work-tree=./ --git-dir=$GITDIR checkout -f master git --work-tree=./ --git-dir=$GITDIR clean -fd master # return to git directory cd $GITDIR else echo -e "Ref $ref received. \e[104mDeploying $ref branch to beta site\e[0m" WORKTREE=../beta/site cd $WORKTREE GITDIR=../../mysite.git # in relation to the "cd" command above # update the working tree git --work-tree=./ --git-dir=$GITDIR checkout -f stage git --work-tree=./ --git-dir=$GITDIR clean -fd stage # return to git directory cd $GITDIR fi done
    1 point
  47. Love the concept. I haven't any spare cache, but if you want any thing cooking/serving wise, let me know. Send me more info and I will put it on my food blog, however http://foodloversdiary.com EDIT: hahaha - I mean CASH, not cache!
    1 point
  48. Keeping the databases between local develop (laptop) and online production in correct sync is always a pain. Production databases change because of online: 1. visitor interaction with the websites 2. automatic updates 3. blogs 4. automated newsletters 5. guestbooks 6. online subscriptions 7. etc. These changes are not in sync with the local develop database. Because of this I have crashed a few websites in the past when syncing a local database with a production database that was online for a while. Would be good to solve this one day though. Read more here: http://processwire.com/talk/topic/1284-best-practice-for-staging-to-live-database-synchronization/ http://processwire.com/talk/topic/3229-version-control-for-mysql-via-git-hooks/
    1 point
  49. This topic could use more posts to know more about a pw workflow with a good local/on-line sync.
    1 point
×
×
  • Create New...