Leaderboard
Popular Content
Showing content with the highest reputation on 02/22/2023 in all areas
-
Checkout the new PAGEGRID online demo ? Now I'm working on a couple of video tutorials to highlight some use cases and features. I also added a changelog to the first post so you can stay up to date. As I use PAGEGRID for some of my own projects, I'll be updating the module to meet my needs. But I'm also interested in your feedback. What features would you like to see in PAGEGRID?2 points
-
Thanks. To get the width and height of an image, I'm doing this: // within repeater loop that has a file field called 'project_file' $imageSizer = new ImageSizer($project_file->filename); $width = $imageSizer->getWidth(); $height = $imageSizer->getHeight();2 points
-
Your textformatter seems like a valid solution. Although I am not sure whether the regex for getting the file URL is 100% reliable. I'm not a regex prof. But in general it is not a good idea to rely on regex for parsing HTML. You could use PHP's SimpleXML to parse and replace the href attributes. Adapt something like this: https://stackoverflow.com/questions/27326066/simplexml-php-change-value-from-any-node But I think you don't even need a textformatter for the task. A simple hook will intercept all URLs to PDF files and return the desired URL under /downloads/. Place this in site/init.php <?php namespace ProcessWire; // intercepts all file URLs and rturns URLs in desired format. wire()->addHookAfter('Pagefile::url', function(HookEvent $event) { /** @var PageFile $pageFile */ $pageFile = $event->object; if(strtolower($pageFile->ext) === 'pdf') { $pageId = $event->page->id; $event->return = '/download/' . $pageId . '/' . $pageFile->basename; } }); Now all URLs to PDF files will have the desired format. Even when you add a link to a file inside CKE editor, the desired URL will inserted.2 points
-
NOTE (2024-10-11): No special syntax needed any more! I'm so happy about that feature that I think it's worth having a new thread for it! ? You can now use regular PW translation features directly from within your LATTE files!! All you need to do is this: make sure you have PW >= 3.0.212 add the "latte" extension to ProcessLanguageTranslator's module config (or use the checkbox in RockFrontend's module config if you are using RockMigrations!) add translatable strings to your latte files and make sure to prefix them with either an equal sign or $rf-> or $rockfrontend->1 point
-
I am hoping very soon. I am currently working on a 'Gift Cards/Vouchers' feature after which I'll work on 'Discounts'.1 point
-
Hi @Spinbox, The usual ProcessWire page view, edit, add, etc. permissions apply. The generic 'padloper-shop' permission will not cover all use cases especially since Padloper pages are live under admin in the pages tree. I suggest you create a role(s) for your use case and apply the appropriate permissions to this role. Please see roles and permissions docs for detailed information Please note that although those docs also detail how to use the API, you can use the ProcessWire GUI to accomplish this task. This: might be handy. Perhaps you can target the top most parent page with a padloper template, i.e. /shop/padloper/. It uses the template 'padloper' Hope this helps, otherwise let me know if you get stuck.1 point
-
Thx @ryan again for the updates - we finally have translatable strings in LATTE files ? This is what you have to do: https://processwire.com/talk/topic/28202-rockfrontend-now-supports-translations-in-latte-files-?/ Are you talking about smarty files in RockFrontend or in general? This is how I'm doing it for latte files: https://github.com/baumrock/RockFrontend/blob/main/translate.php --> these functions are injected before any latte file get's rendered so that they are available to the compiled php file that latte creates. I don't know how smarty works (I've been using it in 2003, but I guess some things have changed since then and my memory is not the freshest any more ? ), but if you are talking about smarty in RockFrontend I'm happy to assist you to bring support for it into the module ?1 point
-
I've recently bought a new Mac and had to setup ddev on my own the very first time ? Everything went smoothly, but I switched from docker desktop to colima as recommended in the docs and have one tip I want to share: Colima is more lightweight than docker desktop but has one drawback, which - with my idea - is actually now also a benefit in my opinion ? The problem is that there is no easy way to start colima automatically on startup. There are options but I found them a little complicated (maybe because I'm a mac noob). My solution is very simple: I've just added "colima start" to my ddev alias that I use to start any ddev project anyhow. So there's no extra steps needed and if colima is already running, that I just get a message that it is already running. Nice. That also has the benefit that I start colima only when I need it and otherwise it will not need any resources. Here are the aliases that I'm using: # ddev aliases alias ddc='ddev config --php-version "8.1" --webserver-type "apache-fpm"' alias ddcm='ddev config --php-version "8.1" --database "mysql:8.0" --webserver-type "apache-fpm"' alias dds='ddev ssh' #alias dd='ddev start && ddev launch && ddev auth ssh -d ~/.ssh/ddev' alias dd='colima start && ddev start && ddev launch && ddev auth ssh' alias ddm='ddev launch -m' # launch mailhog alias ddp='ddev poweroff'1 point
-
1 point
-
1 point
-
Thanks again @flydev I am still investigating this. In wire/core/Wire.php there is a hookable method trackException. This seems to be a good place to hook into for errors/exceptions. But for Warnings I'm still not 100% sure how to them. To me it seems like WireLog is only taking care of 'error' and 'exception'. Notices has a NoticeWarning class. That looks promising but they seem to only get logged when in debug mode. I will experiment with those findings. FYI: The module I am planning to build will most likely include an option to send errors to https://rollbar.com/ using https://docs.rollbar.com/docs/basic-php-installation-setup. But also an option to just email them to configurable addresses.1 point
-
Renew the Profields licence (Store -> Manage Purchases, it costs $39) with the account that bought the licence at the time, and then go to the Profields Board and download the new version ? If there is no possibility to renew, you have to contact ryan, he will unlock it.1 point
-
Hello ProcessWire Community, It is with great pleasure that I share with you the new site for our company Strangeloop Studios, a visual design lab and animation studio based in Los Angeles. We specialize in content for musical artists but have branched into VR, Broadcast, and Music Video projects as well. This is my first site using ProcessWire. I went from complete PW beginner (October 2022) to this re-design and catalog of our various projects in the space of several months. Lurking here on the forums and visiting all of the stellar work that gets shared on the Showcases has taught me a lot. Many thanks to @bernhard for the Rockfrontend module, and @flydev for their Duplicator module. I probably wouldn't have been able to get this far without those … so, many thanks for your contributions! I also appreciate the feedback to my questions in the forums from several users who have improved my understanding of PW with detailed explanations. Things I would like to improve: optimizations for image delivery Multi-language support Looking forward to building more with ProcessWire! Cheers,1 point
-
Nico, replace your $page->hidden = 'true'; with this: $page->addStatus(Page::statusHidden);1 point