-
Posts
6,267 -
Joined
-
Last visited
-
Days Won
314
Everything posted by bernhard
-
How would that work in your opinion?
-
You can always add another field that you just populate on saveReady with the url/path of the image file and that will then be easily available for findRaw()
-
I'd like to hear the reason for that..
-
It's just a link to the docs, but maybe it's not so obvious for some that you can even use DDEV to share the project on your local network, so you (or hackers) can access the site from a mobile phone or any other device: https://ddev.readthedocs.io/en/latest/users/topics/sharing/#exposing-a-host-port-and-providing-a-direct-url ddev config --host-webserver-port=8080 --bind-all-interfaces Then ddev restart and then you can access your site locally at something like 192.168.1.2:1234 To find your local ip address you can use ifconfig | grep "inet " | grep -v 127.0.0.1 | awk '{print $2}'
-
Yeah I know that one of course but don't know how this works and would be thankful to get a pointer ?
-
I've just never had the need for it ? And can't remember I've seen it somewhere. But nice to know it's possible - maybe it will be helpful one day ?
-
Yes, of course. That was what you where asking for and what I was testing.
-
I thought pagination was not meant to work on the backend but I just tried and it seems to work just as expected. I didn't do any settings regarding url segments... https://github.com/baumrock/PaginationDemo
-
The latest site of the week reminded me of https://senderkataster.rtr.at/ that I built with a friend some time ago and that I want to share. Tech: ProcessWire (obviously) https://getuikit.com/ (also quite obvious ? ) https://tabulator.info/ for all kinds of filters https://leafletjs.com/ for the map https://basemap.at/ using an Open Government Data License Some GDAL command line magic to transform the overlay source data into PNGs that are stored in ProcessWire pages and can then be queried and correctly placed on the map. ProcessWire has been a great platform for that project! If you need help with a ProcessWire project that needs some geo-magic or powerful web maps drop me line ? I'm not responsible for the red background ? Show details of a tower Choose a program by name or type and show its radio coverage (not in the screenshot): Expert mode for nerds:
-
When toggling an Inputfield the whole row is toggled. I'm not sure if that is intended? Is that the same for you? What do you think? Should it be like this?
-
I'm also not saying there's only one way of doing it. I just tried to invite you to think out of the box and leave paths that you have been using in the past. That does not mean you should forget them of course, because as already said you can also use PW in a traditional database table way. It's just not the most common way I guess (which is a shame imho because PW can be a great platform not only for building websites but also as a framework). Thx, that's a very good example. What you could do here is to create two templates: "protocols" and "protocol" The "protocol" template would hold all the fields necessary for storing data for each protocol. That would be similar to all the columns needed when storing that in a DB table. For example: title, datetime, message For the "protocols" template it would be enough to have a single "title" field. Then you create the parent-child relationship on those templates. You set the allowed children of "protocols" to "protocol" and the allowed parents of "protocol" to "protocols". Then you create a new page in the page tree and choose "protocols" as template. You can set the title to whatever you want, eg "My shift protocols". Then go back to the page tree and add a page UNDER the just created protocols page. As only "protocol" pages are allowed as children you should only be able to add such a page here. Then you can populate all fields (title, datetime, message - which could be your ckeditor field) and save that page. --> You have created your first protocol entry, which would be similar to inserting a new row in the DB table in a usual database world. So that's an easy example of how you can approach such things. There are many benefits of doing it that way rather than doing everything by hand: You have a GUI for adding, editing, deleting etc. those entries. You can use all kinds of fields for adding "content" to your entries, for example it's extremely easy to add an images/files field to upload images/files. That would be very much work with plain PHP/MySQL Every "protocol" entry is a PW page and you can do all kinds of great things with it. For example you could create a template file for that page (/site/templates/protocol.php) and you would have a publicly available digital version of your entry. As PW is built apon the page-tree paradigm you don't need to create "routes" or "endpoints" - they are already there. Out of the box, as soon as you add the mentioned template file. So in our example we could access that entry under yoursite.com/my-shift-protocols/demo-entry (where the parts of the url are the names of the created pages and you could of course make them random or auto-increment or things like that). You can change some kinds of that GUI easily via GUI or via code. For example you could change the label of the "title" field to something like "Enter your name here". You have a great system for access control on a field level. You can hook into every single aspect of your GUI. No limits. Multi-Language? Yep, easy to add! And many many more things. To be fair, there's also one thing that I've been missing when working with database-like data: Grid-Views. We have the page-tree which is great for websites, but it's limited when it comes to tabular data views. We also have Lister and ListerPro, but that's not great for such use cases imho. That's why I built RockGrid, which makes it possible to list ProcessWire pages as grid with other helpers like batch editing rows and adding custom actions, see https://processwire.com/talk/topic/26663-need-help-making-sse-work/?do=findComment&comment=220918 if you like and if you are bored ? Of course you could always just code some custom view just like you'd have to do when building such an app with PHP/MySQL or any other framework. You can do that in the PW backend (https://processwire.com/talk/topic/17709-how-to-create-custom-admin-pages-aka-processmodules-yes-its-that-simple/ ) or you just code your own custom frontend for it. Now that we have everything in place you can easily listen to events in the PW ecosystem: <?php // site/ready.php $wire->addHookAfter("Pages::added(template=protocol)", function($event) { $page = $event->arguments(0); // send email $mail = new WireMail(); $mail->to('your@mail.com'); $mail->from('robot@yoursite.com'); $mail->subject('new shift entry'); $mail->body("See here: ".$page->editUrl(true)); $mail->send(); }); Now whenever someone creates a new protocol page you get an email that shows the url where you can edit and review that new entry. Hope that makes sense! Have fun exploring PW ? PS: Wondering what "INSERT INTO ..." would be in PW? <?php $p = new Page(); $p->template = 'protocol'; $p->parent = $pages->get(123); // page id of your parent page $p->title = "John Doe"; $p->datetime = strtotime("2022-11-11 11:11"); $p->message = "Your shift message"; $p->save();
-
Yes. In PW you have the concept of "everything is a page". Where a page can consist of multiple fields. And one fundamental part of the system is the page editor (ProcessPageEdit technically speaking). If you are in the default page editor a "save" will take all fields' values, submit them, process them and save them to the database. If you want to do that on your own you can, but it's for sure not the most efficient way. Though you can do so, because PW is not only a CMS, it is also a Framework just like Laravel and consorts. Ok... so for your example let's say we had two fields, body1 and body2 on the page. And let's say we want to store something in those fields. The basics are really easy with the PW API (so there's no need for complicated mysql queries or such that you might be looking for when coming from other frameworks): $page = $pages->get(123); $page->setAndSave('body1', 'my example value'); Now that is populating the body1 field of page 123 with a hardcoded value. Of course in a real world you'd have much more moving parts: A dynamic page id, maybe a dynamic field name (body1+body2) and of course a dynamic body text. You'd need to take all of that into account and do proper sanitisation etc.; Do you really want to do that? I partly understand. But I think you have some misconceptions in your head, which is a common thing when coming from other platforms. It might feel strange at the beginning (everybody is so used to mysql tables and mysql queries) but once you get the "everything is a page" concept it can really be eye opening and a great joy to work with! Before I go into detail on what I'd do instead... What do you mean by "trigger some action on my backend" and "not the PW-table"?? Are we talking about the PW backend? The admin interface? That is usually found under your.site/processwire ? Are we talking about a test-project? Or are we talking about something real? And if you tell us more about your experience we can provide better answers and understand you better ? For example if you came from something like WIX you might have totally different concepts in your head than coming from WordPress or Typo3...
-
Hey @Heinz welcome to ProcessWire ? What you are asking is not so easy as it involves a lot of technical stuff and some of that are security related. That's why sticking to default PW procedures is usually a good idea, so you can trust on proven concepts. But on the other hand everything is possible in PW. If you give us a context WHY you are trying to do that and what the actual goal is we might have another and maybe easier and better solution to your problem?!
-
Another (even simpler) version for uikit breadcrumbs: <ul class="uk-breadcrumb"> <li n:foreach="$page->parents() as $p"> <a href="{$p->url}">{$p->title}</a> </li> <li><span>{$page->title}</span></li> </ul> ?
-
AdminThemeUIkit admin styles from multiple less files
bernhard replied to gornycreative's topic in General Support
@gornycreative your messages are sometimes really hard for me to read/understand. Not sure if you are native and just writing slang or just using words/grammar that I don't fully understand. But even posting your last answer into deepl translator did not produce any understandable translation. I have a guess, but I'm not sure. So I'd ask you to be more careful in your wording if possible please so that everybody (also non native english speakers) can understand what you are saying. Could you please explain what you tried to say in your last message in other words? -
Weekly update β 28 October 2022 β TinyMCE Inputfield released
bernhard replied to ryan's topic in News & Announcements
Thx Ryan ? Hope that all the updates go smoothly ? -
Weekly update β 28 October 2022 β TinyMCE Inputfield released
bernhard replied to ryan's topic in News & Announcements
Hey @ryan I just installed TinyMCE for the very first time and was a little surprised that it does not show up on frontend editing. Is it supposed to work there as well? It would really be a dealbreaker for me if not ? Or is that just an update coming in the future? Or is it an easy addition that you just didn't have on your radar? Thx! -
AdminThemeUIkit admin styles from multiple less files
bernhard replied to gornycreative's topic in General Support
Hey @gornycreative just installed InputfieldTinyMCE for the first time and guess what: It has reno styles applied even though I'm using the rock style. The quick and dirty solution would be to override those styles in my rock style, but IMHO it would be a lot better if they were simply not applied unless the reno theme is being used. IMHO AdminThemeUIkit should stick to uikit conventions (primary color, secondary color) and the reno style should override those where necessary (not the other way round). So I think if you find a good solution for that problem that would be really great and important for PW! -
AdminThemeUIkit admin styles from multiple less files
bernhard replied to gornycreative's topic in General Support
Just yesterday I thought about that topic... I saw that Tracy uses a custom color that comes from the reno theme I think? Is that one example for what you mean @gornycreative ? Do you mean that the module should pick up the default color (in my case my #00BB86 baumrock-green) rather than the reno-red? I'm not sure how we could do that best, but I'm quite sure if we find a concept that works and makes sense and explain it to Ryan he'd be helpful in implementing that or to add some kind of procedures/guidelines. Personally I think that the rock theme should be the default. Not because I built it, but because it is close to the default UIkit theme (that was the goal of the style). UIkit already comes with the necessary standards (like having a proven concept of colors primary/secondary/muted). The reno theme is imho an opinionated set of overrides on top of that (or should be). One restriction would be that the primary color needs to be a dark color with good contrast to white. So that all UI elements having a primary color are well visible on white screens and can have white as text color. I'm not sure how that would work for a dark mode switch? Maybe the best would be to create a demo-module that implements our concepts?