Leaderboard
Popular Content
Showing content with the highest reputation on 04/09/2012 in all areas
-
I've been a user of textpattern (my first love) and ExpressionEngine. I came to ProcessWire after looking through Ryan Scherler's portfolio. I was searching for an un-bloated CMS that had some of the features I like of both txp and EE - custom fields, templates as files and a few other things. I knew that if I picked up PW I'd struggle at first because of my lack of PHP knowledge but I didn't fancy getting into bed with another tag-based system either. I found that the API wasn't that hard to get my head around and that if I applied myself to learning some PHP I could do some of the same things in PW that'd be a complete pain or required numerous plugins or add-ons in txp or EE. I've gone through a few system upgrades with EE I can honestly say it's a complete PITA. Only having to upgrade one core directory in PW is a dream and a half. After a while I decided to set PW as my go-to CMS. It successfully out-ticked txp and EE on quite a few of my recent projects. Being able to build a site is one thing. Putting it in front of a client that hasn't used it - or any other CMS for that matter - is a great testament to how well thought out PW is.3 points
-
Have been on a merry-go-round of open-source CMSs for a while now. I seem to spend a couple of days once a month, desperately looking for something that fits my workflow. I have to say that this workflow has been very heavily influenced by ExpressionEngine. Custom fields is the biggest must for me, I am constantly debating with my brother who is an avid Joomla man, the merits of custom fields per channel(ahem 'page') and I can never believe that it just isn't possible in most other CMSs. I have to say that I've come to PW primarily because I cannot always afford to go the EE route, I genuinely love that platform. I am more and more getting the feeling though that even though I was attracted to PW as a cheaper alternative to EE, it may actually be STRONGER in many ways, though I'm at a very early stage with it. One final point, Ryan (and others') kindness, openness and support shine through in not only these forums but also the docs and intro videos. If I stick at PW and make it work for me, this will have been a huge factor - I genuinely feel that you care and that is incredibly important. I got turned off PyroCMS (as one example) because it felt exactly the opposite.3 points
-
Thanks guys, it was a great trip. Thanks to everyone for keeping an eye on things here. Finally back on land and just need to get back home and unpacked. There was so much to do onboard, I didn't end up even turning on the computer the whole time. Though I checked my email a couple times from the internet cafe just to keep an eye out for any emergencies. It may take me a couple days to get all caught up with messages here, but I'm going to start chipping away at them now and should be back to a regular day in my office tomorrow.2 points
-
Ah yes, that's what I needed! It turns out $image->width() and $image->height() are actually rendering functions, so I was able to just do this: $mainimage = $page->image; if($mainimage->width >= $mainimage->height) { echo '<img src="' . $page->image->width(768)->url . '" alt="' . $page->title . '" id="displayimg" />'; } else { echo '<img src="' . $page->image->height(575)->url . '" alt="' . $page->title . '" id="displayimg" />'; };2 points
-
I heard of PW from a few posts (Txp CMS forum) and from tweets from folks like Alan. By the 4th (or so) mention, I visited the main site and watched Ryan's video and decided to try it out myself. A few weeks later I am still here, have migrated a site over to PW and am now writing my first module for it.2 points
-
I found PW like this (and NO disrespect to Textpatten which I admire and have used to great effect): started a new project in TXP (Textpattern) went to do a couple of things that needed plugins and was tripped over by plugins not working made an executive decision that I had had enough of relying on plugins that generous people had shared but that inevitably they had sometimes stopped maintaining and decided, with reluctance, to train on EE bought $48 worth of video training and began to learn EE found EE was a little like a clunky version of TextPattern in some regards but inevitably due to it's commercial footing more complete and with an ecosystem of high-grade plugins — I was a little saddened to see I still needed to rely on plugins and even sadder* to see they often cost $30, $60, $+ (on top of the $300 for EE the client pays) but soldiered on and kept learning (*but I recognize that charging for good plugins is right in many cases) was Googling re EE and found Marty Walker's web site http://www.smd.net.au/ and as usual scrolled to the bottom to look at some meta and read "ProcessWire" and not EE, "Hmm" I thought clicked "ProcessWire" and never looked back Thank you Marty and thank you PW community for your help and most of all, thank you Ryan for creating, sharing and driving this superb project.2 points
-
As our studio is getting close to finishing another project, we are facing the challenge to provide our client with easily understandable materials or kind of a manual on how to manage content in PW. As I guess that this happens from time to time to you guys around here, too, I wonder if it would make sense to collaborately work on a kind of manual document explaining key actions to be done for an editor. So there could be an open document or wiki providing texts in different languages and supportive images we all could use to e.g. turn it into a nice PDF or printed handbook (yes, some clients still like paging through paper) where we just have to replace images. I don't think this work has to be done over and over again by each one of us for his own purpose. And I'm sure, all our clients would benefit from something like this. Also it would be a nice plus for everyone thinking about using PW the first time for a client project.1 point
-
I do some photography as an enthusiast, and while I'm not really looking to go professional, I figured it was time I got a proper portfolio site instead of just relying on my Flickr account. As a parallel to this, I've long wished there were a really simple, beautifully-designed, open-source portfolio system that I could quickly set up for my artist friends to show off their work. So, I had an idea for such a portfolio. I had put the design together for this a few weeks ago, but this weekend, I sat down and started coding, and, even on a busy Easter weekend with family, I managed to get the site done by Sunday night just working on it here and there: http://photo.rclayton.net So, this is my photography portfolio, and the testbed for what I think I may call ProcessFolio, "a gorgeous, minimalist, open-source web portfolio for artists built on ProcessWire." If I can be allowed to call my own work gorgeous for marketing purposes.1 point
-
Well after 3 months' worth of evenings (and various iterations over the last 11 years) it's finally in a state that I'm happy to show it to you in. You'll need a modern browser to view the site, as it looks a little off in IE8 and will almost certainly break in IE7 and older - I have the somewhat enviable luxury though of being able to ignore older browsers completely since the site's visitors overwhelmingly use new browser versions. Without further ado, I present StrategyCore I'll post a case study at some point, but here's a brief intro and a few of the highlights to get you started. My first website - X-COM.co.uk - was built in 2001. By 2003 it became apparent that there weren't going to be any more games in the X-COM series (although any fans of the series will know that there are now two more in development some 11 years later!) so it branched out into other strategy games and was re-labelled as StrategyCore - covering core games for strategy gamers. It's not a huge site by any means - a few hundred pages and a hundred thousand posts on the forums (not a great deal in 10 years ), and has been growing at a modest pace, but when I get time away from other website work I like to try new things with it and use it as a place to test some neat ideas that I can use in other projects as well. Several PW modules came about as a result of this - the SitemapXML, SocialTwitterUpdate and Maintenance Mode to name a few, as well as others I'm still polishing up the code on. Before this turns into a case study (it's getting late here in England) I'll post that list of (vaguely) interesting features: Forum integration - news articles on the site generate a topic in the forum software and if you're logged in there's a full commenting interface with various buttons (quote, edit, delete etc) as well as pagination, not that there are any articles with enough comments for that to show yet! Logins aren't integrated yet, but I'm working on it. Random header images and taglines The Dark and Light links next to the search box at the upper right - click on them I prefer the dark one personally. This will eventually be re-worked into a "Settings" button where you can set preferences for which header images to show, set your newsletter subscsription, choose which site colour to have by default etc, but for now on the site and in the forums these just change the colour) A nice bookcase - not a particularly original feature on websites by now, but still looks neat Some neat categorisation, archiving and pagination for articles Game playthroughs (After Action Reports) tagged on the forums are automatically added to a specific part of the Articles section (hidden by default of course) - saves us some work adding them to the list manually from now on My first foray into responsive web design. As such, I kept it basic, catering only to monitors (to far along with development to be thinking about tablets etc unfortunately) but having a set of minimum and maximum widths that should work on 1024x768 and 1920x1080 monitors equally well. A nifty bit that caused me a slightt headache is that when you view the homepage and make the browser window narrower, the right-hand block drops neatly below the "Featured" block at a certain resolution to give it more space to display longer article titles. There are plenty of other bits and pieces, but they're hard to spot without me pointing them out and a lot of it is behind the scenes stuff which I'll cover later on in a case study. I think that's the point though - if you get it right with web development then things should look simple and people won't know what went into making it look the way it does. There's still quite a to-do list - meta data is missing at present, I need to tidy up some hideously complex and disorganised CSS (should have used LESS, and the mess is a result of adding bits here and there as and when I get time to work on the site rather than categorising styles properly - not the norm, honest!) and minor styling fixes on the forums, but I'm happy with it. Anyway, these are a few random late-night ramblings and as mentioned a case study outlining all of the useful details will follow at a later date P.S. I know the Files section looks completely different. There is a plan to import all of the files into PW at a later date once I've built a proper file repository and do away with that third-party file repository script completely, but sadly real work is having to take precedence now.1 point
-
My company has just launched our first site for a client built on ProcessWire. It was an absolute pleasure working with ProcessWire and we look forward to building many more sites on it. The drag-and-drop image uploading, combined with the built-in PW resizing functions is brilliant for clients who need to easily add photos. As a designer, PW does an awesome job of staying out of the way when it should. I love that I can pretty much build a site exactly as I normally would and then integrate PW on top of that. Because PW doesn't output any markup, building this site responsively was a breeze. Woot! So, without further ado... http://www.ctporcelainpainting.com1 point
-
Just launched my father-in-law's pottery studio website: Jim McKell Art Studio. Technically I suppose it's nothing super special, but it's been really fun to put his work on display. Enjoy.1 point
-
Simplest explanation is this: $x = 1 // <-- this one assigns a value 1 == '1' // --> true 1 === '1' // --> false 1 === 1 // --> true 1 ======== '1' // <-- This one I don't know, will look for it on my books1 point
-
You can also do this in newer versions of PW: $newpage->template = 'upload'; $newpage->parent = '/uploader-test/'; I suggest sanitizing the title, and excluding the name (since PW will autogen it from the title). So the above code would be replaced with this: $newpage->title = $sanitizer->text($input->post->title); Here is the current PW implementation for uploaded files. Perhaps there is a way we can populate this to $input->files, but currently I think it's best to be more specific when it comes to file uploads since there are added dangers and overhead. The WireUpload class does make things simpler and more secure. It also provides options for handling known quantities, filename sanitization, overwriting vs. making unique filenames, processing ZIP files, handling ajax uploads, etc. The full class is in /wire/core/WireUpload.php1 point
-
Using getItemKey isn't really necessary since you can already get that from the foreach(). I think that CSS is where all this really belongs, but if needed to support legacy browsers without using the ":" options in CSS, here's another approach... I'm writing in the browser without testing, so forgive me if this needs adjustment. foreach($page->children as $key => $item) { $class = 'a' . ($key+1) . ' z' . ($page->numChildren - $key) . ' ' . ($key % 2 ? 'odd' : 'even'); echo "<li class='$class'>{$item->title}</li>"; } From there, you should be able to target any item directly with CSS: li.a1 { /* first item */ } li.z1 { /* last item */ } li.a2 { /* second item */ } li.z3 { /* 3rd from last item, etc... */ } li.even, li.odd { /* self explanatory */ } The "a" class is counting from the beginning while the "z" class is counting from the end. You could substitute any class name, but I'm just using "a" to refer to "from the beginning" and "z" to refer to "from the end" (US alphabet).1 point
-
Maybe this would be a good opportunity to get my hands dirty with module making1 point
-
I liked Diogo's reply on the other thread. I do plan to add the option for the MarkItUp editor back in ProcessWire, and this will enable the click-selection of images and placement in the copy by way of tagged filenames.1 point
-
1 point
-
1 point
-
I think this is a common scenario here I think it's fair to say that as a community there are PHP programmers at all levels here - I still wouldn't consider myself an expert by any means and I like the fact that ProcessWire not only gets you started quickly but also that if I enjoy working with something I'll learn more about the languages that it uses - I've learned a lot more PHP in the last few months than in the last few years I think as well as some neat things about jQuery that I didn't know, and being able to go through clean, well thought out code definitely helps the learning experience.1 point
-
1 point
-
Welcome back, and well done for resisting the urge to check in1 point
-
This was very useful, I think a few more like this would help out newcomers like me!1 point
-
I built a function that does exactly what you asked for, it recognizes the format {image_1}, {image_2}, {image_22}, etc: function imageTags($p, $field){ $string = $p->$field; preg_match_all("/{image_[0-9]*}/", $string, $array); foreach($array[0] as $match){ $number = preg_replace("/[^0-9]/", '', $match); $index = $number-1; $image = $p->images->eq($index); $image = "<img src='$image->url' alt='$image->description'>"; $string = str_replace($match, $image, $string); } return $string; } echo imageTags($page,'body'); // first parameter is the page object, second parameter is the field name. // you can also do this: echo imageTags($pages->get(123),'summary') edit: did some cleaning on the code. if you want another format for tags, {img:22} for instance, just change the regex on the 3rd line from "/{image_[0-9]*}/" to "/{img:[0-9]*}/".1 point
-
The 'problems', if you can call them that, is my noob PHP status . I keep a lot of Coda clips handy because I can remember everything. PW does nearly everything out of the box that EE + X amount of add-ons does. There are some aspects to building a site in PW that are 'harder' like categories and tags but PW offers a different and, without doubt, more robust and useful way of accomplishing that through PageListSelect. I've put sites together in EE with page-tree type add-ons which takes users away from the entries list pane and into a pseudo tree-like structure. It's so easy to screw up an entire site. PW's pages hierarchy takes away any confusion and just makes sense. From there, as you know, you can not only pick and choose what pages you present through the API. The other great aspect to PW is the community right here. I haven't come across one so accommodating and friendly in a long time. The only other one I can think of that's comparable is the Luxology (3d) forums. It really does make a huge difference when learning new tools and knowing that you can post noobie questions and get helpful responses. Regards Marty1 point
-
Hey Nico, after the multi-language features ryan implemented for backend and static template content, I'm still re-thinking the purpose of my module. The goal is to keep the idea of separate page trees. But basically the new module won‘t be about languages but about contexts the content belongs to. Such a context can - but doesn't have to - be a language. Or a mobile version of your site. You'll be able to define rules like url matching or client language detection to define what page tree to use. An API object var will give you the possibility to switch contexts. And it will be working together with PWs native language management. The page mapping feature will be provided by an additional module extending the context module by the mapping capabilities you know from language module. As there is still a lot work to do, I can't tell you yet when I'll be able to push a first stable version. Would need some holidays to focus on this one.1 point
-
You can also leave the parent template without a file to throw a 404 when the page is accessed.1 point
-
Hi onjegolders. You could give CSS' nth-child a try, depending on what compatibility you need. Failing that, on the browser side I think jQuery has a similar selector that is universal, but it will fail for your visitors who don't have js enabled. If you need a solution in PHP you can keep an iteration counter and use the modulus operator to check for nth-ness... if( 0 == $count % 2 ) { // align one way } else { // align the other } Edited to add: If you need to check for some other multiple, like every 5th iteration around a loop, just change the 2 in the example to 5.1 point
-
CSS: .box::first-child{} .box::last-child{} in Processwire API PHP foreach($pagearray as $p){ if($p === $pagearray->first()) ....; if($p === $pagearray->last()) ....; echo ... }1 point
-
Hello there! First: Happy Eastern! Second: I want to have the success message and the error message displayed via Javascript, without reloading the page - but i have no idea how i could integrate this without modifying the module. Can this be done with a hook somehow? Kind regards, Christian1 point
-
I've no popped my head in yet due to time constraints, but can I suggest that if there is helpful code discussed over there that might be of use to others that we somehow post it on the forums too? That's the only problem with IRC I think, but otherwise it's a superb facility for more rapid discussion. Of course I only mean to post things if it's something really useful that's not already been covered to the best of your knowledge - not an easy set of parameters I know, but I'd hate to miss out on something amazing just because I wasn't on IRC at the time1 point
-
I agree! I think often it's about creating a professional, caring and stimulating environment and Ryan seems to have done a very good job.1 point
-
onjegolder: thanks for your kind words and welcome aboard. Very much appreciated. I agree, this is among the top communities around there. We all do our best to maintain the polite and helpful atmosphere here as we grow in popularity. People tend to follow each others behavior, and Ryan has set the exactly right course for our community. It is also amazing how fast newcomers start contributing and help others.1 point
-
Hijacking this post somewhat but have to say Apeisa that this is the sort of feedback which makes people want to commit to a piece of software! The community here seems very strong and thoughtful and not at all arrogant. I have to say it bears some resemblance to the support from EE, from which I'm coming from and for an open-source product I think that's very impressive. I was put off another similar open-source system because the founder was anything but helpful or polite or forthcoming with help. The documentation here is incredibly thorough and the people seem 'nice' (amazing how much of a difference that makes). Anyway back to the post, am also coming from EE so anything that can help me get my head around the differences in the way things works is very welcome!1 point
-
My suspicions were correct, there's no need to do anything crazy. The API handles it fine - $page->images->add() was what I was looking for. Part of the frustration was that I mislabeled the switch case, it should have been 'FieldtypeImage' as opposed to 'ImageFieldtype'. Now if I could only control the name of the phpRANDOM.tmp filename being created, but that's a different matter. For anyone looking for a solution, here's an updated snippet: foreach($page->template->fields as $template_field){ $field_name = $template_field->name; $field_class = $template_field->type->className; $update_value = $this->input->post($field_name); switch($field_class){ case 'TitleFieldtype': case 'TextareaFieldtype': $page->{$field_name} = $update_value; break; case 'FieldtypeImage': if (array_key_exists($field_name,$_FILES)){ $img_path = $_FILES[$field_name]['tmp_name']; $img_name = $_FILES[$field_name]['name']; // $_FILES array singular vs. multiple // normalize by converting single to array prior to looping. // http://php.net/manual/en/reserved.variables.files.php if (!(is_array($img_path))){ $img_path = array($img_path); $img_name = array($img_name); } for($i=0; $i < count($img_path); $i++){ $page->images->add($img_path[$i]); // TODO, change image name from phpXYZ.tmp } } break; ... } ... }1 point
-
Ryan, Many thanks for this module, I just used it to add 436 users. There were a small handful of things that weren't initially clear, so I detailed them below for anyone else trying to import users. If you plan to import passwords, you need to open the module and add FieldTypePassword to $fieldtypes protected $fieldtypes = array( 'FieldtypePageTitle', 'FieldtypeText', 'FieldtypeTextarea', 'FieldtypeInteger', 'FieldtypeFloat', 'FieldtypeEmail', 'FieldtypeURL', 'FieldtypeCheckbox', 'FieldtypeFile', 'FieldtypePassword', // add this line ); Since users are pages and all pages require a title, your CSV will need to have a title column. In my case, I duplicated all the usernames into that column — so name and title are the same. In order for title to show as a connection option during your import, you need to add the title field to the user template file. To do this, go to: Setup > Templates (open the filters area at the top, and choose "show system templates". Select the user template and add the title field. One other thing to note, be sure to have a roles column in your CSV with roles for each user. I forgot that during my first test import and all the users were set to guest. You should be all set to import your users.1 point
-
Coming from another angle, maybe you could include a replacement json_encode in the application? Just make sure it gets loaded in before it is called. Here are a couple alternatives for older PHP: http://snippets.dzone.com/posts/show/7487 http://www.boutell.com/scripts/jsonwrapper.html1 point
-
1 point
-
1 point
-
Hi all. I've been using PW for a few months now and I'm very much enjoying it on the whole. Before the repeater field became available I had, with the help of Ryan, coded my own repeater-style field that uses JS etc so I could have a multi-part field (in this case a URL and text for a link) and was able to add/delete as many of these items to a page as I like. The issue here was really the learning curve in understanding the underlying code and making it work correctly with the load/save of data and the JS interface bits. Not super complex, but not easy either! Now the repeater has come along it means it is possible for us all to make much more complex data models, which can only be a good thing, without needing the ability to develop our own code. The benefit of the repeater field comes at one price that I have noticed, and that is that the DB structure suffers in terms of readability. When I wrote my own code it saved all the data into a single DB table like "regular" fields and so when, as a developer, I needed to go into the DB manually to check things or do debugging it was straightforward. I can easily see what data is attached to what page. With the repeater, there is a layer of abstraction added. It makes it more difficult to analyse the page data and also, I suspect, it adds a bit of DB performance overhead although it is likely so small as to be insignificant in most typical CMS cases i.e. not millions of page impressions. I just wanted to kick-start an open discussion about the benefits of either approach and if there are any pitfalls we should be aware of or practises that we should try to stick to. I think the repeater is a brilliant concept and it opens up PW to a whole world of more complex uses as a data modelling tool, but I think perhaps we need to tread carefully and consider the bigger picture and whether it is suitable in all cases.1 point
-
There are at least two clear indicators when repeaters are no go: 1. You need url for each item 2. You need hundreds or thousands items Performance wise (in my knowledge) repeaters are pretty much same as having one page reference and you access the values of that other page. That is what repeaters does under the hood. So while you could create news-template and have news-items as repeater field there, I don't think that is a good idea. No urls for each news item, not fully scalable (on UI side, from db/api it is the same) and you lose lots of flexibility on API side, ie. $pages->find("template=news-item, limit=10, sort=-created");1 point
-
I think the correct way of using repeaters, is using them, only after deciding that we really can't achieve what we want by the traditional ways. In some situations the pagefield, for instance, will do the same work effectively and even in a more elegant way. I love that we have the repeaters, but i agree we should use them consciously.1 point
-
Another edit deserves a new post... I noticed that the previous approach didn't work in some situations where last row wouldn't have any page to populate it (on the first screenshot there is an example with 7 rows and 23 pages). I'm not very good at maths, but I thought that, knowing the mod we could distribute the pages in another way. So, here is the new code with the changes commented: $rows = 7; $totalCount = count($jurisdictionsPageChildren); $rowCount = ceil($totalCount / $rows); $mod = $totalCount % $rows; // this will tell us how many rows will have more pages than the others $firstInRow = 0; $i = 1; while ($i <= $rows){ $mainContent .= "<div class='columns six"; if($i == 1) $mainContent .= " alpha"; if($i == $rows) $mainContent .= " omega"; $mainContent .= "'>"; if($i <= $mod){ // do this when we want one more page on the row $sliced = $jurisdictionsPageChildren->slice($firstInRow, $rowCount); $firstInRow += $rowCount; }else{ // do this when we want one less page on the row $sliced = $jurisdictionsPageChildren->slice($firstInRow, $rowCount-1); $firstInRow += $rowCount-1; } foreach($sliced as $p){ $mainContent .= "<h2><a$class href='{$p->url}' title='{$p->title}'>{$p->title}</a></h2>"; } $mainContent .= "</div>"; $i++; } and on the other screenshots, the working version1 point
-
Wishing you a totally r-e-l-a-x-i-n-g time — away from computers!1 point
-
1 point
-
was just playing with this module last night (very useful thanks!) - to add the users IP, copy this line into the email body or email subject field IP: {REMOTE_ADDR} you can find a list of all the other PHP server variables which can be used here : http://php.net/manua...bles.server.php1 point
-
Welcome to the forums stardog. Those are all very easy and basic stuff for Processwire. I'll translate your pseudo-tag examples to php (which PW uses as template language also): <PW:ShowStuffFromThisPage page="blog" limit="10" sort="descending"> <li><PW:title/></li> </PW> foreach ($pages->find("template=blog-post, limit=10, sort=-created") as $p) { echo "<li>$p->title</li> } <PW:ShowStuffFromThisPage page="portfolio" limit="4" sort="descending"> <PW:title/> <PW:image/> </PW> foreach ($pages->find("template=portfolio-item, limit=4, sort=-created") as $p { echo $p->title; echo "<img src='{$p->image->url}' alt='' />"; } <PW:ShowStuffFromThisPage page="blog" limit="10" sort="descending"> <div class="blog-post"> <h2><PW:title/></h2> <PW:body/> </div> </PW> Since blog-posts are probably children of "blog" page, then no need for template checking on selector: foreach($page->children as $p) { if ($p == $page->children->first()) $class = 'first'; //this is for differentiation of the first post else $class = ''; echo "<div class='blog-post $class'>"; echo "<h2>$p->title</h2>"; echo $p->body; echo "</div>"; }1 point
-
One more option for this: http://starfishmod.github.com/jquery-oembed-all/1 point
-
1 point
-
Enjoy the vacation!! Leave the laptop so you do not have any temptations...1 point
-
I'd forgotten those tutorials were there. The only way to get to them is through the search engine (I think). These were written by my brother-in-law back when PW 2.0 was new (nearly a year ago). He never was able to finish them because he got a new job that takes all his time. These tutorials may not be totally applicable anymore (I haven't read them all yet). But I'd be interested to hear if you guys think they are helpful and if we should update and finish them. Now that they've turned up again, I'm going to read through them in more detail here.1 point