-
Posts
4,296 -
Joined
-
Last visited
-
Days Won
79
Everything posted by diogo
-
Hi ashrai! Welcome to the forums! There is a tutorial about adding images here http://processwire.c...k-start/images/ (it's admittedly a bit hidden because it's considered "in progress") Make sure you understand the difference between single images fields (Maximum files allowed = 1, in the field options), and multiple images fields. On the first one $page->field returns an object, and on the former it returns an array. On the single image you return the url simply like this: echo $page->image_field->url; And on the multiple, you return the several urls like this: foreach($page->images_field as $image){ echo $image->url . "<br>"; // this will print one url per line } Well, all this is explained in that tutorial I linked to.
-
All the reviewers will have the same password for each album? Or each reviewer will have it's own password?
-
Yes, it looks much better with more icons then with the lonely "f" The pictures in the slider are also infinitely better now without distortion. Nice!
-
Good one! Three things I dislike though: 1. The search and Facebook feel a bit lost on the right. I would make the search icon stronger (a bit bigger and bolder), and put the facebbok icon next to it. On the left even, like this it would be pushed when the search box animation (a nice detail). I also think it doesn't make sense that the search disappears on smaller screens. I would also keep where the facebook item goes. 2. I don't really like how the title breaks. Would work better if you divide it in two unbreakable parts "Mad Hatter's" and "Tea Party" and let them go under the logo in smallest screens. 3. The pictures are distorting in smaller screens, is it supposed to behave like this? I think they should be cropped instead. That's it. In general I really like the site
-
You're doing a great work Joss! Glad you showed up for the party
-
I'm with soma here. I doubt there is any Edit: I see that you found one Joss. Very recent, but still...
-
I can see that! Personally this makes me feel that the time I took to answer some of your questions was more than worth it edit: and I think the others share the same feeling
-
Good one soma! I think it would be enough to have it enabled only for logged in superusers.
-
Not even one year ago there weren't any repeaters in PW. And still, we were all happy
-
Welcome to the forums ziusurda! You don't really need to look on the database to work with PW, everything you need is in the administration area. There's where you create your templates fields and pages. To output the content on your website you also need the templates files. But since you are curious about the database: All the pages are on the table "pages" and only keep info like "id" "name" "template" (foreign key with id of template), etc. The page table doesn't hold any fields, because each field has a table of his own, and each row holds the value and points to a page. edit: wow, you were quick onjegolders!
-
You're right again, another bracket was missing here after author=$a"). Already corrected it. Yep, much more elegant than nico's
-
When you want. No hurries...
-
there's one right now http://processwire.com/talk/topic/2362-repeater-fields-and-table-columns/
-
soma's answer is obviously better than mine. still: on the first part ") was missing after $pages->find("template=author i will edit it. on the second I think you must have tried my code before I corrected it. It's working with me as it is.
-
Thanks for the great explanation nik! For what I understand about fulltext searches, it's also not useful to use them in such a small amount of pages because it will ignore everything that matches more than half of them.
-
Tricky one... let me think... second problem is easy: foreach($pages->find("template=author") as $a){ echo count($pages->find("template=post, author=$a)); } and the first problem... hm, how about this? $authors = $pages->find("template = author"); $authorsPosts = array(); foreach($authors as $a){ $authorsPosts[] = array("count" => count($pages->find("template=post, author=$a")), "author" => $a); } sort($authorsPosts); $authorsPosts = array_slice($authorsPosts, 0, 5); //added this line to limit to 5 foreach($authorsPosts as $p){ echo $p["author"]->title . " wrote " . $p["count"] . " posts<br>"; } edit: i forgot about the limit of 5... already edited the code:
-
-
Another one from gadgetopia, and this time is about all of us http://gadgetopia.com/post/8286
-
you can test it in any php file, dosen't have to be inside PW
-
Ya, that's an easy one, but I agree that it would make sense to have this option on the repeaters settings.
-
You have to go to those fields settings, and in the tab INPUT, set their visibility to "Always collapsed, requiring a click to open". You can also do it only in the context of the repeater by clicking on the field name on the reapeater DETAILS area. edit: hm... that was for the fields, not the repeater itself. Ignore it.
-
ok, thanks
-
Wouldn't it be better to make it with normal pages instead? I don't think repeaters are the ideal for lots of info.
-
What to do about short-life pages and search engines?
diogo replied to NooseLadder's topic in General Support
You can use a robots.txt file to keep the search engines away from these pages. Just disallow the parent like this: User-agent: * Disallow: /parent/ I don't know enough about automated tasks in PHP to answer exactly to want you want in the second question, but I know how to go around To delete the file after let's say a week, you can put this on those pages template: $created = $page->created; // this returns a unix timestamp of when the page was created $week = 7 * 24 * 60 * 60; // a week in unix time (7days * 24hours * 60min * 60sec) $now = time(); if($now - $created > $week){ //page is older than one week, delete it and redirect } This will delete the page when accessed. But if the page is listed from other templates, you would have also to do all this inside a foreach on that other template. I'm sure there is a better way, but I wanted to share anyway