Jump to content

diogo

Moderators
  • Posts

    4,296
  • Joined

  • Last visited

  • Days Won

    79

Everything posted by diogo

  1. Yeah!! At least until Ryan jumps in and kick our asses with his arguments
  2. I'm not sure if I like it, but you get a like for a great brainstorming line
  3. I thought of this many times also, and also think that in some situations a field could be used more than once in a template. But I accept the argument that the database is prepared to have only one per template and that it doesn't justify doing a big change to it only because of this. Namespacing would be overcomplicating in my opinion. Anyway, I'm with Rob here, and glad that there is this discussion again
  4. How about this? $array = array(); foreach($page->repeater as $r){ $array[] = <<<EOT <div> <h2>{$r->headline}</h2> <p>{$r->body}</p> </div> EOT; } foreach($page->images as $i){ $array[] = "<img src='{$i->url}'/>"; } shuffle($array); foreach($array as $a){ echo $a; } edit: the forum editor seems not to approve the heredoc sintax, and because I don't want any conflicts with it, here is the alternative way $array = array(); foreach($page->repeater as $r){ $array[] = "<div><h2>{$r->headline}</h2><p>{$r->body}</p></div>"; } foreach($page->images as $i){ $array[] = "<img src='{$i->url}'/>"; } shuffle($array); foreach($array as $a){ echo $a; }
  5. Can you give a concrete example of what you are trying to achieve? What order do you want to get by mixing the arrays?
  6. Ryan, this is one of those answers that should be visible outside the scope of a forum thread. I went to check how you personal blog is going, and it turns out the last post is from July 2011. How is this possible if from then on you wrote a lot of invaluable information and opinion texts on the forum??
  7. Pete, you should correct echo "<h2>$artist->title</h2>"; to echo "<h2>$album>title</h2>"; Other than this, I don't have anything to add to Pete's excellent answer
  8. I identified what bothers me. The globe and the photographic camera are in the same layer, to me it makes the movement less natural. Edit: somehow I instinctively expect the object to come to the mouse and not go away from it when i approach them.
  9. Nice! I like the drawings and the idea, but the animation could be smoother.
  10. diogo

    Max, Cafe, Bar,

    Georgson, I'm sorry I never answered to this, somehow I din't see your tip. And now I came back to this to help here and saw it. I will check it out, thanks!
  11. I also have a site hosted on Strato and in the beginning was veeery slow. I talked about this on this forum thread http://processwire.com/talk/topic/847-max-cafe-bar/, Check Georgson's answer at the end, might be useful.
  12. Sivutyypii sounds good to me. But not necessarily better than sivupohja. I like both
  13. Slightly out of topic, just to say that this evening there is no programming. Just this https://www.youtube.com/watch?v=RVJUJF6Rg1Q
  14. I must say it's a very good looking app. I installed it on fortrabbit to test. (Craft this is the former Blocks CMS, for those who are wondering)
  15. Here is a draft of the module that I talked about above <?php //ModifiedMinusCreated.module class ModifiedMinusCreated extends WireData implements Module { public static function getModuleInfo() { return array( 'title' => 'Modified minus created', 'version' => 100, 'summary' => 'only a rough draft', 'singular' => true, 'autoload' => true, ); } public function init() { $this->pages->addHookBefore('save', $this, 'subtract'); } public function subtract($event) { $page = $event->arguments[0]; if(!$page->fieldgroup->modifiedminuscreated) return; $page->modifiedminuscreated = $page->modified - $page->created; } Now you just have to create the integer field "modifiedminuscreated" and add it to the templates you want. edited: changed the code under Soma's suggestion
  16. Your code is a mess Soma I did some corrections: public function addTitle($event) { $page = $event->arguments[0]; if($page->done) return; if($page->template->name !== "product") return; $page->title = $page->somefield . " " . $page->field2; //$page->trackChange("data"); <- is this needed? I got an error, and it worked without //} //$page->done = true; <- same goes for this //$page->save(); <- the hook is before save, so we don't need this }
  17. With javascript of course. You just have to be careful that the video is not switched in the middle when someone adjusts the browser window.
  18. Interesting discussion starting here http://forums.modx.com/thread/83112/processwire---the-new-evo
  19. Welcome to the forum ezeei. The default page is home, and it can have as many children as you wish. What are you trying to accomplish exactly?
  20. I'm in a hurry now, but try var_dumping the image and look for that info there: var_dump($page->images->first());
  21. You can do this instead, and then cache it. http://processwire.com/talk/topic/2210-help-getting-a-custom-styles-php-file-working/?p=20641
  22. You could also create a module that would hook to save and update a field holding the value of modified minus created. Then you could use $pages->find("modified-created>0");
×
×
  • Create New...