Leaderboard
Popular Content
Showing content with the highest reputation on 04/04/2023 in all areas
-
I can highly recommend using https://ddev.readthedocs.io/en/stable/ for local development. Instead of installing LAMP stack on the local machine's host, you get everything containerized. Big advantage is that you can run different projects in different environments and replicate the live server environment easily for each project. There's also a dedicated Thread for ProcessWire and ddev:4 points
-
Hi all, Dynamic Selects Next/008 Sorry I haven't posted here in a while. I am currently thinking about the next version of Dynamic Selects. It will part be refactoring and part be some new (some requested) features. Below are the current plans for the next version. Any other thoughts and/or ideas I should consider? It is a bit of work so I might have to stretch this into several updates (versions). Thanks. A number of conversations with some of you has led me to realise that DS although useful, is somewhat limiting. Other than the current lack of flexibility to render different types of content, I think there are two fundamental shortcomings of this module. The first is the concept of relationships. The approach I took when creating the module assumed that selects/columns had to be related, i.e. parent > child; page > field, etc. Whilst this was powerful enough, it didn't always represent real world scenarios. It limited the module to 'relationships' and perhaps forced developers who wanted to use this module to structure their sites in the mold of DS. This is not the ProcessWire way, at least not in terms of flexibility. Consider the following example. Let's say we have a site about buildings. There are some things buildings have in common, e.g. windows, doors, etc. However, some features are peculiar to certain types of buildings. For instance, skyscrapers will have lifts whilst bungalows will not. If we wanted to model this in the frontend, i.e. choose type of buildings, then show what features it has, it would mean we need to use a page reference field for the DS to work. The question is, does it have to be this way? Perhaps this is a contrived example but I think we need to decouple the relationships between columns/selects in DS. Enter actions. ACTIONS The next DS will do away with the concept of relationships. Instead, we will adopt the concept of actions. In other words, IF ACTION > THEN do THIS (OR even THESE...see below) > ELSE. This will make the module more flexible and more powerful. User defined action > consequence are much more versatile than the current strict relationship between 'entities' approach. This will allow for setups such as if user selects 'people' [ACTION], THEN get content related to 'people'. ELSE IF [ACTION] 'buildings', THEN get things related to 'buildings', ELSE get some default content. Related to this is the current restriction to only populate the next column/select after a selection in the preceding column. We will change this in the next version, making it configurable and more flexible. For instance, If I select make of a car in the first column, the second and third columns could be populated with brands and year, respectively. DEFINING ACTIONS The current method of creating dynamic selects is very confusing and a bit complex. Personally I also struggle to remember the relationship types and naming conventions ?. This has to change. I haven't yet firmed up any ideas but I'd want something this is visually easy to understand and clearly shows the 'IF ACTION THEN THIS ELSE THAT'. Maybe a drag and drop? I am thinking something similar to visual data model builders. Any ideas anyone? Planned work includes: New Features New approach to model selects using 'ACTIONS'. Easier to use 'DS Builder'. Trigger change in 1 or more dependent selects. Partial templates to render different types of content. These can be overridden by user defined templates, allowing for customisation as needed. Any other thoughts...? Refactor Configurable sorting of results (title, modified, sort, etc.)3 points
-
Hello All, just want to feedback in this thread about my personal start with PW and my progress: I watched the video series of Jonathan Lahijani about WP vs. PW and got very excited. Found a german yt playlist of @LeonidLezner with some infos to start with. After these two series, understood the main concept and advantages BUT, also understood that there is a lot to learn about PHP and CSS coding to get into PW. It's not just working in the nice PW backend... ? This topic is a bit kind of "under-represented" in the Getting started intros. This is definitly not like WP... - it's way better, but also way more coding itself! So, where is a good starting point to get in this PHP and CSS topics in connection with PW dev? I also did the Beginners Guide of Francesco Schwarz, but there is not too much about it in this one... Great thanks for help Daniel2 points
-
Hello Daniel and welcome to ProcessWire, If you want to ease your way into working with CSS, then I recommend either using UIkit 3 or Bootstrap 5. Both have its pros and cons, so you need to look into both to decide which one you prefer. For example, I started with UIkit 3 but nowadays I prefer Bootstrap 5. So preferences can change, too :) A lot of PW devs also like Tailwind CSS, for example, but there are loads of others, of course, for example: https://github.com/troxler/awesome-css-frameworks As for PHP, it's hard to recommend something which stands out of the crowd, but you might find useful tutorials here: https://hackr.io/tutorials/learn-php?sort=upvotes&type_tags[]=1 Just avoid old PHP tutorials as they probably teach deprecated PHP stuff. Stick to PHP 8.x and up. Hope this helps. Happy coding! ps: use the Google site search to search on this forum and/or in the PW blog. You'll get quick results that way.2 points
-
I've found the reason. The module "Restrict Tab View", especially the activation of the "tab-view-hide"-permission causes this behaviour. After deactivting this option, the upload works again. Best regards Sebastian2 points
-
Hi, we need more details. Modules, Version, logs, etc. Essentially this sort of issue arise when html markup is returned before the JSON result expected, then the xhr fail. My bet is that you have a hook somewhere, do you have something related in ready.php or _init.php or admin.php ?2 points
-
Hi Friends, during my setup for PW, i am tuning up my workflow, so your setup looks is very nice and fits for me too! Just to understand it right: On my desktop i am running on debian as on all my servers. To setup now the local dev workflow i will install the exactly same LEMP stack here on my machine and do the dev with localhost. After everything is up and running i will pull it on a dev.server for testing and then upload it to the final production server. Correct? I am just asking because in e.g. in prepros i read something of a "built in local webserver". So is there a lot of tools, which have the local dev server built in? Why don't use them? Because you want to have the exact same setup as on the Server, correct? Thanks a lot for reply to help me getting into PW! So nice piece of software! Daniel2 points
-
Hello, A simple way, by code, could be to redirect the user if the page is hidden. In the page's settings set the status `hidden` and then in the template(s) you can do: <?php namespace ProcessWire; // Template file for pages using the “basic-page” template // the code below is an example of how to check if a page is hidden or unpublished // and redirect to the homepage if it's the case. // (/? hint > the check use a bitwise OR operator) if ($page->is(Page::statusHidden | Page::statusUnpublished)) { $session->redirect($pages->get('/')->url); // redirect the user } ?> <div id="content"> Contact or Company page </div> Another simple way, using template's settings, is to remove the view access of the guest role, see :2 points
-
2 points
-
There are several updates on the dev branch this week (commit log), including issue fixes, feature additions and minor class improvements. One of the updates I'd planned to add this week was moving InputfieldTinyMCE into the core. However, I noticed that TinyMCE was up to version 6.4.1 now and we were still running 6.2.0, so I decided instead to upgrade ours to the latest and test it out for another week in its own repository. If all continues to work well, I'll likely commit it to the core in 3.0.215. If you have a chance to test the latest version of InputfieldTinyMCE, please do, and open an issue report if you run into any trouble. Last week the Wire Request Blocker module was released in the ProDevTools board and this week we have version 2, which includes several new additions: Added support for blocking groups. Added configurable settings for immediate block (rather than just a strike) for URLs and user agents. Added support for using RequestBlocker in other applications (like we use it here in IP.Board). Added a feature were you can manually test URLs or user agent strings to see how they match your rules. Added a configuration setting so you can choose whether or not to use a log file. Added a section to the docs on how to block URLs from your .htaccess file. As I wrote this post, the processwire.com site is getting hounded with dozens of IPs trying to locate backup or database zip/rar/tar/gz files, using every possible combination of filenames and extensions you can think of, including those that include the term "processwire". Remember to never leave backup files or DB dump files accessible by URL lying around on your server, because they will get eventually found. Adding these rules (below) to WireRequestBlocker's URL matching rules seems to mostly stopped those DB/backup hunting bots: /ba=/backups/|/backup/|/bak/|/back/ .txt=credentials.txt|backup.txt|password.txt|passwords.txt .sql=.sql.gz|.sql.tar|backup.sql|dump.sql|db.sql|database.sql|mysql.sql|.com.sql .tar=.tar.gz|.tar.sql|dump.tar|backup.tar|bak.tar|website.tar|backup.tar|www.tar .zip=backup.zip|bak.zip|.com.zip|well-known.zip|index.zip|public_html.zip|website.zip|dump.zip|wallet.zip|application.zip .rar=bak.rar|website.rar|backup.rar|www.rar .gz=website.gz|bak.gz|backup.gz|.com.gz /old/ WireRequestBlocker only knows its rules and doesn't know who's real and who's a bot, so be careful not to hit URLs containing those strings on this site or it might hit you with nothing but 403's for a few hours. ? Next week is Spring Break here, so I'll likely be on a reduced schedule with kids home from school. Thanks for reading, have a great weekend! +75 more blocks (not shown)2 points
-
I'm really in love with FormBuilder, but the one thing missing to match all my end users' expectations were repeatable field groups. Think repeaters, in ProcessWire terms. Our primary application of PW is our corporate intranet, so "lines" of fields are quite common in the forms I build. We have all kinds of request forms where the information for a varying number of colleagues needs to be entered (from meal order to flight booking request) and where it is simply impractical to send a form for each, and I don't want to clutter my forms with multiple instances of fields that may only get used ten percent of the time. That's why I started to build FormBuilderMultiplier (link to GitHub). What it does: Adds an option to make a regular Fieldgroup repeatable Lets you limit the number of instances of a Fieldgroup on the form Adds an "Add row" button the form that adds another instance of the Fieldgroup's fields Adds a counter suffix at the end of every affected field's label Stores the entered values just like regular fields Makes the entered values available in preview and email notifications Supports most text based fields, textareas and selects (really, I haven't had enough time to test all the available choices yet) What it doesn't do (yet): Support saving to ProcessWire pages (i.e. real Repeaters) I haven't tested all the validation stuff, Date/Time inputs etc. yet, but since I'm utterly swamped with other stuff at work, I didn't want to wait until I have it polished. Any feedback is welcome. There might also be some issues with different output frameworks that I haven't encountered yet. The forms I work with mostly use UIKit. Status: Still alpha, so test well before using it in the field. Known issues: When rows are added, the form's iframe needs to be resized, which isn't completely clean yet. How it works: The Fieldgroup settings are added through regular hooks, as is the logic that adds the necessary field copies for processing the form and displaying previews. "Multiplied" field instances are suffixed with _NUM, where NUM is an incremental integer starting from 1. So if you have add two fields named "surname" and "givenname" to a fieldgroup and check the "multiply" checkbox, the form will initially have "surname_1" and "givenname_1" field (I'm still considering changing that to make the risk to shoot oneself into the foot by having a regular "surname_1" field somewhere else in the form less likely). When a "row" is added, the first row is cloned through JS and the counter in the fields' IDs, names and "for" attributes as well as the counter in the label are incremented before appending the copies to the Fieldset container in the form. To keep backend and frontend in sync, a hidden field named [name of the fieldset]__multiplier_rows is added to the form. Both the backend and the frontend script use this to store and retrieve the number of "rows". ToDo: Naturally, add the option to store the data in real repeaters when saving to pages. Do a lot of testing (and likely fixing). Make a few things (like the "Add row" button label etc.) configurable in field(set) context. Add a smooth API to retrieve the multiplied values as WireArrays. The mandatory moving screenshot:1 point
-
This is a reissue of a module of mine called "PublishingOptions", that I wrote a while ago. The big difference is that this module is written in PHP 8 and has some nice additional features. The old module could only publish and unpublish pages depending on date and time settings, but the new version goes much further. So you can decide what should happen after the publication end date has been reached. You have the following options: Unpublish the page - this is what the old version did Move the page to trash - new Delete the page permanently- new Move the page to a new position in the page tree - new The last option will be interesting if you want to move the page fe to an archive after a certain date. You can select the new parent page and after the publication end date has been reached, the page will be moved under the new parent page. You will find a more detailed instruction and download possibility at https://github.com/juergenweb/JkPublishPages This module is Alpha stage and should be tested carefully before using it on live sites. I have planned to add this module to the PW module download section, so everyone is invited to test it out and to report issues directly at GitHub. Thanx1 point
-
TextformatterFootnotes Github: https://github.com/eprcstudio/TextformatterFootnotes Modules directory: https://processwire.com/modules/textformatter-footnotes/ This textformatter adds footnotes using Markdown Extra’s syntax, minus Markdown About This textformatter was primarly created to ease the addition of footnotes within HTML textareas (CKEditor or TinyMCE) using Markdown Extra’s syntax. It will also retain any inline formatting tags that are whitelisted. Usage To create a footnote reference, add a caret and an identifier inside brackets ([^1]). Then add the footnote in its own line using another caret and number inside brackets with a colon and text ([^1]: My footnote.). It will be put automatically inside the footnotes block at the end of the text. Notes: the identifier has to be a number but it is permissive in that you can put in the wrong order and it will be numbered back sequentially there is no support for indentation, though since <br> tags are allowed you should be fine if a footnote has no corresponding reference, it will be ignored and left as is Options In the module settings, you can change the icon (string) used as the backreference link but also the classes used for the wrapper, the reference and backreference links. You can also edit the list of whitelisted HTML tags that won’t be removed in the footnotes. Hook If you want to have a more granular control over the footnotes (e.g. per field), you can use this hook: $wire->addHookBefore("TextformatterFootnotes::addFootnotes", function(HookEvent $event) { $str = $event->arguments(0); $options = $event->arguments(1); $field = $event->arguments(2); if($field != "your-field-name") return; // Say you want to change the icon for a <svg> $options["icon"] = file_get_contents("{$event->config->paths->templates}assets/icons/up.svg"); // Or change the wrapper’s class $options["wrapperClass"] = "my-own-wrapper-class"; // Put back the updated options array $event->arguments(1, $options); }); Check the source code for more options.1 point
-
Usually such things are the result of being logged in (probably as superuser) in one browser and logged out in the other browser. It looks like that's the case in your screenshots because I can see the Tracy debug bar in one screenshot and not in the other. So probably the difference is due to some access issue, where superuser has access to something that guests do not.1 point
-
Hi @szabesz, Thanks for chiming in! Great idea! I like the mixed approach idea. I'll have a think. I'll have a look, thanks!1 point
-
Hey @Robin S, thanks for this incredibly useful module. Since PW is now more oriented towards TinyMCE and I am already adapting new projects as well, the question is whether you have plans to port this module for TinyMCE as well?1 point
-
After all the research I have done on how we can train chatGPT specifically for ProcessWIre, I came to realize that it knows already knows PW and its API quite well. I experimented with prompts to make GPT-4 into a PW specialist. This is what I came up with and what seems to work really well: This primes GPT-4 and brings really good results when asking further questions. This example shows that it knows a lot about the API in detail: Q: Are you aware of the ProcessPageClone class and its methods? Not bad at all ? What I'm still having difficulties with is prompting copilot, tabnine or codeium to give me PW specific code. But thats a different story...1 point
-
@SebastianP if you really need the module, you can try to check xhr (I can't confirm the behavior..): if (!$this->config->ajax) { // add this if(in_array('View', $this->hiddenTabs)) { $event->return .= ' <script> $(document).ready(function() { $("#_ProcessPageEditViewDropdown").remove(); }); </script>'; } } // <-- add this https://github.com/adrianbj/RestrictTabView/blob/88bbee5a1fbf9a52e16df8573c0a243ee9feca97/RestrictTabView.module.php#L72-L791 point
-
Sorry, no German translation available. I'm planning to put the language package on Crowdin - but I need to figure out the best way to do this under ProcessWire. In MODX for example, all language strings are collected in single files... Edit: It seems since PW 3.0.181 it is possible to ship your modules with additional translation files inside a languages folder!1 point
-
Meanwhile luckely i could solve this by deleting/reinstall the module (same version). Thx.1 point
-
Hello @kongondo How about using some node graph libs? See for example: https://github.com/wbkd/awesome-node-based-uis I have no experience with any of them, but a decent JS library like that might do the trick. Another idea is that you might want to consider not to build any visual aid for the actions based approach but implement a programming library for that. After all, your target audience is developers. Sure, visual building makes it easy for newcomers to produce results fast, but it will be limiting in the long run. And there is the option to mix the two approaches. Since you are planning to work on the module in iterations, you might want to start with the programming library approach as that should be the bases of the visual aid anyway. Side note: recently I worked on a complex form and decided to implement some utility classes for handling forms, along with realising dependent selects as well, and I also had to deal with "non-parent/child relationships". (Just don't think of any sort of "library level" coding here, those utility classes are for my own humble needs.)1 point
-
Hi @adrian, thank you for providing this helpfull module! I've found a strange behaviour in my backend: when the "tab-view-hide"-permission is set for a role, the image or file upload fails. Please have a look at my post. Thank you, best regards Sebastian1 point
-
Hey guys, I'm indeed starting further development on this module in the next days! It needs a lot of work to be done. The main part will be the transition to Snipcart 3.0 engine + a robust EU VAT tax integration. As usual I'll report the progress to this thread. Please stay tuned! Greetings, Martin1 point
-
You can take a look into the Template configuration, under Setup > Templates, and search for the template name of the page you want to configure to display an icon in the page tree. Now, in the template configuration, search for the Icon option, it might be closed down so search a bit for it, in most recent ProcessWire version it's placed in the initial tab.1 point
-
There are not so many, it's only the vars of the pw-theme that need to be done. For the native dark theme (inverse), you can try it by adding `uk-dark` to the body, but will also see that there are some hardcoded value (like the background with #fff) in the pw theme. Will make a example, with a simple script, we can automate the vars declaration ? stay tuned. Example :?1 point
-
From mobile, but try that: on the bottom of your less variables, write: :root { —rf-primary: @rf-primary; } Then save and refresh, you can now from your CSS module just call like : .rock-textfield { color: var(—rf-primary); } You will see exposed var in the devtool too. And then we will be able to use ‘inverse’ color without overriding everything. ?1 point
-
We recently have switched to exactly the same deployment strategy for new projects and will convert old ones, too. This makes deployment so much easier compared to traditional SFTP setups. It doesn't require any external services like github Actions and makes collaborating on projects very enjoyable. We generally do not include built assets in the repo and handle these through pre-push git hooks on the local machine that trigger rsync tasks for the dist folder. How do you handle these? Here's an example of pre-push: #!/bin/sh url="$2" current_branch=$(git symbolic-ref HEAD | sed -e 's,.*/\(.*\),\1,') wanted_branch='main' if [[ $url == *github.com* ]]; then read -p "You're about to push, are you sure you won't break the build? Y/N? " -n 1 -r </dev/tty echo if [[ $REPLY =~ ^[Yy]$ ]]; then if [ $current_branch = $wanted_branch ]; then sshUser="ssh-user" remoteServer="remote.server.com" remotePath="/remote/path/to/site/templates/" echo When prompted, please insert password. echo Updating files... rsync -av --delete site/templates/dist $sshUser@$remoteServer:$remotePath exit 0 fi else echo "answer was no" exit 1 fi else echo "rsync already finished" fi1 point