Jump to content

Soma

Moderators
  • Posts

    6,798
  • Joined

  • Last visited

  • Days Won

    158

Everything posted by Soma

  1. But then I question why you want to strip paragraphs? Usually we use the TinyMCE to have them. So can't you just simply use a textarea?
  2. You can add additional configuration in the field setting "tinymce advanced setting" under input tab. There you have a field you can enter key:value for configuration. Like skin-variant: silver The value doesn't need apostrophs.
  3. But do you understand it now? I think the real problem is in that we use same terms with different meanings. Some know more some less. And sometimes we forget about it so it's sometimes really hard to understand and find out what some people are asking and what the problem is. Some deal different with it than others and some keep out. I must confess I might took some things for granted and in my world and assumed you would understand. So don't take that personal or anything like that. And if something doesn't make sense what I'm saying we can try work it out. I'd like to help you really. Your 'different' looks like you mean 'code' is different. The 'different' we were talking about was that image field can be either of single or multiple thus the code has to be different. You also was speaking about that it would be 'different' in repeaters... So actually it's still the same BUT the repeater add a level or complexness (is that even a word?) to it I think you might not aware of. Looking at your two examples of code you seem to miss that those, both foearch loops to iterate the entries of an array, the first on is a image field with multiple images, and the second example is the repeater field (which is also an array) So let's assume you have in both examples an image field of multiple. foreach($page->my_pics as $pic){ //$pic is now one of $page->my_pics echo "<li><a href='{$pic->url}' class='pic' title='{$pic->description}'><img src='{$pic->size(85,85)->url}' alt='{$page->name} photo' /></a></li>\n"; } Multiple images (if present) will get outputed. And this if it's in a repeater. We need to add another foreach wrapping the previous example. foreach($page->get("product") as $item) { // $item is now an entry from $page->product (repeater) // too access the images we now iterate $item->my_pics (images) foreach($item->my_pics as $img) { // $img is and image from $page->my_pics (inside repeater) echo "<div><a class='nowandthen'><img src='{$img->url}' alt='{$img->description}'>"; } } This cycles all repeater elements (if any) and output each image from the my_pics field. Now, if the image field is set to max "1" in the field setting, so you can only upload 1 image. The whole would look different as there's no foreach needed. But image field still work the same. //$page->my_pic is now only singular so no foreach needed as it's not an array echo "<li><a href='{$page->my_pic->url}' class='pic' title='{$page->my_pic->description}'><img src='{$page->my_pic->size(85,85)->url}' alt='{$page->my_pic->name} photo' /></a></li>\n"; Now the same in a repeater (product). BTW instead of $page->get("product") you can also just use $page->product, which is the same. foreach($page->product as $item) { echo "<div><a class='nowandthen'><img src='{$item->my_pic->url}' alt='{$item->my_pic->description}'>"; } One more. If the image field is again multiple >1 or 0 max files. You can also without foreach loop accessing one fromt he array directly. That's where ->first() comes into play. This also should be possible to use on repeaters to get the first repeater element from an array. Or it also can be used on Page arrays. foreach($page->product as $item) { echo "<div><a class='nowandthen'><img src='{$item->my_pics->first()->url}' alt='{$item->my_pic->firs()->description}'>"; } I'm not sure if that does make something clear for you. Let us know if still something unclear.
  4. I'm using repeaters and images and didn't notice anything different from images outside repeaters. I just tested to see if multiple images works. Everything works like a charm. // my single image field foreach($page->teasers as $teaser) { if(count($teaser->image)) echo "<img src='{$teaser->image->size(0,100)->url}'/>"; } // changed to multiple foreach($page->teasers as $teaser) { if(count($teaser->images)) echo "<img src='{$teaser->images->first()->size(0,100)->url}'/>"; } Images get rendered as it should.
  5. The image field is well documented http://processwire.com/api/fieldtypes/images/, and it's not different in a repeater.
  6. I think that's one thing Ryan wanted to simplify. Look in the original repater thread
  7. That's the line where it tries to create a png image.
  8. Only reasonable to me seems there must be something client side that gets appended from the computer while uploading the file, on server it is too big or corrupt that will throw a memory (so he could be infected by some strange alien source maybe) Is client uploading using drag and drop, can he try oldscool and see if it works? Can you send me an image?
  9. That's what I meant basicly. Just not the ugly ['foo'] thing. Well what I see is it doesn't solve the problems many unexperienced have they use the single image but they have a multiple image field. And one can even think if I only upload only 1 image it can't be an array. Edit: Well behind the scenes it's already always an array no matter what max setting is, just the value is treated differently on pages outputFormatting (page context) I think.
  10. What changed should be made I'm not sure, I just fear, having it always return array even if it's only one image, will cause the same problem at the end. I can't find the post from Ryan, but I can find 10000 times a post where this was the issue. I think there's no way around having work both ways with single image anyway to maintain backward compatibility. Remember the issue here with digitexs example is simply about not understanding it is an array, even if it's a singe image uploaded. Imagine it will work with the original code and then upload a second image, it will be hard to understand why it suddenly doesn't work if understanding it's an array arrays is not so obvious. What about also throwing an explaining error notice if used the wrong way?
  11. Cough cough, I've already heard that from Ryan!
  12. Just a random guess, as it can be many things. He's uploading an .png image but with .jpg ending? Another idea, can you access your clients computer remotely? Or maybe he's able to open a developer tool in his browser and take a look at if an error occurs on the ajax request (if it's ajax uploaded). Oh, and there was an issue once where someone tried to upload images from a cloud directory or app, I think it turned out to be the problem. Anything is possible here. Good luck! Master of edits: Isn't he really trying to upload a 10mb jpg ro something very large?
  13. Welcome! This is not currently possible if I remember correctly. You have to drag it (move) to first position after uploading. If you hover the colored bar of the item on the far right side you see and "to top", "top bottom" buttons that can be handy to move from bottom to top.
  14. I think you just don't get it! If you're image field has a max of 2! images, the field returns an ARRAY, EVEN IF only 1 images is uploaded. So you have to threat it as an array. Hence the example of using $item->product_shot->first()->url. Will return the url of the first image in stack, EVEN IF there's only 1 image uploaded. You can also use $item->product_shot->eq(1)->url; to retrieve the second one. And so on. Hope that helps
  15. ($item->product_shot} return array, maybe stringyfied.. {$item->product_shot->url} because it's an array and the image not accessed using first() or any index but the field itself, it returns the path to the page asset folder.
  16. Soma

    velokurier.com

    As I said it won't work cause it's barely done using animte at all. Regarding CSS3 Animations there's also some things to consider which would make things impossible here when wanting to extend functionality: You can't stop an animation that's already running. You get no feedback as to how the animation is running - only an event callback once it has completed. There's no way to synchronize multiple animations. There's no way to specify custom easing functions. (although there is now easing for webkit)
  17. Soma

    velokurier.com

    Thanks MMD. I know, but I'm using a jquery plugin to do the parallax animations + sprite frame animations events etc. And this was done almost a year ago where css animation weren't yet hardware accelerated and not many libs around that matter. Sure there is alternatives but don't want to go as far redoing everything now as it runs pretty well and smoth already. Maybe something to look again at alternatives when I have time. Edit: Also transform js or the other jquery plugs don't work here, as it's not all done simply using animate.
  18. Thanks for posting it. Though that's something that usually is set in the http.conf defining the web.
  19. Soma

    velokurier.com

    Thanks guys! Funny stuff I just realized that after the last change I did, that I forgot to add something when there's no cookie set (so first time visit), must been distracted. Well I know I should have tested but didn't. So thanks for mention it guys. It's now fixed. Not sure about loading time, but the images (pngs) are already as optimized, and as small as it can get. I'm not sure it really was what you Pete experienced, though as you mention I wanted to implement a preloaded but was holding me back. Think it's time to implement it. You're right the ctrl+1 might causing issues to show the slider (which also depends ont he browser but you'll have an regular textfield and it works. Nothing too serious just having fun as I always do. I might set the combo to alt+ctrl+1 or something? And there's nothing wrong it shows underneath the header, haven't really put much thoughts into it, it was still there from the beginning. The animation was fun to do. I used Cinema4D to build a puppet using body parts (like a billboard) and animated through inverse kinematic, so just rotating the foots around the pedals and the rest will follow. So rendering every frame out as pictures, dada I got the sprite animation, which was really rewarding seeing it work. The parallax background was done by creating layers in photoshop and made them tileable, which took a little time to find the right fotos and bits to make it work and not look too strange. I love this forum! Hehe, have also tried -20000?
  20. Soma

    velokurier.com

    Hehe, not strange that's what we all do sometimes. Glad you like it, I also watched it for hours I think. PS: Don't tell anybody, I activated my, during developement, present and made an eastern egg. Press ctrl+1 Not sure it works in every browser/system though.
  21. If you install it and change the class name you'll have a problem. And I noticed if you change autoload option wehn already installed I sometimes had to reinstall so it really gets saved in DB. Other than that you can just make changes without doing something, add new methods etc. If you would provide the error it throws and some more details what your code looks like it would be easier to help.
  22. I don't see any error on your screenshot, only notices and warnings. May because debug enabled? Wanze you don't have debug on?
  23. You should get into modules pretty soon! They're easy as pie and powerful! PS: Glad to hear it worked out, thanks for mention it.
  24. Not sure what exactly you're doing but you could create a modules that is autoloaded and provides functions to use everywhere in PW. Something like this: class HelpersModule extends WireData implements Module { /** * getModuleInfo is a module required by all modules to tell ProcessWire about them * * @return array * */ public static function getModuleInfo() { return array( 'title' => 'Helper Functions', 'version' => 100, 'summary' => '', 'href' => '', 'singular' => true, 'autoload' => true ); } public function init() { $this->setFuel("helpers", $this); } public function getPosts() { return wire("pages")->get("/posts/")->children(); } } Then you can do in your templates: $posts = $helpers->getPosts(); There's variations of this but it should be simple to do. Also you could also make it not autoload and load it on demand. $helpers = $modules->get("HelpersModule"); // load module $posts = $helpers->getPosts(); Edit: wow everytime I edit the post the indentation get lost, that's new to me and pretty annoying...
×
×
  • Create New...