-
Posts
6,648 -
Joined
-
Last visited
-
Days Won
365
Everything posted by bernhard
-
hi @Macrura thank you for your efforts on this. it's similar to what i was up to do on my own. do you think it would be possible and not too much effort to have doc-pages available via urlsegments? the problem with the # tags is, that it does not work in panels. or at least i don't know how it would be nice to be able to link to the docs via links like this: <a href="/admin/setup/admin-help/myhelptopic?modal=panel" class="pw-panel">help for myhelptopic</a>
-
thank you @Robin S and @tpr - the last update fixed my repeater-image-problem
-
sorry for my late reply! your fix didn't work for me. curious if it helps vmo...
-
$pageimage->maxSize() not working as described?
bernhard replied to Robin S's topic in API & Templates
i came across this issue on PW 3.0.63 i did some testing and it seems that this issue is not fixed with @Zeka s solution. it is still not working for squared images! see this tests: i changed the function to @Robin S suggested fix and it works: /** * Return an image no larger than the given width and height * * #pw-group-resize-and-crop * * @param int $width Max allowed width * @param int $height Max allowed height * @param array $options See `Pageimage::size()` method for options * @return Pageimage * */ public function maxSize($width, $height, $options = array()) { $defaults = array( 'upscaling' => false, 'cropping' => false ); $options = array_merge($defaults, $options); return $this->size($width, $height, $options); } works also with smaller images using upscaling => true and cropping => true -
PW 3.0.63: Client-side image resize support
bernhard replied to ryan's topic in News & Announcements
hi falk, the settings should be fine - actually you would not have to change anything after updating an old installation. do you have any other modules installed? try with a clean installation first. for example i had a problem with uploads recently because of a 3rd party module... good luck -
thanks for your answer. i tried it on a fresh install on my local dev and had the same issue. i created a zip of the installation so you can try: https://transfer.sh/eAZ7L/reptest.zip (8,5MB) admin url /processwire admin admin! test tprtest1!
-
hi @tpr i just found a bug when using latest version of AOS (just did the update from 1.4.1 to 1.4.6). it also existed in the later version. i have a repeater including an image field and an "editor" role with edit-access for the home-template (and all children). the problem is that the image in the repeater field gets uploaded and after reaching 100% disappears. i did some debugging and i found out the following: aos uninstalled: works aos installed: does not work (either enabled or disabled) upload as superuser works at all setups ajax error after fileupload: {"error":false,"message":"The requested process does not exist"} when i try to edit the repeater item directly ( /admin/page/edit/?id=1024&InputfieldFileAjax=1 ) in the admin i get this error: i hope i was clear enough with my informations so that you can fix this as easy as possible if you need more information just let me know! PS: regular image fields outside repeaters work as expected
-
PW 3.0.63: Client-side image resize support
bernhard replied to ryan's topic in News & Announcements
interesting... i just tried it with a phone of my friend, same result... both android and chrome my phone: android 6.0 + chrome his phone: android 6.0.1 + chrome will do some more testing soon -
PW 3.0.63: Client-side image resize support
bernhard replied to ryan's topic in News & Announcements
hi ryan, first let me say thank you for that great addition!! it's always impressive how you not only integrate existing solutions but also improve them first tries on my laptop went very well. on my android phone i got this problem: original image: resize settings: resized on laptop (chrome): resized on android phone: any ideas what could happen here? i thought it might be better to post here than opening a github issue - maybe others could also try and share their results? -
awesome Looks really interesting! I'm impressed with how far you've taken this already. Is this a fairly common need? (chunked uploads). I'm not sure I've come across a case where I would have used this on a site before, but I imagine there are cases this could be a real life saver. i think this would be a great addition as well and would like to support lostkobrakai here. i already stumbled over this problem here: and it came up some other times as well: i ended up needing my client to upload everything via FTP or dropbox and pasting the links into a textfield. i wanted to develop a module that scans the directory and adds the files automatically to a file field but all of this is a really bad solution regarding UX. i almost had to build a video-platform once where this would also have been a very welcome feature. otherwise i would have had to use some 3rd party uploader with all the problems (different design, maybe opening security holes, ...). especially regarding security i would feel much more comfortable when having a built in solution rather than adding any 3rd party hack... ps: it may not be a very common need, but it can be a fundamental one
-
Hi @ryan thanks as always for your work and all the progress! may i ask about one special feature here that lots of us are waiting for since < 2016 and that was on the roadmap of 2016 and 2017 and still there are no news about it... I'm talking about client side image resizing... Roadmap 2016 Roadmap 2017 Please don't get me wrong - the intention of this posting is really not to point to you with my fingers (like "but you said you will do that..."). and of course, i could have tried to implement it on my own... but i'm not sure how much sense that would make. first of all, since it is on the roadmap for such a long time, it is risky to put effort in something that maybe solved by the core one week later and likely much better. secondly i'm not that familiar to javascript and last but not least, i think this should really be built into the core image field because i think that is a main feature of a content management software! if you don't think that you can make that happen soon it would be nice to know. maybe we could find someone in the forum that has the abilities to do it. i would also be happy to sponsor development, or at least a part, if someone else would be willing to join. ps: i know that we already have media manager and jquery file upload, but i don't think that this is a good solution. processwire is so easy and flexible in almost all situations that it just feels too bad to not being able to just put an imagefield on one template and make the client upload several large images and display them as a gallery... would really be happy to hear your opinion about that and of course, also the opinion of all the others
-
great job! i already did a calendar using https://fullcalendar.io/ but without recurring events (thats a lot more difficult do implement and i see you also had to set a hard max of 2800 so far...). i guess you can count me to your customers before end of may 1) is the calendar custom css? can it easily be adopted to other styles/themes? 2) is there drag&drop support for events? i build this on fullcalendar+pw. but it's not a must have...
-
you can just create a config-dev.php on your dev and pw will use this one (only if it is present, so you just have to make sure it does not get uploaded to your live site). interesting link. I'm thinking about this topic for quite some time and came up with this approach: but i think the most solid approach is to use the api (like the migrations module does or like i showed in the last posting). would be interested in your experiences though
-
hi thor, if you copy over your files and database you will have an exact copy. only thing you would maybe have to change is the settings in /site/config.php (database settings, if you have different ones at dev and live). the only problem would be that you overwrite the data of the live website's database. for example if you had some user input while developing on your dev and then you upload your dev-db to your live-db you would lose this data. that's been discussed several times before (because it can be a littly tricky). see or migrations module: https://modules.processwire.com/modules/migrations/ https://processwire.com/blog/posts/introduction-migrations-module/
-
Loop through an image field on various pages as one selector
bernhard replied to a-ok's topic in General Support
i didn't realize this part of his message and so i was totally confused by the posting of course you can loop over the returned array of images but not over the FIELD in a setup like he posted ( like $pagearray->fieldname ) maybe some selectors like this would be possible in your case? @oma -
Loop through an image field on various pages as one selector
bernhard replied to a-ok's topic in General Support
I don't understand your question and maybe the others didn't as well because there is no answer so far... You cannot loop over an image field. You can loop over a pagearray and that's what you are doing. And you already have only one selector... Maybe you can use ->each() but that's quite the same, only shorter.. -
Interesting, have to check my version because I also have image upload problems in one recent project. Is it related to images in repeaters in your case?
-
I edited my post above. Sure you can have multiple super users but it also happened to me that I forgot the name of the initial admin and I had to find out in the database... User id 41 can be very handy to know in those cases
-
Great tutorial Ben! $users->get(41) will always be the superuser It could even be a oneliner: $users->get(41)->setAndSave('password', 'mynewpassword'); But for tutorials it's sometimes better to be more verbose, so I would maybe show both ways.
-
how to transform page selectors into sql queries?
bernhard replied to bernhard's topic in General Support
yes, that was the reason for my question i already have a query and it works well. it creates a db-view of all my data and then i can run an efficient query on this view easily without joining everything again manually. i think your pagefinder example code will save me some time next time together with tracy console panel -
how to transform page selectors into sql queries?
bernhard replied to bernhard's topic in General Support
hmmm thank you lostkobrakai for the quick response! i think my topic title was misleading... the problem is, that i have multiple queries in a foreach that i need to transform into a single sql query: $invoices = []; foreach($pages->find('template=invoice') as $item) { $invoices[] = [ 'num' => $item->id, 'client' => $item->client->title, 'net' => $item->getNet(), 'gross' => $item->getGross(), ]; } // output table of all invoice num | client | net | gross | --------------------------------------- 01 | john doe | 100 | 120 | 02 | max muster | 200 | 240 | getNet and getGross would be themselves a method like this looping all pagetable items: $sum = 0; foreach($invoice->items as $item) $sum += $item->net; return $sum; in my case i built a database view with all invoiceitems so that i can select everything easily and build sums quickly via sql sum(net) and not a slow foreach() $sum+=... the problem is just that is was really not easy to do all the joins and find the right fields and join them etc. maybe your code example could have saved me some time... or maybe there is an even better way? thank you again for your help! -
hi all! in my recent project i needed to query the database directly because of some heave datatables calculations that where too slow via $pages->find() operation in a foreach. so far, so good - everything works fine now. but the query got quite complex, hard to setup and hard to read (maintain). the problem is that you have to join all the fields to get all fields of one template. and this join operations can get quite confusing when you have lots of fields. any hints how i could simplify this setup?
-
never mind, the simplicity of processwire was a big hurdle for many of us in the beginning ...and i'm still curious what setup would need lots of repeaters for structuring everything. usually you can keep everything very clean just by using different templates, different parents in the tree and doing the relations via pagefields. don't get me wrong. it's just my experience that whenever something felt complex/complicated it was most of the times a problem of my (or other forum users) setup i wish you lots of happy aha-moments
-
you would not imagine how often i have thought that myself and then i found out how to do it the processwire-way and it just seemed too simple with something like a 3-liner "heavy use" of repeater sounds like you could maybe improve/change how you structured your content. in PW thats a very important part of your work. if you structure your project/data well, most of the time you end up with very simple and clean selector-calls like $pages->find('template=product'); // or $page->children('category=car'); of course that's just wild guesses, but if you want to share your setup i'm sure you'll get valuable feedback from lots of knowledable guys (and girls) here
-
hi novalex! great that you found a way just take care if you have a more complex setup and need some advanced selectors the repeater setup COULD be a problem (or a little harder). if you have 2 regular fields forename and surname a selector would be: $pages->find('forename=john, surname=doe'); if you have a repeater setup, it would be: $pages->find('yourgroup.forename=john, yourgroup.surname=doe'); as long as it is simple like this it will work, but i can remember that it can lead to problems but don't remember exactly... just keep in mind that it could be easier to have "duplicate" fields and simple selectors than the other way round