-
Posts
4,632 -
Joined
-
Last visited
-
Days Won
55
Everything posted by apeisa
-
I ended up with exactly same method - I tested and did had submodules working, but I really didn't find any benefit from those over symlinks. So that is probably just because pw works well with symlinks.
-
I think it depends how dynamic it will be. If you need a lot of .css then I would just make module which reads and writes css files. If you need to set few css rules like change bg image or stuff like that, then I would use inline css.
-
That is great Ryan. Don't let us lose your focus from big things. These are also things that community can surely help.
-
Tested this little bit more. It actually falls back to current date, if that is set ("If checked, this field will hold the current date when no value is entered."). Great to know that language support has dates covered, great news!
-
Just tested myself and nothing out of ordinary. Must be something on your install. I am running the very latest version of PW 2.1. What comes to save page problem: maybe best solution would be instead of cloning the button element, just create span element with the same looks and give that click event which submits the form.
-
Few more issues with current implementation: If you add date in wrong format, after saving it says But silently keeps the old value. Also php format values (like: j.n.Y H:i) doesn't say anything for normal people (ie. non-coders), so I would leave those out. I actually would like to see some predefined solution here. Or maybe some kind of "hybrid", like Zoho invoicing has:
-
Yes, those are great! I think HelperFieldLinks works fine as a module (if superuser is also content editor, then it does pollute the edit page view - so not good by default - though I myself enjoy using it), but dropdowns are something I would like to see implemented in default admin too. Maybe Soma you could do some forking and add pull request?
-
vknt: I agree. Small but great improvements for site builders. Example 1: I think that the reason that this isn't implemented is that it uses AsmSelect field there, and that doesn't support links. But I would prefer even an "ugly" solution, like alphabetical list of fields with links to them, under field ordering. Example 2: I have had this annoyance also many times. Very frustrating when you believe that you have removed all the pages, but you have forgotten to empty the trash... Also - dropdowns for setup and access tabs for main theme would be nice. After I got image cropping done, I hope I find time for these. Shouldn't be big things - but want to hear about everyone's opinion and other ideas for implementation?
-
This topic has been moved to Wishlist & Roadmap. [iurl]http://processwire.com/talk/index.php?topic=659.0[/iurl]
-
Ok, I have made good progress here. And as always, when you start implementing something simple, you want something more. So instead of single cropping value, I want ahead and implemented the way that you can add multiple dimensions. Now you can set in your image field's input tab all the different cropping settings you want (currently in csv), like this: Tiny thumb,60,60 Bigger thumb,200,200 Portrait image,150,200 That gives you corresponding links in your edit page view. Clicking that tilte (ie. "Portrait image") gives you this view in modal, so it is very easy to get just the right cropping. This is also what I have implemented so far. But now that I allow multiple croppings, I am considering the implementation. Instead of saving cropping values in db and do cropping on runtime (if not done before), wouldn't it be easier to just do cropping as is, and save the image with cropped suffix. So if my image file is image.jpg, and then I crop it, it would be saved like this: image.portrait-image.jpg And in templates usage would be something like this: <?php $images = $page->images; $portrait = $images->eq(0)->getCrop('Portrait image'); echo "<img src='$portrait->url' />"; If there isn't required file (image.portrait-image.jpg in this case), it will create one using pw's default cropping (center). Just got this idea, but I think that is much simpler solution than the one I was heading to... What do you guys think?
-
It should be there. I'm not near computer now, but it might require that you set manage access true.
-
Actually my work in progress Data Import does work with any JSON you throw at it: https://github.com/apeisa/ProcessDataImport So you could easily use YQL to generate JSON feed for you, and then use Data Import to import those values to your pages. Data Import does need some work though (title needs to be unique - no way to combine values etc), but in simple tests it always works. Note though: JSON works always, XML has some problems. Not sure if you meant something deeper integration between YQL and PW? Something like where you could build those queries from PW admin?
-
Yep, that works! Does it mean here is bug or something strange - or is it required to use that in some scenarios?
-
Not errors at all, but nothing gets saved. Actually if I try to save just the description, it fails also. But $img has right image, since I can use $img->url etc. My field_cropimages is like this: pages_id int(10) data varchar(255) sort int(10) description text crop varchar(60) And images saved through admin will have values like this: 1001 penguins.jpg 1 0,0,0,0,0,0 Now I have tried to save only description, to make sure problem isn't in how I handle the sleepvalue (currently I have your example code). Here is my current code on my processmodule executeSave: $page = wire('pages')->get($pages_id); $img = $page->{$field}->get("$filename"); echo $img->url; // This works $img->description = "Why don't you save me?"; // Nope, description doesn't get saved $page->title = "New page title"; // This also get saved $page->save(); // No errors at all, using debug mode
-
Thanks ryan! I actually got that part pretty well handled (well, my code was obviously messier than yours so took yours as a new starting point). Yes, I have extended FieldtypeFile here. What is causing me problems is dealing and saving individual Pagefile. This is where I try set $img->crop value and save it. <?php $img = wire('pages')->get($pages_id)->{$field}->get("$filename"); // Just realized that individual files are also wirearrays, clever! $img->crop = $crop; // Values in array, since sleepvalue expects an array wire('pages')->get($pages_id)->save(); If I try to save the field or pagefile alone it gives me error - now when I try to save the whole page the crop value doesn't get saved.
-
I started working on simple cropping tool for pw (will be open sourced and sponsored by stillmovingdesign). I decided to implement new fieldtype (FieldtypeCropImage), but of course if this is solid stuff maybe we may integrate this to core image field. New fieldtype is because I needed to add new column to db table to save cropping data. I was thinking about two other routes also: direct editing of files (which would require two fields and duplicating images) and totally independent module which would have own table where cropping data is saved. Also this has companion module (ProcessImageEditor) which will allow cropping (and later maybe other editing also). I had very good start but now I have few questions (surprise ). I have now page like this: /processwire/image-editor/?filename=myimage.jpg&pages_id=1001 With those get vars I get my image url easily and allows me to handle cropping on the front end. But how about saving that cropping data back to database (I have new column "cropping" there, where I would like to save these values as JSON object): x1, y1, x2, y2, w, h. I am having little difficulties to save just one image (and only those cropping values). What I am trying to do is something like this (in pseudo): $img = $field_images->get('filename=myimage.jpg'); $img->cropping = $json_values; $img->save() // or $field_images->save(); Hopely I make at least some sense here I am using jCrop here and it looks like this will be cool tool! Thanks Martin for making this possible (and Ryan )
-
This can be made through PW admin - just edit the field where you have tinyMCE inputfield, then under Input tab there is "TinyMCE Advanced Configuration Options" label and under that there is "Valid elements". Remove img[width,height] or just replace everything with this: @[id|class],a[href|target|name],strong/b,em/i,br,img[src|id|class|alt],ul,ol,li,p[class],h2,h3,h4,blockquote,-p,-table[border=0|cellspacing|cellpadding|width|frame|rules|height|align|summary|bgcolor|background|bordercolor],-tr[rowspan|width|height|align|valign|bgcolor|background|bordercolor],tbody,thead,tfoot,#td[colspan|rowspan|width|height|align|valign|bgcolor|background|bordercolor|scope],#th[colspan|rowspan|width|height|align|valign|scope],code,pre
-
I am adding new field to a template, but would love to have it under settings tab when editing page, instead of content or custom tab.
-
Ahh.. I actually totally misunderstood that quote from Ryan What I need to do is to add new fields to settings tab. Is that currently possible? EDIT: And thanks and [applaud] Soma! You are so helpful that I am beginning to think your help as granted...
-
How to do this from API? Need this in one module I am building.
-
I just edited the TinyMCE settings and removed width and height from valid elements (input tab). I left img like this: img[src|id|class|alt] EDIT: There is much better solution than this. Just leave width and height intact and use max-width: 100%, height: auto on your css. More info here:
-
Thanks soma, I think we will settle with same solution.
-
Any news about this? We also got case where we need client friendly way to choose custom classes, like <div class="notice">This will get some styling</div>. I quickly took a look and it seems this is something that would be easiest to do in core. Or maybe extending the tinymce inputfield..?
-
Actually I think that we should disable possibility to use compatibility mode. What it does is that it uses IE6 rendering mode (and well.. with few extra quirks). It shouldn't have any effect in this issue - but since it is IE we are speaking of - I am not sure (and not able to test currently). This metatag should use latest IE rendering available (in browser used): <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> It also forces Chrome frame if that is installed. And it should be something that everyone can install without administrative rights: http://code.google.com/chrome/chromeframe/ So maybe good support might be IE9+ and earlier IE versions with chrome frame (although should be tested...).
-
Well - I have had very few issues with IE9 ever. It is ok browser and IE 10 seems to be a very good browser. So I would draw the line to IE9. There is very little differences between IE7 and IE8, so I agree with you that supporting IE8 doesn't make much sense... Sad thing is that 8 is latest IE that has Windows XP support, so it will live long...