Marty Walker
Members-
Posts
633 -
Joined
-
Last visited
-
Days Won
3
Everything posted by Marty Walker
-
Hi Ryan, All that plugin does is replace the system's internally generated thumbnail with it's own. In textpattern there's an association between the full image and the thumbnail - if it exists. There's what's called an "article image" field that has an image picker (another plugin) which lets him select a thumbnail to go there. The code below (using another plugin) links the thumbnail to the original image. So my lightbox code looked like this: <li><a href="<txp:upm_img_full_url />" title="<txp:title />" rel="lightbox"><img src="<txp:upm_img_thumb_url />" alt="<txp:title />"></a></li> Otherwise the ordinary textpattern tag to display a thumbail would be: <txp:article_image thumbnail="1" /> . @adamkiss: It's really all about having more control over what part of the image I want to show as a thumbnail. I am looking at this with artists in mind so my opinion might be skewed somewhat. Perhaps this kind of cropping option should be an optional module rather than a core feature. Regards Martin
-
Hi, Here's a video I made showing how I use textpattern (+ plugin) to create thumbnails. I wasn't sure I got my point across well enough in my post. I hope it makes sense. Looks like the jCrop site is back up too: http://deepliquid.com/content/Jcrop.html Regards Marty
-
Hi, While we're on the subject of images I'd like to put in another feature request/wish. I work with a lot of artists (http://www.illustratorsaustralia.com/). Once thing they really need in my opinion (and theirs) is a better way to create thumbnails. The basic centre crop just isn't enough for them to highlight the key part of an illustration. Sure, they could upload a seperate thumbnail file, but really, this is 2011. textpattern has the best image management I've seen in any CMS I've used. There's a plugin for it called EBL Image Edit (http://textpattern.syserror.net/article/4/ebl-image-edit) will allows you to select a portion of an image and create a thumbnail. There's an option to constrain the proportions too. A while ago I came across a jQuery cropping tool called jCrop. Unfortunately the jCrop site is down (http://deepliquid.com/content/Jcrop.html) which would better illustrate what I mean. This example (http://nettuts.s3.amazonaws.com/1018_crop/demo/index.html) goes some way to showing how it works. As much as I love textpattern I think ProcessWire is more artist-friendly. For a portfolio site having this type of thumbnailing option would be a great time saver. Are there any plans have some centralised image area or let the image field be able to peruse image fields uploaded to other pages? I know this can be done in the wysiwyg editor which is something, but there's often reasons for images to appear in different locations on a site. I'm all for avoiding duplicate imagery. Just my rambling two cents. Regards Martin
-
Thanks Ryan. So what would you recommend the permissions for files and directories be set to? I get a lot of files displaying 'not found' in the Safari Activity window.
-
Thanks for the suggestion. I have tried that. I still get the same errors.
-
That setting is what I missed. Thanks again.
-
Hi, I'm getting a few errors and I'm not sure what might be causing it. First, I get: Security Warning: /site/config.php is writable and ideally should not be. Security Warning: /site/index.php is writable and ideally should not be. Both files are set to 444. The second is when I try to change the template used by a page. Template 'page' is not allowed 'page' being my template name. The page has no content. Regards Martin
-
Sir, you are a gentleman. Thank you. I would not have worked that out. Regards Martin
-
Thanks for you help and time. It's nearly there except for when I'm on the main Advertising 'list' page. I'm a php ubernoob and I don't understand that code enough. In EE or textpattern this kind of navigation highlighting would take me 2 seconds (with sections and url_segments). I think I'll just hard code it and write a load of CSS. Thanks again.
-
Thanks for the replies. I think I should illustrate more clearly what I'm trying to do. Here's the development site: http://otoshpw.clientsite.net.au/ My pages are structured thusly: Home -Illustration --Advertising ---client_work_item ---client_work_item ---client_work_item ---client_work_item -Art --Limited Edition Prints etc, etc I'm not including Home in the navigation I'm generating. What I'd like to do, for example, is whenever I'm in a section/page like Advertising or any page under that, have class='current' apply to that LI. Regards Martin
-
I spoke too soon. That won't highlight if I go down another level.
-
Ahhhh. Thank you!
-
Hi, I'm using the code below to generate a basic navigation: <?php foreach($pages->find("parent=/illustration, sort=sort") as $p) { echo "<li><a href='{$p->url}'>{$p->title}</a></li>"; } Works great but I'm trying to work out how to add a class="current" to the LI if that page matches that nav item - and at any level. I've had a go at trying to work out the code in the sitemap template but without any luck. <?php $nav = $pages->get("/illustration"); $children = $nav->children; foreach($children as $child) { $current = $child === $page->rootParent ? " class='current'" : ''; echo "<li$current><a href='{$child->url}'>{$child->title}</a></li>"; } Any thoughts? Regards Martin // adamkiss: added 'php' in your second code block to force code coloring // apeisa: added [solved] to subject
-
Hi Ryan, It's in a template called artist_list. My pages are: Portfolio - uses template artist_list.php - artwork - child page uses template 'artist_work' with two fields - artist_image & artist_thumbnail - artwork - etc - artwork - etc All I'd like to do is generate a thumbnail from the larger image if the thumbnail image isn't present. The child pages won't be viewed as such as I'm calling the larger image into Fancybox.
-
Hi Ryan, I have both fields set to 1 as each will hold a single image. 'artist_image' holds the full size image 'artist_thumbnail' holds the thumbnail ...both are set to 1. Perhaps I'm doing something else wrong.
-
No problems. I really appreciate all the help you've given me.
-
Thank you again. Your explanation goes some way in helping me learn PW better and I appreciated it. If I don't upload a thumbnail and get PW to generate a thumb I get the below error. Call to a member function size() on a non-object <?php foreach($page->children as $artist_item) { $image = $artist_item->artist_image; $thumb = $artist_item->artist_thumbnail; if(!$thumb) $thumb = $image; $thumb = $thumb->eq(0)->size(100,100); echo "<li><a rel='lightbox' title='{$artist_item->title}' href='{$image->url}'><img src='{$thumb->url}' alt='{$artist_item->title}'></a></li>"; }
-
That's done it! Thank you!
-
If I remove this line: $thumb = $thumb->size(100, 100); the page renders with the link to the full size image - which is what I'm after.
-
Yes I have. http://awesomescreenshot.com/0a6ar6qac
-
Hi, Thanks for your help. I've started from scratch. I have two fields, artist_image & artist_thumbnail. I get the same errors. <?php foreach($page->children as $artist_item) { $image = $artist_item->artist_image; $thumb = $artist_item->artist_thumbnail; if(!$thumb) $thumb = $image; $thumb = $thumb->size(100, 100); echo "<li><a rel='lightbox' title='{$artist_item->title}' href='{$image->url}'><img src='{$thumb->url}' alt='{$artist_item->title}'></a></li>"; }
-
Thanks Ryan, I get all sorts of errors if I try that code. Exception: Method Pageimages::size does not exist or is not callable in this context (in /Users/me/Sites/ProcessWire/ryancramerdesign-ProcessWire-TEST/wire/core/Wire.php line 205) #0 [internal function]: Wire->__call('size', Array) #1 /Users/me/Sites/ProcessWire/ryancramerdesign-ProcessWire-TEST/site/templates/template.php(90): Pageimages->size(100, 100) #2 /Users/me/Sites/ProcessWire/ryancramerdesign-ProcessWire-TEST/wire/core/TemplateFile.php(88): require('/Users/me/S...') #3 /Users/me/Sites/ProcessWire/ryancramerdesign-ProcessWire-TEST/wire/core/Wire.php(241): TemplateFile->___render() #4 /Users/me/Sites/ProcessWire/ryancramerdesign-ProcessWire-TEST/wire/core/Wire.php(203): Wire->runHooks(Array, Array) #5 [internal function]: Wire->__call('render', Array) #6 /Users/martin/Sites/ProcessWire/ryancramerdesign-ProcessWire-TEST/wire/modules/PageRender.module(144): TemplateFile->render('render', Array) #7 /Users/martin/Sites/ProcessWire/ryancramerdesign-ProcessWire-TEST/wire/core/Wire.php
-
Hi, I'm trying to get my head around something I know should be simple. I'm working on an a site for an artist who'd like to upload a custom thumbnail for each of his images. I've added a second field called 'artist_thumbnail'. In my template I want to test to see if there's a custom thumbnail and if not get processwire to generate one automatically. PHP isn't my strong point. Am I even close with this code? foreach($page->children("limit=32") as $folio_item) { if($folio_item->artist_thumbnail) { $img = "<li><a rel='lightbox' title='{$folio_item->title}' href='{$image->url}'><img title='{$folio_item->title}' src='{$thumb->url}' alt='{$folio_item->title}'></a></li>"; } else if($folio_item->artist_image) { $thumb = $folio_item->artist_image->size(100, 100); $image = $folio_item->artist_image; $img = "<li><a rel='lightbox' title='{$folio_item->title}' href='{$image->url}'><img title='{$folio_item->title}' src='{$thumb->url}' alt='{$folio_item->title}'></a></li>"; } // Output the image echo "$img"; }
-
I think I have it sorted. if($page->prev->id) {echo "<p class='next'><a href='{$page->prev->url}'>prev</a></p>";} if($page->next->id) {echo "<p class='prev'><a href='{$page->next->url}'>next</a></p>";}
-
Hi Ryan, This would be a great feature to have. If only to keep duplicate images to a minimum. Regards Martin