-
Posts
2,769 -
Joined
-
Last visited
-
Days Won
31
Everything posted by Martijn Geerts
-
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.
-
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
-
url: www.site-name.com/processwire/
- 1 reply
-
- 1
-
-
Downloads page synchronized with News section
Martijn Geerts replied to daniel.s's topic in General Support
That's why I was quicker on the previous post ! -
It's the easiest way to go compairing the other options. The other possibilities can make you insane ;-)
-
Here again ! Use Soma's flexible download script and add some logic
-
Downloads page synchronized with News section
Martijn Geerts replied to daniel.s's topic in General Support
You're not that vague I guess. Have a look at Soma's brand <blink>NEW</blink> blog ! -
Never used this module and maybe this is a unnecessary answer/question: Did you add the Textformatter to the field ?
-
possible bug in selector using `limit`
Martijn Geerts replied to Martijn Geerts's topic in General Support
Those are better then my writing skills -
I have a hard time to understand what you want.
-
$f->state->title or $f->state->first()->title, should work. No need for an extra search.
-
$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>"; }
-
Howto: add a banner that rotates pictures ?
Martijn Geerts replied to motionmindz's topic in Getting Started
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 -
possible bug in selector using `limit`
Martijn Geerts replied to Martijn Geerts's topic in General Support
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. -
Soma Great, Don't forget to mention some of your gists
-
How to load JS/ CSS Plugins (colorbox, cycle2, ...)
Martijn Geerts replied to pwFoo's topic in Getting Started
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. -
Or this, (more colossus) Interesting link Horst ! Didn't knew about that statue ! tnx ps, great docu and this one.
-
I know you're our ancient statue !
-
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.
-
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.
-
I love modules, cause they're simple to use & your template will look so much cleaner. Next, it's more portable.
-
Retrieving Tag Results In Separate Sections
Martijn Geerts replied to fay's topic in Getting Started
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. -
Automatic logo resizing. (Solved)
Martijn Geerts replied to Martijn Geerts's topic in Module/Plugin Development
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! -
Howto: add a banner that rotates pictures ?
Martijn Geerts replied to motionmindz's topic in Getting Started
<!-- 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.