Jump to content

adrian

PW-Moderators
  • Posts

    11,091
  • Joined

  • Last visited

  • Days Won

    365

Everything posted by adrian

  1. Hey Ryan, Just started playing with this - looks very cool. Just a couple of things I noticed. CTRL/ALT+Z seems unreliable for undo. Edit > Undo from the browser menu seems ok still. This doesn't seem to be an issue with TinyMCE. Also, I don't seem to have a problem when using the demo on the CkEditor site, so not sure what the issue is. The other thing I noticed in the lack of ability to resize an image with the mouse. Seems like this option is not available (at least by default) with CKEditor, which is probably smart given that HTML resizing is a bad idea, but with PW's ability to actually resize the image on the server when resizing in the editor, it seems a shame that CK doesn't have this - can it be enabled?
  2. Ok, not really sure what to suggest now - might need someone morre experienced with PW to step in, but when you say you can save the page so long as you don't make any changes, are you sure the page is saving? Is the modified field being updated? Can you make any other changes to the page, like change the body or other simple field?
  3. Are you really wanting to do this: $page->htl_idiomas = $pages->get((int)$idioma_id); Don't you want to set htl_idiomas to the value of the checkbox from the post? This is something you might find quite helpful: http://processwire.com/talk/topic/59-module-want-form-builder/?p=11639 It shows you how to automatically generate a front-end form from an existing page's fields. This will probably take care of everything for you.
  4. I don't think "time_field" is valid. Does the following work as is? ie, does it change remove the unpublished status? $my_page = $pages->get($my_page_id); $my_page->setOutputFormatting(false); $my_page->removeStatus(Page::statusUnpublished); $my_page->save(); What does: echo $my_page->id return? Are you sure that $my_page_id is set correctly?
  5. Thanks Ryan, I have been trying to avoid using SQL directly in PW - just figured there was something in the API I was missing, but it seems that in some cases it will be more efficient.
  6. I haven't looked thoroughly through your code, but the one thing that stands out is that you are checking for posting of btn_submit and yet your submit button is not named as such. Try this: <input type="submit" value="submit" name="btn_submit" /> That should at least get your processing section to do its thing.
  7. Well it is all about variable scope. None of the PW variables (http://processwire.com/api/variables/) are available inside a php function. So you can use the wire function for any of those PW variables inside a function. If you're going to be using a variable more than once inside the function, it can be worth doing this at the top of the function: $input = wire('input'); and for any other PW variables you might need access to.
  8. Hey Alan, I think it is just that you need to use wire('input')-> when inside a function.
  9. Thank you both for those ideas - I didn't really know about the PageFinder class, but just did some more reading about it here (http://processwire.com/talk/topic/1227-lazy-loading-of-pages/?p=10907). Seems like that could come in handy for sure. I might also just start using SQL in cases like this.
  10. Thanks - I guess it's not a big deal to do it that way. I think I am just so used to using SQL to do most of the work first that the idea of returning so many results just to later throw them out seems weird
  11. Is this possible? I am trying to combine results of more than one $pages->find. I know I could append the results of one to the pagearray of the other, but I want to be able to apply a limit to the combined results of both, sorted by modified, before returning the results. Thanks
  12. Thanks diogo - a nice solution - I hadn't thought about the remove option. Only catch is that my find makes use of a limit selector. Obviously I can break the foreach loop after my limit requirement, but it will mean grabbing all the pages that match and then not using most of them in the foreach - just seems wasteful.
  13. Hi everyone, Trying to simply find pages where the modified date is greater than the created date. I would think this should work: $pages->find("modified>created"); but no luck. Thanks for any suggestions.
  14. Hi Soma - no worries - I know how you feel Basically what I am doing is creating a custom RSS feed and latest activity widget, but I only want to highlight details from certain sections of the site. I have some user edited pages, a user edited glossary, and a forum. These are the three parent pages. I ended up going with this which is a little ugly, but does the trick: $latest = $pages->find("sort=-modified, limit=30"); $items = new PageArray; foreach($latest as $lpage){ if(($lpage->rootParent=='1130' || $lpage->rootParent=='1192' || $lpage->rootParent=='1021') && ($lpage!='1130' && $lpage!='1192' && $lpage!='1021')){ $items->add($lpage); } } I actually might end up switching to a template selector as I think this will be cleaner and still achieve what I need.
  15. Hey Pete - yep, I was using proper page ID numbers. I actually just tested out a has_parent using the selector test tool, with multiple pipe-separated page IDs and found that it returns every page in my system including all admin/system pages. Each of the individual page IDs on their own work as expected.
  16. Thanks Soma, but using that in a find gives me array to string conversion errors. It does seem like has_parent can only be used with one page: http://processwire.com/talk/topic/1921-has-parent-issue/
  17. Thanks teppo, Just a note on that SQL command. The second one has: ON version_control_for_text_fields_id__data but it should just be: ON version_control_for_text_fields__data
  18. Yep, that would do it. I am still not quite always thinking in PW yet I was initially setting it up as: $latest = $pages->find("rootParent=xxx, sort=-modified, limit=10"), but in reality I want to specify more than one rootParent, so I would need the ability for "get" or "find"ing more than one anyway, which isn't possible - correct?
  19. I was hoping there would be a selector called rootParent. I ended up getting all the pages that matched the rest of my selectors and then filtered them out with $page->rootParent in the foreach loop. This isn't a bad option, but causes problems when using limit in the initial selector set. Anyway, just wondering if there is a better way to do this, or if rootParent could be added as a selector. Maybe the template selector is a cleaner solution in most cases?
  20. Hi Soma - thanks, checking for the original size of the image is definitely an option. I do think though that the upscaling=>false option should work with one dimension set to 0. However, this also seems to work: $options = array('upscaling'=>false,'cropping'=>false,'quality'=>90); $image->size(500,'',$options); As does this, which is maybe the most logical option: $options = array('upscaling'=>false,'cropping'=>false,'quality'=>90); $image->width(500,$options);
  21. Sorry for the confusion teppo - I thought I was on the very latest version, but apparently I was one or so behind. All working again - thanks!
  22. teppo - not sure if you want issues listed here or on github, but with the new version I am getting this error: "Method VersionControlForTextFields::removeExcessRows does not exist or is not callable in this context" Reverting to old version fixed it.
  23. Ryan, My goal in this case is to make sure that the images being displayed are go greater than 500px wide. I don't care about the height, so I set it to '0'. What I want to make sure is that no image gets upscaled to 500 if its actual dimensions are less, which I think in most cases would be default behavior due to the quality issues associated with upscaling. One of the test images I uploaded with 175px (w) by 297px (h) and it was upscaled to 500px. Setting things to 500,500 seemed to take care of things. I assumed that the values were maximum dimensions for each, rather than crop, but I get the feeling now that maybe this is not the case. I have been using SLIR for image resizing for several years and I am used to that behavior. Is that approach possible with PW - ie to set both dimensions as max for the respective dimension, rather than assuming a crop. Does that make sense?
  24. Curious - did you start getting front end errors after your login attempt? I came across some weirdness like this the other day making my first PW site live. Both dev and live are on the same server, so in my case I think it was a caching issue - an apache restart did the trick. Might be worth trying as a quick fix. Otherwise, it does look potentially like you have some path issues.
  25. You could probably just add $image = ''; as the first thing inside the foreach so it gets emptied. You might need to do the same with $thumb
×
×
  • Create New...