Jump to content

adrian

PW-Moderators
  • Posts

    10,784
  • Joined

  • Last visited

  • Days Won

    346

Everything posted by adrian

  1. A post from Ryan that I think is relevant here: http://processwire.com/talk/topic/4442-pw-performance-with-hundreds-of-fields/?p=43643 I have a similar dilemma coming up and I think I will end up going with a custom fieldtype because it will allow the flexibility of a custom database table structure while still being able to use the PW API effectively. Keep in mind that I have been developing with PW for 6 months and this is the first time I have wanted to go this route - generally PW's fields and pages do a great job. Every now and then I have had to use an SQL query and there are a few examples of how to do that here in the forum. http://processwire.com/talk/topic/1684-reading-and-displaying-data-from-a-custom-table/ http://processwire.com/talk/topic/669-using-a-secondary-database/
  2. Try this: http://processwire.com/talk/topic/4383-how-to-set-language-active-via-api/?p=42953 or the post below it from Soma. Also, check you variable scope. I see you are using wire('languages'). Do you also need to use wire('page')?
  3. There is a forgot/reset password module: http://modules.processwire.com/modules/process-forgot-password/ For front end, this code should get you started: http://processwire.com/talk/topic/1716-integrating-a-member-visitor-login-form/?p=15919
  4. Ok, I tracked down the problem. You would need to also edit this line to allow @: https://github.com/ryancramerdesign/ProcessWire/blob/master/wire/core/Upload.php#L200 (or "WireUpload.php if you are using the dev version) If you do that along with the change I mentioned above in this line: https://github.com/ryancramerdesign/ProcessWire/blob/a8024bb49785370aa2e3867bd683094663cfeabf/wire/core/Pagefiles.php#L264 it will let the @ go through. Of course editing the core files is not recommended!
  5. I can replicate this using the latest dev from a couple of days ago.
  6. I agree - I try to avoid giving clients the need / option to embed images in an RTE, but sometimes I don't have much choice
  7. Hey horst - I guess I am a bit confused about how the img tag is being generated. I just looked at Joe's code again and see that he is not replacing existing width and height attributes, but inserting them regardless. What if they are already in the img tag? Tinymce is producing the tag in this format <img src width height />. In CkEditor it actually looks like it is not adding the width and height at all. Not sure if this is a bug in PW's enhancement of the insert image, or a problem in CK itself. Either way, if you are relying on code generated by an RTE, I don't think you can assume that there will be no width/height or the placement of them in the tag. Maybe I am not understanding how the img tag is being generated in the first place
  8. Just a side note, I think you will likely run into trouble with a str_replace in this situation. What if the src or a class is straight after img instead (eg <img src="" width=""). You should use a regex or domdocument to make sure it is more robust. Here is a bit of a writeup on how to do it: http://techpad.co.uk/content.php?sid=81
  9. Hey Peter, I am assuming you have seen this: http://docs.rackspace.com/loadbalancers/api/v1.0/clb-devguide/content/Manage_Session_Persistence-d1e3733.html I haven't really read it properly, but it mentions several of the key things you just brought up.
  10. Sorry if my "solution" isn't cutting it - it is working perfectly in my scenario, but I guess I haven't thought it through for all use cases. Sorry for any confusion
  11. Hi again Ryan, I attached a draft of the module I am working on. It works, but at the moment still requires that I make setFilename hookable. And it also suffers from the fact that this is hook is triggered on page saving, as well as file upload. I thought about going with InputfieldFile::fileAdded, but that has the problem of not renaming until the page has saved and of course would cause problems with immediate embedding in an RTE before page save, among others. If you test it you'll see that in the module config options you can limit the module to specific templates and pages (and their children). You can also define the format you want to use for naming files using something like: mysite-{$page->path}-{$page->id} or anything you want really! I would also like to add the ability to define different formatting options on a field by field basis. The problem is that I can't figure out how to get the current field when hooking into Pagefile - any hints? I was thinking that maybe a better approach would be to make this module an alternate Inputfield type that could be selected from the field's detail's tab. This would solve the per field formatting options. Maybe have a site/field-wide default format in the module config settings and a separate override format option in the field input settings. Will think about this some more. On reflection not sure this would be a good idea since it would mean it wouldn't be possible to use other Inputfield types, like Antti's cropimage for example. Any ideas? ProcessCustomUploadNames.module
  12. Another small update. Images now have "video-" prefixed to their filenames. This allows the images field to also store user uploaded images, in addition to the video images. When the module checks for videos that are no longer present on the page, it will no longer delete images that the user has uploaded, unless of course they happen to have "video-" in the filename as well. Hopefully this is a reasonable approach to this. Let me know if it causes anyone any problems and I'll revisit.
  13. adrian

    Hanna Code

    I really love rsnapshot: http://www.rsnapshot.org/ It is still command line and uses rsync, but handles all the incremental backup setup for you. Just setup and call from cron!
  14. Hey Soma, Is this the same as my issue at: http://processwire.com/talk/topic/383-module-import-pages-from-csv-file/?p=43443 I submitted a fix and pull request for that here: https://github.com/adrianbj/ImportPagesCSV/commit/ad4d9e71f844fe2e4c9162152177e119a403ef38 Although it sounds like you have something else going on with the $pageName as well.
  15. Hey Ryan, I am already so used to the fields and templates submenus - so much quicker getting things done! Small suggestion - do you think it would be too much to have an Add New item at the top of both those submenus? One other thing and this might make things messy, but I wonder would it would be like if it is was possible to select a template when creating a new field, so that as soon as you save the field, it gets added to the template automatically. Just an idea and maybe not a good one
  16. Hey Ryan, What am I missing with hooking into Pagefile::install ? I can't for the life of me get it to trigger. Is there anything special I need to do with this? EDIT: The only way I could manage to hook into Pagefile was by making setFilename hookable. It seems to be working fine like this, but if you get a chance, would you mind looking at this, as I think I must be missing something with install. Only catch seems to be that it gets triggered every time the page is saved, as well as when the file is initially uploaded - is that expected behavior?
  17. Is it just me, or is the "View" tab a little strange. I feel like this has been discussed before but couldn't easily find it. I just wonder if maybe it should be moved from its location next to the other options, and/or made to not look like a tab. At a minimum, I think it should open the page in a new browser tab so the user doesn't potentially lose their edits if they haven't saved yet. Maybe it's just me
  18. Hi Peter, I am using 5.6.13 without any problems!
  19. Really looking great - minimalistic, but without removing functionality - such a rare thing these days, I am impressed! Two comments for the moment - the field and template drilldowns are great but I wonder how functional they will be on a site with a lot of fields - it might be become to unwieldy to be useful - not sure if it should be configurable so it can be turned off or not. I also wonder whether there needs to be the ability to scroll within the div that contains the fields, rather than scrolling the entire page to get to the bottom of the list - maybe that will be messier? I think you actually just fixed the rounded corners issue, although I do think the css for the menu could still be tweaked a little - being very pedantic, the grey border that appears around the fields and templates items when you are viewing the sub items looks a little clunky - I think just keeping the background grey would be better. Also note that go from a fields/templates submenu back to its parent doesn't return the parent to the grey background. Also, maybe just a personal preference, but I'd rather see the submenus slightly offset, rather than slightly overlapping the main dropdown - just a little breathing space. A couple more minor things - I love the futura colors, but worry about the use of that much red - seems to me that it diminishes the use of red in error messages. I will also iterate one of Soma's earlier comments about too many colors - buttons in particular seem too colorful with many changes between states, including a red border when active but the mouse is no longer hovering. BTW, removing the title really is a great improvement - it's looking so clean now PS: Even though I said less colors, I would like to see a warning color (orange i guess) for appropriate messages like this one: ProcessTemplate: Pages using this template are not viewable because the template file - I see that there are different shades of green, so maybe that is ok? PPS: Any thoughts on making the "Add New" link a config option - I think on some sites this will be great, and on others perhaps confusing to certain users.
  20. Nik, This will fix the "There is no Thumb called" error: https://github.com/somatonic/PageListImageLabel/pull/1 I've leave Soma to answer the other part.
  21. Just a couple of related links, in case you haven't seen them: http://processwire.com/talk/topic/2700-new-pw-project-notification-and-approving-page-changes/ http://processwire.com/talk/topic/2024-page-draft-module-useful-to-anyone-please-feed-back/
  22. Hey arjen, I don't suppose you solved this did you - I have having the same issue - looking through the DB tables I am yet to find anything obviously different from a repeater created via the admin vs one created via the API - will keep looking, but am hoping you might already have the answer EDIT: always the way - as soon as you post, you figure it out - the entries are missing from the fieldgroups_fields table. Hopefully should be easy to sort out!
  23. Sorry Manol - I don't have formbuilder, so I really don't know how it works, but maybe this post from Soma might help: http://processwire.com/talk/topic/3105-create-pages-with-file-upload-field-via-api/?p=30979 EDIT: Speaking of the man himself
  24. I think your issue is not the hook, but rather the: $form->get("reconocimientos") It is not an object. I am not really very familiar with hooking in templates, but I just tested this and it works: <?php $page->addHookBefore('Page::loaded', null, 'errorTest'); function errorTest(HookEvent $e) { error_log('testhook'); } so I think you are on the right track, but you need to sort out your form object. Are you maybe using FormBuilder? or do you have $forms defined elsewhere in your code?
  25. nghi - don't bother - just grab the lastest dev version of PW - Ryan has implement toggling of grid and list views for images - very nice
×
×
  • Create New...