Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 03/22/2012 in all areas

  1. Try this: <? $image = $profile->images->first(); echo "<img src='{$image->url}' height='{$image->height}' width='{$image->width}' alt='" . ($image->description ? $image->description : $image->name) . "' />"; ?> Hehe, posted at the same time more or less netcarver
    1 point
  2. Tom, try this (untested)... <? $image = $profile->images->first(); $alt = ($image->description) ? $image->description : $image->name; echo "<img src='{$image->url}' height='{$image->height}' width='{$image->width}' alt='{$alt}' />"; ?>
    1 point
  3. That's what I had to learn too. You can look at it from a jQuery point of view. Select/find the element you want to use and do something. That's why I posted the cheat sheet. It's pretty straight-forward. I've got a feeling I've barely scratched the surface, but I do see it's potential. That why PW rocks.
    1 point
  4. The cheat sheet helped my out on numerous occasions for getting the stuff you want. Very useful for this kind of information.
    1 point
  5. What about ProcessWire's $a->first() and $a->last() ? Unless there's something I'm not seeing here.
    1 point
  6. Hey Steve, Long time eh? I'm glad to see you here as well. I still keep tabs on the TXP forums, but I tend to build the same kinds of sites with TXP lately, as a result I don't have a lot to ask about or contribute. I have a fairly involved design/build coming up at my new job — and ProcessWire fits the bill perfectly. I think you'll be seeing a lot of me around here.
    1 point
  7. I just commited an update, with improvements to simplify module code. Originally fixing an issue with "has_children" behaviour. Which now works also with custom selector (that would ommit pages by template) and max_levels as expected. It will now only append if there really is children to be shown. Also fixed and updated some documentation. Thanks
    1 point
  8. @Soma - thanks for the tip, and guidance @Ryan - what the 'oh my!' brain cell implant did you have to come up with such a ridiculously versatile system, Ryan. I mean really! I created plugins for WP, addons for a few others, and 'implementing' your modules (once i've now done it) is like a cakewalk... no FUNKY nomenclature, tricks, 'jam this into here...' and the ever-present 'oh yeah, you can't do that here so you have to hack your way in this way' stuff... period. Just soup to nuts, awesome, using observer patterns, full reflection, and keeping everyone on the handrail using "implements" in modules you rawk Ryan! (... and obviously the community that supports ya! ) Thanks all again... Maybe i'll post my two new modules... for anyone else who wants to use them. Just launch platforms is all - for making new/improved modules and sorts.
    1 point
  9. Whilst I'm not sure what a CAS system is, Jim has done something with LDAP which may be of some help:
    1 point
  10. I think you are on the right path here. The page that Jasper and Marc linked to is good when working with larger scale stuff (and smaller too), but I'm not usually that disciplined on smaller stuff. One alternative would be to bundle your news_posts.inc into a function, and keep a file with that function and any others you might need. I usually call mine tools.inc. The function would look like this: /site/templates/tools.inc function listNews($news) { $out = ''; foreach($news as $item) $out .= "<p>{$item->title}</p>"; return $out; } Your template files that need to list news (or use your other functions) would include('./tools.inc'); at the top, and then they would call the function when/if they needed to list news: echo listNews($pages->get('/news/')->children('limit=5'));
    1 point
  11. I made an update to the module. If you get the latest version you'll get new features. Added support for custom selector: Instead of adding more options to exclude pages, since PW is so open as to how to set up you pages/template stucture, I've implemented the option to specify a PW selector. So some of the power of it comes into play. (Remember it's always best-practice to sanitize values that may come from user input you can trust. This module doesn't do any) You can for example hide page(s) with a certain or parent(s): echo $tree->render( array("selector" => "parent!=1008|1002") ); And child pages from those parent will not be rendered. Or if you want to exclude page(s) with certain template(s) you would do : echo $tree->render( array("selector" => "template!=news-item|event-item") ); Or you could limit the items per level: echo $tree->render( array("selector" => "limit=5") ); Added support for "first,last" class: A new option that is off by default, that will output extra class to links. You can turn it on with the options "css_firstlast_on" set to true array('css_firstlast_on' => true) Minor changes: Done some renaming and restructuring. Also removed some newlines in the markup output.
    1 point
×
×
  • Create New...