Jump to content


  • Posts

  • Joined

  • Last visited

Everything posted by Mackski

  1. This seems ommit certain fields, eg: $fields = array( 'url', 'title', 'description_info', 'summary', 'additional_info', 'hero', 'images' ); $parent = $pages->get($child->parent_castle->id); foreach($fields as $k) { if($child->$k) { $parent->$k = $child->$k; } } return $parent; From the code above, only the fields: title, description_info and summary are copied from the source to destination page. How do I go about copying the url, hero and images fields? The later two are images types obviously. EDIT: Setting $child->of(false); and $parent->of(false) allows images to be copied. now only the url will not work.
  2. Is there a way to apply the autoRotation setting to images uploaded in the backend? AFAIK the imageSizerOptions only apply to images on the front end. Please correct me if I'm wrong.
  3. Found the answer here: https://processwire.com/talk/topic/2357-image-upload-gettings-stuck-on-100/?p=22881 Looks like the hosting provide may have updated some modules (mod_security) which causes the HTML5 uploader to fail. Strange one indeed!
  4. So this all of sudden happened to one my sites running 2.4 stable. After uploading images progress is stuck on 100%, no matter what size image. Plenty of disk space, as far as I can tell nothing in terms of service configuration has changed. Response from POST is: <html><head><title>Request Rejected</title></head><body>The requested URL was rejected. Please consult with your administrator.<br><br>Your support ID is: 2783598957764282519 and provide steps to replicate the issue</body></html> Firebug reports: Really hoping this is something simple ;(
  5. Check your schema in FieldTypeImageExtra.module? eg: public function getDatabaseSchema(Field $field) { $schema = parent::getDatabaseSchema($field); unset($schema['description']); $schema['data'] = 'varchar(255) NOT NULL'; $schema['title'] = "varchar(1024) NOT NULL"; $schema['description'] = "text NOT NULL"; $schema['link'] = 'int(11) NOT NULL'; $schema['keys']['title'] = 'FULLTEXT KEY title (title)'; $schema['keys']['description'] = 'FULLTEXT KEY description (description)'; return $schema; }
  6. Hi Pete, however InputfieldButton.module indicates otherwise: public function ___render() { $href = $this->attr('href'); if($href) $this->attr('href', ''); $out = parent::___render(); if($href) { $out = trim($out); $out = "<a href='$href'>$out</a>"; $this->attr('href', $href); } return $out; } This is the only reason I used the code in this way. To explain further, I wanted to append some custom buttons, with custom actions in the page edit form. Rather than create a new inputfield for a custom anchor, I just utilize the button.module. As you state, it's not a role of the button to achieve this. Just wondering why it's part of the core?
  7. I recently had an issue with email being sent twice, although the code was only being executed once. Turns out, the default method of wrapping a button in a <a> tag causes Firefox to abort the first request which subsequently fires off my email function, after which returning a 200 which fires it again. As far as I know, IE may not like the wrapping of a button in an anchor (although this is un-tested) Here is the offending code being used: $href = $this->config->urls->admin.'page/edit/?id='.$this->input->get->id.'&email_client=true'; $field = $this->modules->get('InputfieldButton'); $field->attr('id+name', 'email_client'); $field->attr('class', $field->class); $field->attr('value', 'Email Client'); $field->attr('href',$href); The work around is to not wrap the button in an anchor, rather use javascript onclick. $href = 'window.location.href="'.$this->config->urls->admin.'page/edit/?id='.$this->input->get->id.'&email_client=true"'; $field->attr('onclick',$href); Hope this helps someone in the future.
  8. I find the face slapping technique only works AFTER you've answered your own question. Shame there is no emote for that
  9. [sOLVED] - Slaps face - Delete cache.
  10. This is my first site with 2.4, everything working fine locally, but my staging version is missing these two essentials: <script type='text/javascript' src='/wire/modules/Jquery/JqueryCore/JqueryCore.js?v=183'></script> <script type='text/javascript' src='/wire/modules/Jquery/JqueryUI/JqueryUI.js?v=193'></script> A bit stumped at this stage as to why the modules are not loading. The host is running 5.3.8 but according to this post it should still run: http://processwire.com/talk/topic/5543-processwire-24-possible-to-run-on-php-533/ Any ideas why the modules are not loading?
  11. Suppose on my tempate, I have a user, which is a page field selected the user access list (user->name). I want to be able to display this user name as part of the page list. As far as I can see, there is no function to do this, ie: List of fields to display in the admin page list user->name - title - status This could apply for any page field within the template, I might want to show a linked category in my page list: category->title - title - status Answered by me, now I just feel stupid. Might help anyone else facing the same. Selectors similar to repeater fields work in this instance. eg: user.name - title - category.status Ryan, maybe changing the description in admin would be enough to explain this. Eg: Enter one or more field names assigned to this template to display in the admin Page List when listing pages using this template. If left blank, the fields specified on the ProcessPageList module configuration will be used instead. Field names should be separated by a space and/or comma. Page fields can be selected using a period. ie: "user.name". Blank fields will be ignored.
  12. If you really must have this available to the site admin, add this to the TinyMCE valid elements on your field: ,iframe[src|title|width|height|allowfullscreen|frameborder]
  13. Mac mini @ home for design and coding, Ubuntu running XBMC (so I can glance over my shoulder from time to time and change my seating position) and Windows PC in the office. All bases covered.
  14. Slice would work. I take it that is not part of the core. I had a quick look through the source.
  15. A change log would be handy, I've upgraded one site and tweaked an admin theme, but it would good to know exactly what muscle we can flex under the hood.
  16. Thanks Soma, I guess adding a chunk() would save a few keystrokes.
  17. I tend to chunk images quite often for <table> elements in emails, pdfs and other layouts. array_chunk($page->images) does not work, it would be great if there was a method to chunk your images. eg: foreach($images->chunk(4) as $chunk) { foreach($chunk as $img) { echo $img->url; } } I might be over thinking it, but I currently have to manually chunk like: $x = 0; $c = 0; foreach($stage->images as $i) { $chunks[$c][] = $i; if($x > 2) { $c++; $x = 0; } else { $x++; } }
  18. I have to agree with Peter here, ProcessWire just seems to fit better in my workflow than any other CMS tp date. (and I've tried a few). As for kids, you guys have a head start.. When my 9 year old asked what I do, instead of: "Daddy builds websites.. " it should will be: "Daddy works with ProcessWire..."
  19. Although from a security standpoint this isn't a good solution. I have a requirement where once a user has activated their account via the usual email / activation link, that they automatically be logged into the system. So I need to find a user, then log them in using their ID, as their password is encrypted. Without duplicating and modifying: Session.php -> public function ___login($name, $pass) Is there another way to accomplish this?
  20. Thanks Martijn, I did not know that method exists, happy now I can clean up my code...
  21. Not an ideal solution, I ended up renaming the files on upload and append my sorting order on each file name before saving. ie: {sort_order}_{page->id}.{extension} Based on this post: http://processwire.com/talk/topic/206-renaming-uploaded-files-from-tmp-name/
  22. Does it not make sense to expose the sort field via the API? Front end example would be drag and drop sorting of user uploaded images. Having this order saved and mirrored in PW Admin would be ideal.
  23. I'm uploading multiple images via the API. Is there a way to explicitly set the sort order once uploaded? eg: something like this would be handy: foreach($files as $order => $f) { $p->images->add($f)->sort($order); }
  24. I've managed to modified the original module to include a InputfieldPageListSelect. Probably not good for large amounts of images due to the ajax calls. However for my purposes, a hero slider to link items, it works fine. In template: <a href="<?php echo $pages->get($img->link)->url?>"> FieldtypeImageExtra-PageListSelect.zip
  • Create New...