Jump to content

diogo

Moderators
  • Posts

    4,314
  • Joined

  • Last visited

  • Days Won

    80

Everything posted by diogo

  1. @apeisa, Kirby looks very nice! @onjegolders you can also try Pyro http://www.pyrocms.com/
  2. I would like PW to run with MongoDB. Just kidding
  3. @porl Not a very extensive information, but Ryan explains it here
  4. Nice example in the "Wire" templating language
  5. Nice sites! It's refreshing to see good pictures of people that actually work at the place. And they must be clients at MAX also
  6. changed back
  7. You used the numeric array I will revert my code back to it, so it's not confusing to anyone that sees this later.
  8. Alan, maybe this is not the best way of doing it, but at least it works $blogposts = $pages->get( "/blog/" )->children; $comments = array(); foreach( $blogposts as $blogpost ) { foreach ($blogpost->article_comments as $comment) { if($comment->isApproved()) { array_push($comments, array("comment"=>$comment, "post"=>$blogpost)); } } } foreach ($comments as $c) { echo $c["comment"]->text . "<br>"; echo $c["post"]->url . "<br>"; }
  9. It's more than natural that this kind of problems will arise. This is not a simple module, but I think it brings great benefits. I never thought it would be so easy to build a multilanguage website in PW as it is with this, so I think the effort will pay. Still, the module shouldn't be considered nothing more than an alpha version, ant it will need lots of work and testing. And maybe a little help from Ryan
  10. another one for the toolbox http://jquerypicture.com/
  11. I tested it and I like it so far! I wouldn't consider it a finished product, but I don't think that's intended by Ryan at this point. Some first thoughts (there will be more for sure later): Would be nice to have a "write" page on the navigation. This could be simply a link to a new blog post. A settings page. A place where people can change the color of the titles and links from blue to whatever they want, and also the typeface maybe. I would keep the customization to a minimum, though. This would imply having some dynamic style, and could make it more difficult for a "zen garden" kind of thing, of course. Changing the "edit" link on the corner by something like " new post | manage " For the intended audience, I would avoid having words like "responsive" on the blog descripton Hm, I think that's it for now.
  12. It's true that that's a very nice feature on the cheatsheet. Well done Soma
  13. I also don't understand where the id comes from. And where is it supposed to redirect to?
  14. Nice! I also like it. This is one case where I think it makes sense the way it is now. With this theme, visitors shouldn't be in a hurry, there's no harm in making them click one more time, and have less automation. Also, it's one more opportunity for them to see one of the random images This site illustrates well what I meant here http://processwire.c...__40#entry12539 (Marty, sorry for this deviation)
  15. it's black magic
  16. Oh, that $value! No, In this case $value must be a page object or anything that returns one, just like in the code examples above $pages->get("something"), because this is what the pageType field expects. Only If you would change the value of another kind of field, like "title" for example, you could use a string, or anything that returns one $p->title = $pages->get("something")->title; //or $p->title = "new title";
  17. Again, I'm not sure I understand what you want. If you want to add more than one page to the "subway_station" field, make sure this field accept multiple pages in it's settings, and then do it simply like this: $p->subway_station = $pages->get("/subway_station/sub_st_0111/"); $p->subway_station = $pages->get("/subway_station/sub_st_0222/"); $p->save(); What $value? I don't understand
  18. To save a field you have to use either $page->set("field", $value) or $page->$field = $value. You should also make $page->setOutputFormatting(false) before making the changes to the page. I'm not completely sure that this is what you want, but for the interpretation that I make from your code and assuming that all those pages have a template that contains the "subway_station" field, you should be doing this: // this code will find all the UZAO pages that are descendent of /district/, and add the page "/subway_station/sub_st_0111/" to their "subway_station" field foreach($pages->get("/district/")->find("district_region=UZAO") as $p) { echo "<a href='{$p->url}'>{$p->title}</a> " ; $p->setOutputFormatting(false); // this should be after the echo $p->subway_station = $pages->get("/subway_station/sub_st_0111/"); $p->save(); } I didn't understand where «green» and «orange» were on your code, so interpreted only the code, and left this detail out. Edit: edited the code above by Ryan's suggestion
  19. Hm, I don't really think it's extreme. When someone decided to install the software on a server, had to mess around with permissions and so... he has to be ready to learn the hard things of life
  20. I really don't see that much difference between {% for item in navigation %} <li><a href="{{ item.url }}">{{ item.title }}</a></li> {% endfor %} and <?php foreach($navigation as $item): ?> <li><a href="<?= $item->url ?>"><?= $item->title ?></a></li> <?php endforeach; ?> If you write it like this, you can forget the }} as much as the ?> Of course the Twig code looks a little more friendly at the first sight, but the advantages of getting used to writting PHP are worth it.
  21. You can also put this on your homepage template: <?php $page = $pages->get(123); // replace by the page you want to replace the homepage with include("./{$page->template}.php");
  22. It's a bit strange... echo $pages->get('3')->process; // returns "ProcessPageList" echo $pages->get("process=ProcessPageList")->name; // returns nothing This happens even in a visible, non admin, template
  23. Oh, it's so different from what I posted! I didn't notice how the module is so different from it's beginnings
  24. @Nico http://processwire.com/talk/topic/1310-multilanguage-urls-alias-creation/#entry11814
  25. Not evangelical at all, as I'm not even an experienced programmer. I only learned PHP in the past few months, and I can say it was mostly because of the way PW is thought out. As a Designer I never thought I would be writing some rather advanced PHP so soon, but because PW uses PHP instead of a templating engine, and because it's designed to make it so easy for anyone to achieve basic tasks, you just feel encouraged to go further and further without any constraints. Really, just start building a website with PW without thinking of external tools, you don't even need to install any of the excellent custom modules that are already available, and you will see how easy it is and how powerful it can get
×
×
  • Create New...