Jump to content

Martijn Geerts

PW-Moderators
  • Posts

    2,769
  • Joined

  • Last visited

  • Days Won

    31

Everything posted by Martijn Geerts

  1. Interesting point takin Teppo. As search engine becomes smarter and more 'human', fooling search engines with simple words has become questionable. I tend to think, search engines love 'packages' of information. A good header a few good paragraphs, a good link to related material and good naming conventions for images and their an alt text. In my opinion, search engines try to find what's best for a human to read. More, it's likely that search engines recognize some kind of social aspect. Is a site friendly for colour blindness ? What do users see when they have a poor connection. How is the bandwidth. All the little bit help if you asked me.
  2. It's an asm select. You can select templates with it. Say you create a field with the name select_template (FieldtypeTemplates) Then in a page using a template with this field, you can select multiple templates. ( stored in a Wirearray ) // prepare templates for a selector string $tpl = $page->select_template ? "template=" . implode("|",$page->select_template) : ''; // Search selector to search for pages with template(s) you selected in the page, // max 5 pages, sorted on creation date, newest firsts. $template_pages = $pages->find("sort=-created, limit=5, $tpl"); ps, not tested
  3. url: www.site-name.com/processwire/
  4. That's why I was quicker on the previous post !
  5. It's the easiest way to go compairing the other options. The other possibilities can make you insane ;-)
  6. Here again ! Use Soma's flexible download script and add some logic
  7. You're not that vague I guess. Have a look at Soma's brand <blink>NEW</blink> blog !
  8. Never used this module and maybe this is a unnecessary answer/question: Did you add the Textformatter to the field ?
  9. Those are better then my writing skills
  10. I have a hard time to understand what you want.
  11. $f->state->title or $f->state->first()->title, should work. No need for an extra search.
  12. $gewt = $pages->get("template=addProject"); // is always getting the first page found, a page object, not an array I asume that profName is a field with the type of Page, (1 page object) Now every time the loop loops it wil get the firstpage, get the Pagefield and echo the title of that page. So if you have 400 users, it will echo 400 times the same thing. $guest = $roles->get("guest"); $users = $users->find("roles!=$guest->id, sort=name"); foreach($users as $u) { // $gewt = $pages->get("template=addProject"); <-- first found page, with the template addProject echo "<p>"; echo $u->fullname . " | "; // Custom text field or something echo $u->state->title . " | "; // Field type of Page, single page echo $u->resourceType . " | "; // Custom text field or something // $gewt->profName->title; <-- --> always same page, always the same title of that page. echo "</p>"; }
  13. Martijn Geerts

    soma|blog

    let the leech begin !
  14. if you include a library like jQuery, it's quite handy that you can use it to. If the scripts are linked before, you can't use jQuery. And you all have to do it the Javascript only way. Styling is done with CSS, I prefer to throw the CSS what comes with it away, but that not recommended
  15. It's quite an complex structure. Maybe the fault is on my side. There are serveral finds on the same $pagearray, hasn't figured it out completely. This is what I want: I have a carousel, (listing pages when it has images), next I have a throughput of pages, which includes the dropped pages of the carousel (pages with no images) // Home Page (i stands for pages with image) carousel: +-+ +-+ +-+ +-+ +-+ +-+ +-+ |i| |D| |D| |i| |i| |D| |i| +-+ +-+ +-+ +-+ +-+ +-+ +-+ ^ ^ ^ | | | +-----+-----------------+---- dropped, contains no images throughput: (limit 5) +-+ +-+ +-+ +-+ +-+ |D| |D| |D| | | | | 3 dropped pages + 2 extra pages to fill up till the limit is reached, sort=-date +-+ +-+ +-+ +-+ +-+ Now on an other page, say /news/ I want to paginate all other news items not containing the pages loaded on the home page. --- I re-arranged a lot, calling start=0 on all searches ( except the one I use pagination for ) it's solved. Big thanks for stepping in Nik.
  16. Martijn Geerts

    soma|blog

    Soma Great, Don't forget to mention some of your gists
  17. In a recent project I have plans to do almost identical. I use all own & sitescripts for $config->styles & scripts. The new FilenameArray(); I gonna use for all Banners and adds & stuff. This way I can be sure that all my own scripts and styles comes absolutely first. They are all loaded on demand, there are no hardcoded links in the templates scripts except for jQuery.
  18. Or this, (more colossus) Interesting link Horst ! Didn't knew about that statue ! tnx ps, great docu and this one.
  19. I know you're our ancient statue !
  20. version: 2.3.8 This works $page->children(); // works $pages->find("parent=$page"); // works $page->children("start=0, limit=4"); // works $page->children("limit=4"); // throws a fatal error $pages->find("parent=$page, limit=4") // throws a fatal error // Fatal error: Call to a member function children() on a non-object in /Users/martijn/Sites/www_domains/pvw/htdocs/wire/core/PageTraversal.php on line 205 Fatal error isn't thrown when adding start=0 to the selector.
  21. Christmas is coming (oke I'm early), so here: new x-mass programming music. sing-a-long: You better watch out, You better not Skype, You better log out, Yeah you better not type, The NSA is coming to town.
  22. I love modules, cause they're simple to use & your template will look so much cleaner. Next, it's more portable.
  23. And I do the opposite Joss. Almost always use double quotes, except when defining variables with straight strings. ps, I love curly and I love strings.
  24. Problem Solved, updated the gist. To use: $image = $page->image; // image from $page, or any other ProcessWire image // $x & $y are required $x = 200; // width, the size of the box (max width an image can scale in width) $y = 100; // height, the size of the box (max height an image can scale in height) // $compress is optional $compress = 20; // makes heavier smaller then normal images, from (low) 1 to (high) 99 compression // usage 1 $img = $modules->get("ImageFitBoundaries"); $img = $img->load($image, $x, $y, $compress); echo $img->render(); // usage 2 $mod = $modules->get("ImageFitBoundaries"); $info = $mod->load($image, $x, $y, $compress)->info(); // also works: $mod->load($image, $x, $y, $compress)->info $thumb = $image->size($info['width'], $info['height']); echo "<img src='$thumb->url'>"; Thanks Dave, for your insight!
  25. <!-- bxSlider Javascript file --> on that line there is a double quote missing. what's also weird is the main.js is loaded before jQuery. And the comment is weird, Java has nothing to do with including the script. Not necessary, but recommended (for HTML5): When javascript used with <script> tags no attributes are required (src when linking, duh). For the <link> tag, only rel & href attributes are required.
×
×
  • Create New...