Jump to content

Soma

Moderators
  • Posts

    6,798
  • Joined

  • Last visited

  • Days Won

    158

Everything posted by Soma

  1. Not sure what it's about, but you could debug it using isHidden() http://processwire.c...filter=isHidden and see what status they really have. As for the sorting it can have different reasons, not sure though. Try reorder the pages so it get updated (last to first pos). Also you can use the sort=sort selector on the children.
  2. Thanks for pointing out. I always leave it out as it's optional in HTML5. From W3C: "The "type" attribute is required in HTML 4, but optional in HTML5."
  3. Awesome! I also wanted to do something similar but didn't really get into it. Looks very nice! Thanks for posting. Would you mind to put it on modules.processwire.com and create a repository on github?
  4. not really, in the init no page is loaded yet, but you could try to put it in loaded() or was it ready() function maybe or a hook from in the init().
  5. Nico, you could also use following to check if in backend. if($page->template == "admin") { .. } Or another way when using a hook function, for example function myhook(HookEvent $event) { $cur_page = $event->object; if($cur_page->template == "admin") { ... } }
  6. Something like this can be used to create a new PageArray $somepages = $pages->find("template=news, limit=10"); $parray = new PageArray(); $parray->add($somepages); // add one page (or also multiple since 2.2.2) // or $parray->import($somepages); // add one or multiple pages from another PageArray $parray->sort("-modified"); ... Edit: If you have an array with id's that's also cool: $ids = array(1002,1004,2303,4342); $parray = new PageArray(); foreach( $ids as $id ) $page->id ? $parray->add( $page->get($id) ) : continue ;
  7. I don't think there's a "PW way". I think most limits as far as those techniques goes regarding PW is because the developer (Ryan) isn't using those workflows so it may not ready to do everything and it may not working/supporting all workflows and standards (which for myself also don't really use or care), not saying this can't be adapted to do so. I'm sure Ryan will be pleasant to help doing changes if there's any issues with it that PW gets in the way.
  8. What do you want to debug? I have to say I have no clue about PHPStorm and XDebug. I think this has not much to do with PW rather than your IDE and PHP. DO you mean a local runtime environement? I think without having PW context there (not plain php) it doesn't really make sense, and something you do while coding templates -> testing in browser, if error go back and check, fix, continue. There's also debug option you can enable in /site/config.php to see errors and warnings. Edit: I think your struggle is also little selfmade, I've never needed autocomplete for something like PW, or debug, lint or anything, just for coding php websites, rarely really have the need as it's so simple. What I sometimes use is a phplint to spot errors in php code right away, but mostly it's just annoying and slows IDE's down.
  9. Yep, it's now updated on directory.
  10. Thanks Adam, didn't really notice somethings wrong (wrong method name) when recently adding version to scripts. It's fixed in latest commit. You should be able to install it sucessfully.
  11. Hover the title instead.
  12. Soma

    ProcessWire on the web

    In german and on a WP Blog . Thanks Michael! http://www.perun.net/2012/08/08/das-kleine-feine-cms-processwire-reduzierung-aufs-wesentliche/
  13. Soma

    Codesense

    Actually this topic might be better:
  14. I often type some random chars into the .htaccess to see if a 500 (?) is thrown, which helps to see if htacess is really working/enabled.
  15. For things it's may be useful (checkbox) but never felt I ever need it as you could also make it reverse (check to disable). And if then it also can be handled in the template code, if(!$value) $value = 'default'; way. I'm not sure what to think about it really, some part of me likes having default values and some part thinks it complicates things not really necessary maybe.
  16. This IS the problem yes. Yeah I know I haven't implement the check for zip yet. Thanks for the link.
  17. I guess it is working then?
  18. That would have to be loooots of cash then. Because you'll need to create a image and a link plugin and also some configuration etc.
  19. Dave, can you grab the latest dev version and replace the ModulesManager.module and try again? https://github.com/s...anager/tree/dev
  20. There must be something strange. Here's the php bug https://bugs.php.net/bug.php?id=53018 Don't know yet what to try, but maybe it's possible to get around it.
  21. As I said the github url does a redirect when using the zip url (button) on the github page. I recognized this but used curl then, so there's a setting to allow to follow. Not sure why it's not working with file_get_contents and redirects on your part. Think it's a php setting or something we'll have to try, maybe a context stream is needed in your case. Also I've seen there's a php bug. What version are you using? Can you try on another install or locally?
  22. Yes the github urls are redirected when downloading the zip. Have you got the latest version? It works well on all my installs even with the redirect, not sure what doesn't in your case. Have you tried another download?
  23. Any more informations? Does it fail on all or just on some. What line is the error? You could try this modified code: <?php $blog_entries = $pages->get(1008)->children; foreach($blog_entries as $blog_entry) { $blog_thumb = false; if(count($blog_entry->blog_images)){ if($blog_entry->blog_images->first()) { $image = $blog_entry->blog_images->first(); } else $image = $blog_entry->blog_images; $blog_thumb = $image->width(500); } echo "<div class='blog_overview_item' >"; echo "<h2><a href=\"{$blog_entry->url}\">{$blog_entry->title}</a></h2>"; echo "<p>posted on ". date("d.m.Y, H:i", $blog_entry->created) ."</p>"; echo '<div class="blog_preview_image">'; if($blog_thumb) { echo "<a href='{$blog_entry->url}'><img width='{$blog_thumb->width}' height='{$blog_thumb->height}' src='{$blog_thumb->url}' alt='{$blog_thumb->description}' /></a>"; } echo "</div>"; echo "</div>"; }
  24. I still don't get what you mean. Reading you posts, there's no "dirty hack" needed, it's simple, flexible and straight forward with only 1 line of php code to include the view template. Without that how would your main template know where to include the view? include($config->paths->templates . "view/{$page->template}.inc") There's no need to go fancy here. I wouldn't like if PW would make assumptions on how to use it.
×
×
  • Create New...