Leaderboard
Popular Content
Showing content with the highest reputation on 10/20/2012 in all areas
-
It was fine for my purposes, the two API points I'm using do use the abstraction - not consistently, but in the two conditions that affect my module. Here's the module, by the way: https://github.com/mindplay-dk/ProcessPagePin This is another one of those small features I think should be standard - I wouldn't ship a solution without this module. I think it's more a matter of developer preference than client preference - the client, I think, would either prefer this behavior, or perhaps not care if they didn't know it was an option. I'd prefer to see something like this already available to install out of the box, but I know you're a minimalist, and I actually appreciate that about you, so - hopefully those who want this behavior will find my module. It's such a small thing, it almost seemed silly to do it as a module though... but it was educational, and I feel increasingly like I can make PW do just about whatever I want - something I've never felt with another CMS!2 points
-
http://conclurer.com Design + Code Another page I have created with Processwire. This is "our" own portfolio + contact and news. The contact page was created with Ryans experimental Contactmodul. So far, our site has gone through 3 stages. First we had our old Typo3 installation and the first design. You can find the remains here. Then we just migrated the design and content to Processwire(2nd Page). Finally, I've rebuild the site from skretch with Processwire last month. Not perfect but I have the feeling that I'm getting better with every website I make.1 point
-
Hiho, my first try with PW. Not finished yet, some stylings still to do and some texts are still missing. Hope can get some feedback http://www.herxheim-ecommerce.de I´ve used twitters Bootstrap as core css framework and the microsoft metro buttons from ace-subido.1 point
-
A more cleaned up code example: function renderItem($pa) { $out = "<a href='{$pa->url}'>"; $out .= "<img src='{$pa->images->getRandom()->size(180,180)->url}' height='150' width='150'/>"; $out .= "</a>"; return $out; } $limit = 10; $bilder = new PageArray(); $seiten = $pages->find("template=basic-page, images.count>0, limit=$limit, sort=random"); $found = $seiten->count(); foreach($seiten as $bild){ echo renderItem($bild); } if($found < $limit){ while($found < $limit){ $rp = $seiten->getRandom(); echo renderItem($rp); $found++; } } Still I wouldn't do this, because it could be that it grabs the same image from the same page in a row. So I would try to limit the image to a count you're sure there's at least. SO if you don't have 24 page with images there's no need to output 24 items.1 point
-
Pretty much. The $input API var didn't exist before some of the other code did. And the code you mentioned (PageList, PageEdit, PageAdd) is some of the oldest code in the system. Since most of what happens during these processes actually happens in other modules, this code doesn't see much action… no squeaky wheels there, so I tend to leave it alone. But when I'm working in a file that might have some older code (like that referencing either $_GET or $_POST), I'll usually change it over to use $input instead. Granted it doesn't matter that much at present, but I prefer $input for consistency. The only benefit that $input->get/$input->post are delivering at present is abstraction from the magic_quotes setting. Longer term, I plan to connect some of the sanitization methods with $input vars so that you an pull variables pre-sanitized. So I think using $input is a better practice, but won't feel strongly about it until we're delivering more value as a result of it. I know there are a lot of people that think there must always be layers on top of PHP's native input variables in any framework. I'm not one of them. $_GET and $_POST (and their friends) are universal, instantly understandable and always portable. Eventually there won't be any $_GET or $_POST references in PW's core. But I don't see any problem with others using $_GET/$_POST in templates if they want to.1 point
-
This one has been on the @todo list for a long time, as it's kind of a tricky query to implement. Go ahead and try out the latest dev branch, which should implement this capability. So far it seems to be working here, but could definitely use more testing.1 point
-
I'm afraid that I'm still a bit confused about your situation and thus my answer might not be completely valid. I don't see any problems in including a .php file with include() even if it's not related to any template -- I'm actually doing that a lot when building sites with PW. You can't access a .php file inside /site/ or /sire/ with direct URL (and thus you cannot use them directly from <link> tags etc.) but include() within a page (/ template) is completely different thing. Anyway, there are three other options I can think of right now: 1. Put your style.php in the root of your website, outside /site/ folder. This way PW (or actually mod_rewrite) shouldn't have a problem with it. 2. Same as option 1. but with a twist: add style.php to site root and from there run include('./site/style-directory/style.php'). Only thing this would achieve would be that your style.php would actually live in your styles folder. Not exactly pretty, but it should work. 3. Add new rewrite rule to your .htaccess to allow direct access to file / files in your styles folder. This option also sounds like a hack and I wouldn't really suggest doing it, though. I'd go with having style as a normal PW page; example.com/style/ or something like that. It's pretty much the prettiest option I can think of right now and would make adding new user-definable CSS settings a breeze.1 point
-
Welcome WinnieB! Thanks for the kind feedback, glad that you are liking ProcessWire. The skyscrapers profile was originally written for PW 2.0 (the first open source release) and so I worry that techniques on the back-end of it aren't so up-to-date and wouldn't be particularly helpful to people. It does run in the current ProcessWire, but I feel like it's kind of outdated so a little worried it would confuse more than help. I do want to update it to be distribution ready again though--definitely on the to-do list. I haven't tried Renoise but really like current tracks by Mosaik (aka Radix) and know that he uses that. I did play around with Sunvox a bit this year, and was quite impressed by it. But time is hard to come by these days, so don't think I'll be back into making music for awhile. But I kind of want to get one of those recycled propane Tank Drums just to chill and play once in awhile.1 point
-
Here, check out some vintage Ryan. http://www.ryancrame...by_ryan_cramer/ (I used to listen to his demoscene stuff when I was in Jr. High and High School ) I think ProcessWire deserves some sort of backing track for sure. Renoise is cool...have you tried Sunvox?1 point
-
Welcome indeed WinnieB. You've probably seen it and it's not the Skyscraper site, but this blog profile is a great PW learning opportunity. Enjoy PW, I've not looked back since I luckily stumbled on it1 point
-
1 point
-
If you aren't using Apache, just double check that ProcessWire's files are protected. You should get a 403 "Forbidden" error if you try to access URLs like this: /wire/core/ProcessWire.php /site/templates/basic-page.php /wire/modules/PageRender.module /site/assets/sessions/ This is just a random sampling of URLs to test. But if you don't get a 403 Forbidden error for those URLs, you've got a major security problem then needs to be addressed with the server's rewrite engine. This is the main thing I worry about when people use web servers other than Apache.1 point
-
Thank you my friends. I will consider this forum builder with Processwire to see. Let me tell you more what want to do. We want to have "new media" and "interactive". Customer will go to website and see menu: Then customer click on item to drag to sombrero: Customer click "check out" once fill sombrero with selecions. They put in email and submit. After submit, as special promotion, customer see "after hours" photo of Maryla as thank you screen. Customer pick up food in 30 minutos. Can forum builder handle this new media interactive? Jeffry says "flash" to use, but I read EXML is best and I know Processwire is good? Thank you, Roderigo Sosa1 point
-
1 point
-
You can use a WireArray and fill it with image objects from pages. Then get a random count from that WireArray. It's also in the cheatsheet. // new WireArray object for storing images $images = new WireArray(); // we find all pages using a specific template that have at least 1 or more images. // assumes the image field is named "myimages". If we deal with really lots of pages/images, consider using a limit to avoid performance problems $pa = $pages->find("myimages.count>0, template=basic-page, sort=random, limit=10"); // loop all found pages and import the images to the $images object foreach($pa as $p){ $images->import($p->myimages); } // output 4 random images from the wire array foreach($images->getRandom(4) as $img){ echo "<img src='{$img->url}'/><br/>"; } Reading again, and looking at Ryans code, it does pretty much the same, just little different way. Think about it again... Is there really any difference ? From: get ALL images from ALL pages and choose 6 random from them. To: get randomly 6 pages from ALL pages and choose 1 randomly from each page. I don't see really a difference, only that the second is far better and the way to go, because you limit the find for pages in the first place. Getting all images from all pages could create problems and not so scalable.1 point