Leaderboard
Popular Content
Showing content with the highest reputation on 06/22/2021 in all areas
-
@bernhard, thank you very much for replying! I'm at the same place right now... ? It haunts me from time to time to build my own theme with admin structure reorganised a little bit. But I'm not there yet and there are (always...) more important things to do. Anyways, you've made a simple yet powerfool tool to play with styling. I'm already using it and love it. So once again - thank you! ?2 points
-
Hi @Chris Ernovsky glad you like it! That is a good but not so easy question ? My primary goal was to make it easy to make the admin look and feel more like the brands of my clients. I don't have further ambitions. That's why I introduced the wording "theme" vs. "style" --> a style is really just a modified CSS. Everything that modifies more of the admin might be called "theme". On the oder hand this module shows that you could combine both. Change the style on the one hand but also modify the theme via hooks on the other hand. You have lots of possibilities. Going further you could create your own admin theme as well. I have no idea how hard that would be to build and maintain. I'm afraid of that, so I'll not do it ?2 points
-
Hi all ? I made this searchable UIkit 3.x documentation site to share with everyone. The official doc is great but you can't search across the whole doc. Anyway, here is the URL: https://uikitdocs.netlify.app/ What's missing is the live examples. Perhaps some of you can contribute? Github repo link is on the website as well. Cheers2 points
-
(once again I was surprised to see a work of mine pop up in the newsletter, this time without even listing the module on PW modules website ?. Thx @teppo !) FieldtypeQRCode Github: https://github.com/eprcstudio/FieldtypeQRCode Modules directory: https://processwire.com/modules/fieldtype-qrcode/ A simple fieldtype generating a QR Code from the public URL of the page, and more. Using the PHP library QR Code Generator by Kazuhiko Arase. Options In the field’s Details tab you can change between .gif or .svg formats. If you select .svg you will have the option to directly output the markup instead of a base64 image. SVG is the default. You can also change what is used to generate the QR code and even have several sources. The accepted sources (separated by a comma) are: httpUrl, editUrl, or the name of any text/URL/file/image field. If LanguageSupport is installed the compatible sources (httpUrl, text field, ...) will return as many QR codes as there are languages. Note however that when outputting on the front-end, only the languages visible to the user will be generated. Formatting Unformatted value When using $page->getUnformatted("qrcode_field") it returns an array with the following structure: [ [ "label" => string, // label used in the admin "qr" => string, // the qrcode image "raw" => string, // the raw qrcode image (in base64, except if svg+markup) "source" => string, // the source, as defined in the configuration "text" => string // and the text used to generate the qrcode ], ... ] Formatted value The formatted value is an <img>/<svg> (or several right next to each other). There is no other markup. Should you need the same markup as in the admin you could use: $field = $fields->get("qrcode_field"); $field->type->markupValue($page, $field, $page->getUnformatted("qrcode_field")); But it’s a bit cumbersome, plus you need to import the FieldtypeQRCode's css/js. Best is to make your own markup using the unformatted value. Static QR code generator You can call FieldtypeQRCode::generateQRCode to generate any QR code you want. Its arguments are: string $text bool $svg Generate the QR code as svg instead of gif ? (default=true) bool $markup If svg, output its markup instead of a base64 ? (default=false) Hooks Please have a look at the source code for more details about the hookable functions. Examples $wire->addHookAfter("FieldtypeQRCode::getQRText", function($event) { $page = $event->arguments("page"); $event->return = $page->title; // or could be: $event->return = "Your custom text"; }) $wire->addHookAfter("FieldtypeQRCode::generateQRCodes", function($event) { $qrcodes = $event->return; // keep everything except the QR codes generated from editUrl foreach($qrcodes as $key => &$qrcode) { if($qrcode["source"] === "editUrl") { unset($qrcodes[$key]); } } unset($qrcode); $event->return = $qrcodes; })1 point
-
AdminStyleRock Easily style your ProcessWire backend with two simple settings: Or via RockMigrations: $rm->installModule("AdminStyleRock", [ 'rockprimary' => '#0069B4', 'logo' => '/site/templates/img/kollar.svg', ]); ----------- Background: As of PW 3.0.179 we have a new style in AdminThemeUikit called "rock" style. This thread is here to report issues or ideas for improvement. The goal of the rock style is to make it as easy as possible to adapt your backend to the CI of your client. That's why it uses only ONE single main color and keeps all other design elements in a neutral grey. Download & Docs: https://github.com/baumrock/AdminStyleRock Here is an example screenshot using default uikit colors and a custom base font:1 point
-
Hi there! I'm very new to ProcessWire, just found the system about a month ago and have been toying around with it a bit, and I'm loving everything I'm seeing! I'm coming over from the Concrete5 CMS, which I've been working with for 10 years, and one of the primary things that's so alluring to me about this CMS / Framework is that it doesn't try to get in your way. It seems like it's very much built with the mentality of providing the tools to build what you need, rather than forcing you to work around systems built for a specific purpose, and along with that, it seems like the community is incredibly helpful and friendly, which is always a big plus! One of the concepts that I'm used to from Concrete5 is the concept of Single Pages - one-off pages that are made for a specific purpose, and all of its code is self-contained, rather than part of a reusable templates. I am currently building a system that somewhat resembles an LMS - essentially needing Students, Student Records, quizzes / tests, and answers to them for each student record. The perfect example for my case is a user dashboard, to be able to view current tasks, know where to go next, etc. which won't be re-used anywhere else except on one page. From what I'm seeing with ProcessWire, it seems the base concept is that if you want a page to display on the front end of the site, it needs a .php template in the /site/templates/ directory, and even if the template is used in multiple pages, or only one, it makes no difference, and this is where it would / should go. Am I correct in this thinking? I want to make sure that as I learn ProcessWire, I get used to the standards and best practices that people have come up with, and I'm sure there's an answer to this somewhere already that I possibly overlooked, but I wasn't able to find it. Any insight on this would be much appreciated! Thanks!1 point
-
It shouldn't be a problem to access that image directly, that's exactly what happens with the css and js files that you add in the templates folder. It could be a permissions problem in the server, but then you wouldn't have that 404 page. May seem too obvious, but make sure that you wrote the url correctly ?1 point
-
I have experiences with connecting to various payment gateways and done that with custom developments (modules). Here is important that the payment gateway returns the result of the transaction to a specific url (PW side) where you can do what you need (e.g. write desired values in member page). Also, if necessary, you can create additional cron job/scheduled task procedures for automation (e.g. member notification...). In this particular case (member subscription), you can use "expiration date" field on the member page and check that on the front (allowed/permitted to ...). Regards.1 point
-
Scope? When in the template file are you in Namespace\Processwire Have you tried to call it with a backslash in front? new \mysqli ... ? EDIT: Yes it is the missing backslash. (downloaded and looked into your php file) ?1 point
-
A serializer module for ProcessWire Pages. This module will add a new method to all pages, called serializer(), which returns JSON. https://github.com/Luis85/FlowtiPageSerializer ## Dependecies symfony/serializer symfony/property-access ## Requirements ProcessWire 3.x Composer ## Installation cd site/modules git clone git@github.com:Luis85/FlowtiPageSerializer.git cd FlowtiPageSerializer composer install ## Usage $page->serialize() will return the serialized Page Object as a JSON string representation containing all accessable fields calling $page->serialize('field_name') returns the Page Object with just this field $page->serialize(['field1', 'field2']) will return the choosen fields This is my initial commit, just cobbled together a wrapper around the symfony/serializer component which i plan to use for data serialization and deserialization. The module can just serialize a given page and limit its output a field string or an array of strings. Supports only json output right now. Supports only 1 dimension of data, so no reference titles / .dot syntax. Can someone please enlighten me how to setup a proper composer setup for PW Module Development btw?1 point
-
Thanks Teppo, helped me already a lot. I think I should dive deep into your framework and have a look at your solutions/implementations ? Bundling my dependcies into the repo is not an option ? What I want to achieve proper dependency management on a Module base dependency management of the whole project including modules A proper way to build and publish modules / profiles for easy consumption The third part would be the hardest part I guess. I started to work on a module, based on deployphp/deployer to somehow have the possibility to get a proper Build Pipeline from local -> dev -> staging -> prod Another thing I did, was to integrate vlucas/phpdotenv to handle different Environments based on, you guessed it, the particular environment. But first things first, Dependency Management. I played around to split my codebase into git submodules, which will give me a new lot of problems to manage them in the long term, but it seems to be the way to go. The root cause for all of this, is my usage of ProcessWire as a backend for a multi-tenant system with a plethora of problems on its own, which I will write some stuff about in the future. And on a sidenote, I dream to composer require ProcessWire and just use it as a Frontend Service.1 point
-
I'm posting this as an update to an earlier post created by @Hari KT: https://processwire.com/talk/topic/4958-composer-support-for-processwire/. Though that approach still (kind of) works (as does the one detailed in https://github.com/wireframe-framework/processwire-composer-installer), thanks to @d'Hinnisdaël there's now a better alternative: the official composer/installers project ? An example repository implementing the things detailed in this post: GitHub repository: https://github.com/teppokoivula/HelloWorld Packagist entry: https://packagist.org/packages/teppokoivula/hello-world As a module author, how do I make my module installable via Composer? 1) Add a composer.json file to your module's directory. Here's an example: { "name": "vendor-name/module-name", "type": "processwire-module", "license": "MIT", "extra": { "installer-name": "ModuleName" }, "require": { "composer/installers": "~1.0" } } The composer.json file explained: "name" consists of two parts: your vendor (author) name, and the name of the package (module). These can (but don't have to) be the same as your GitHub or BitBucket user and repository names. Please note that this value should be all lowercase! That's the syntax expected by both Packagist and Composer. "type" should be "processwire-module". You may have seen "pw-module" used by other packages; that's the value used by third party installers, you don't need to worry about that now. "license" should specify the license your module is published under. See Composer help for expected syntax. It's technically fine to leave this out, but it's always a good idea to let users know how they're allowed to use your code. "installer-name" under "extra" should specify the expected directory name for your module. Usually this is the same as your module's name. If you leave this out, the package part of the "name" value will be used instead (which may be just fine, though I'd recommend always filling in this value). "require" includes Composer dependencies of your module. The key part here is "composer/installers" — without this Composer won't know that your module requires said installer, and it may not be installable at all, so be sure to add this row. 2) Submit your project to Packagist: https://packagist.org/packages/submit. You will need an account for this step. It's free and very easy to register, and you can automatically connect it with your GitHub account. Connecting with GitHub also makes it easier to auto-update package versions from GitHub repository. 3) Recommended but not absolutely necessary: add tags to your module's Git repository. It's recommended that when you push a new version of your module to GitHub or BitBucket, you also add a matching tag: if you push version 0.0.3 (or version "3", following the old school ProcessWire version number format), you should also add tag 0.0.3 (or "v0.0.3" if you want to be verbose) to GitHub/BitBucket. (This step is not strictly speaking necessary, but it does make things easier for users installing your module, and makes much easier to track which version of the module is currently installed via Composer. It requires additional step when publishing a new version of the module, but please consider doing it anyway!) 4) Also recommended but not absolutely necessary: configure Packagist to auto-update based on GitHub/BitBucket. Follow the instructions here: https://packagist.org/about#how-to-update-packages. This step ensures that once you push a new version of your module, Packagist automatically updates stored information without you logging in and hitting the "update" button manually. (This step may not be necessary if you've already allowed Packagist access to your GitHub account.) ... and that's it. Congratulations, your module is now installable via Composer! As a module user, how do install a module via Composer? Go to your site's root directory and type on the command-line "composer install vendor-name/module-name". You can look up the correct details from Packagist, or the module author may have included them in the support forum thread. Obviously this only works for those modules that have implemented Composer installer support as outlined in this tutorial. Note: if you're using a "non-standard" directory structure for ProcessWire — you've moved the root of the project outside the public web root, or something along those lines — check out the custom install paths part of the composer/installers README. The "installer-paths" setting allows you to manually specify a custom install path for the "processwire-module" package type.1 point
-
Could you explain what your goal is? I mean — you're already handling dependencies via Composer, so that's a good start at least ? If you want the module itself to be installable via Composer, the approach I'd currently recommend is detailed here: https://github.com/wireframe-framework/processwire-composer-installer. Change the "type" in your composer.json to "pw-module" and add wireframe-framework/processwire-composer-installer to your requires and that's just about it. In case you were wondering, ProcessWire doesn't currently have a way to handle Composer dependencies when a module is installed via Admin. Module with dependencies will either a) need to be installed the regular way and then the user has to run composer install manually, or b) installed via Composer (see processwire-composer-installer) in which case dependencies are automatically handled. ... or you could bundle all dependencies in the Git repository itself. Somewhat crude approach perhaps, but also the easiest one for most users of your module.1 point
-
Version 0.21.0 released: ### Added - Hookable method MethodPropsTrait::getMethodPropCacheName(string $name, string $context). Note that when hooking into this method one should refer to the object that implements the trait, such as a specific Controller class. ### Changed - Include language ID in persistent cache name generated by MethodPropsTrait for cacheable methods. @Zeka, thanks for bringing the lack of multi-language support for cache names up. While testing I noticed that a site I've been working on recently was in fact also affected. Not a huge deal in this case but it could've caused some confusion. For the record: I ended up just adding the language ID to the key. If LanguageSupport is not installed it'll be a blank value, but that doesn't really matter ?1 point
-
Today I had this informational E-Mail in my inbox and simply want to share: ---------------------------------------- Hello from the staff at Let's Encrypt. On September 30, there will be a change in how older browsers and devices trust Let's Encrypt certificates, resulting in a minor decrease in compatibility. If you run a typical website, you won't notice a difference. Devices and browsers running up-to-date software will continue working fine, and we've taken steps to make sure the vast majority of older devices will too. If you run a large website, or need to support less common software (particularly non-browser software), you'll want to read about the details at: https://letsencrypt.org/docs/dst-root-ca-x3-expiration-september-2021/ In either case, no action is required from you. We're letting you know so you can provide answers to any questions your site visitors may have. Since 2015 we've served the world with 1.6 billion free certificates, each one providing security and privacy to people on the Web. It's work that's 100% funded by charitable donations since we are a nonprofit. If your company is interested in sponsorship, please email sponsor@letsencrypt.org. If you can make a donation, we ask that you consider supporting our work today: https://letsencrypt.org/donate/ Thank you. - The Let's Encrypt team ----------------------------------------1 point
-
Do you have enabled the Imagemagick rendering engine in PW? You also may set strictly use the webp variation, also if the jpeg or png source is smaller in filesize. This is not often the case, but its possible. site/config.php: $config->webpOptions = array_merge($config->webpOptions, [ 'quality' => 84, 'useSrcExt' => false, // Use source file extension in webp filename? (file.jpg.webp rather than file.webp) 'useSrcUrlOnSize' => false, // Fallback to source file URL when webp file is larger than source? 'useSrcUrlOnFail' => true // Fallback to source file URL when webp file fails for some reason? ]);1 point
-
Hello Zilli, you should be able to echo the title of the current language like this: echo $user->language->title; You can set the title of the language under Setup->Languages in the backend. Best, Nils1 point