Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 06/12/2012 in all areas

  1. Here's the first version of the blog site profile. I was wondering if anyone could help me test? To install, download a brand-new copy of ProcessWire (it must be the latest commit). Then remove the 'site-default' directory that it comes with, and replace it with the one in the attached zip file. Then load in your browser to begin installation as normal. Edit: see this message for the latest version. Thanks, Ryan
    2 points
  2. If such a case google search is better... https://www.google.ch/#hl=de&output=search&sclient=psy-ab&q=site:processwire.com%2Ftalk+404+error&oq=site:processwire.com%2Ftalk+404+error
    2 points
  3. Hi, Small multilingual site for Free To Be Kids in the Democratic Republic of the Congo. http://www.freetobekids-drc.org/ Regards Marty
    2 points
  4. Very well said Ryan, couldn't agree more. While I know I wouldn't use template language, I think that might well make PW a little bit more beginner friendly. Not sure if it is worth the trouble (vs. writing more tutorials, getting started materials etc..). Also maybe we could cheat a little here, and tell that PW uses templating language called "Wire", which looks like this: Output a variable: <?= $page->title ?> Loop for children: <? foreach ($page->children as $p): ?> <h2><?= $p->title ?> <? endforeach; ?>
    2 points
  5. No problem I don't mind adding this. Though am thinking this is one where it would be more efficient for us to just suppress the error (with a leading @). Just committed. I think this will fix it, but please let me know if you find this doesn't resolve it.
    1 point
  6. Haven't got a lot of time atm but i did install it and had a look at the look, feel and functionality on the front-end and a (very) quick browse on the admin side and the codebase. I LIKE IT! Being pretty (uhm very) limited coding-wise, i was able to build sites learning from the default site profile, the forum, PW api and learning some PHP along the way. From the quick look i had i do feel that i can learn a lot of new stuff from the blog-profile. I think that this applies to a lot of PW users, who know the basics but struggle to take the next step. Looking forward to diving in and testing when time allows.
    1 point
  7. ah yeah, that 3 letter word check is a nuisance tbh
    1 point
  8. This should do it throw new Wire404Exception();
    1 point
  9. Just a quick note about output formatting. You always want it on before outputting anything. This ensures that when you output $page->title (for instance) that characters like '&' will get entity encoded to '&', and the like. Whereas, if you were setting values to the page, you'd want it to store '&' rather than '&'. So updating an earlier example, you'd want to do this: echo "<a href='{$p->url}'>{$p->title}</a> " ; // output formatting should be ON here since you are echoing output. // now you want output formatting OFF, since you are setting values and saving a page: $p->of(false); // same as setOutputFormatting(false), shorter syntax. $p->subway_station = $pages->get("/subway_station/sub_st_0111/"); $page->save();
    1 point
  10. You could also do this in your homepage template: echo $pages->get('/path/to/page/')->render();
    1 point
  11. If the content you want to add consists of fields that would be applicable all users, then it's preferable to add them directly to the user template. But if it's content that is only going to be applicable to some users, then may be better to make them child pages.
    1 point
  12. Right now the field is basically following the rules of PHP's URL filter. I can experiment more with this to see about adding mailto. It does make sense as a possible configuration option as there are many places where you might want to use mailto where you'd also use a URL.
    1 point
  13. There are a number of ways to do this, but for the purposes of an example, lets look at your first one: Brand. Lets say you've got your brands as pages here: /brands/acura/ /brands/audi/ /brands/ford/ ...etc. Your search form might look like this: $checkedBrands = $input->whitelist('brands'); if(!is_array($checkedBrands)) $checkedBrands = array(); foreach($pages->get('/brands/')->children as $brand) { if(in_array($brand->id, $checkedBrands)) $checked = " checked='checked'"; echo "<label><input type='checkbox' name='brands[]' value='{$brand->id}' $checked> {$brand->title}</label>"; } And your search processor might look like this: $selector = ''; if(is_array($input->get->brands)) { $brands = array(); foreach($input->get->brands as $brand) $brands[] = (int) $brand; $input->whitelist('brands', $brands); if(count($brands)) $selector .= "brands=" . implode('|', $brands) . ", "; } $vehicles = $pages->find("template=vehicle, $selector"); Now when it comes to showing something like models, you'd either want the models to have a page reference selecting a brand they relate to, or you'd want to make the models children of the brand. That should make it fairly easy to determine your models once you know the brands: $models = new PageArray(); foreach($brands as $brand) { $models->import($pages->get((int) $brand)->children); }
    1 point
  14. Thanks Renobird, this code has just helped me out!
    1 point
×
×
  • Create New...