Leaderboard
Popular Content
Showing content with the highest reputation on 06/09/2022 in all areas
-
Alright, i think i've figured it out. The location of the layout file is wrong. According to the docs it's supposed to go into "templates/views/layouts", but according to the boilerplate it's actually in "templates/layouts". Putting it in there makes it work. Didn't expect that.2 points
-
Admin Theme Canvas A minimal admin theme with optimised page editor UI, based on Uikit 3. Currently this is close to stable, but users are advised to be cautious and test thoroughly. This theme is tested in all major Browsers including IE 11, Edge (>85), Chrome (>85), Firefox (>81), Safari (>11). If you find any bugs or have ideas for improvements, feel free to post your feedback. Download from Github Download from Modules Page Features Minimal black and white admin theme Fixed masthead navigation Direct access to page tree navigation inside page dropdown Less distraction for editors (when editing a page, the tabs are displayed as a dropdown menu inside the main navigation) Options to customise the ui Less distraction for editors Direct access to page tree navigation inside dropdown Page tree Options to customise the ui Login (inspired by AdminThemeBoss) Requirements Process Wire 3.0.100 or greater Installation Go to “Modules > Site > Add New“ Paste the Module Class Name “AdminThemeCanvas“ into the field “Add Module From Directory“ Click “Download And Install“ On the overview, click “Download And Install“ again… On the following screen, click “Install Now“ Go to your user profile page and change the theme to Admin Theme Canvas1 point
-
1 point
-
Thanks! But this does not work unfortunately... However formatting the date like this was the workaround for me: date("d.m.Y", $termin->startdatum)1 point
-
I think this has to do with your time zone ? Do you have the Language Support module installed? If yes, go to Administration -> Languages and select the appropriate language Then edit the "wire--modules--languagesupport--languagesupport-module.json" file and set your locale in "C" (example: de_DE.UTF-8) Can you post a timestamp as an example?1 point
-
I have watched a number of critical reviews about Co-Pilot on YT and I am not so sure anymore if the future looks bright.1 point
-
That's because I don't want to mess around in the PW-provided htaccess whenever possible. And because the regular site redirects to www. the staging site does as well (same htaccess). But I think I am close to solve this issue. Your input enabled me to read the documentation again and challenge my current assumptions, that httpHost is determined automatically and httpsHosts should list all available configurations. What I am actually confused about is the fact that it is working everywhere as expected - except for IONOS. -- and after a short call with their support, I have to admit, that they are quite confused by their own systems. Maybe it was bad luck, with the one support member I was talking to, but they actually saw redirects where no redirects were and vice versa. And the absolute downer (sorry for OT): Having a wildcard SSL certificate which is claimed to be valid for one domain and all subdomains *DOES NOT* include subdomains like www.stage.website.de. The support recommended to just buy another certificate. -- end of story: IONOS is a poor hoster and I have adapted the staging website to be reachable just via stage.website.de thanks anyways ?1 point
-
So i tried the other way around and formatted a date using the IntlDateFormatter. This thread helped me find my way: https://stackoverflow.com/questions/71874030/local-language-without-strftime-deprecated-but-with-date So imagine we want to output "today" like this (formatted for german) Mittwoch 8 Juni 2022 This was the old way to to it: echo strftime('%A %e %B %Y', strtotime('now')); Since this will be deprecated in PHP 8.1 and removed in PHP 9 now we have to make use of this instead: $fmt = new IntlDateFormatter('de_DE', IntlDateFormatter::FULL, IntlDateFormatter::FULL ); $fmt->setPattern('EEEE d LLLL yyyy'); echo $fmt->format(strtotime("now")); The only thing that freaked my out about this was the weird formatting pattern. At first sight it makes no sense (to me), but the ICU documentation offers a big list of available options for formatting the date in any way you could imagine: https://unicode-org.github.io/icu/userguide/format_parse/datetime/ If you are looking for a "one liner solution" then this seems to be the right way (https://stackoverflow.com/questions/12038558/php-timestamp-into-datetime) echo IntlDateFormatter::formatObject( new DateTime('@' . strtotime("now")), "EEEE d LLLL yyyy", 'de_DE' ); EDIT: Beware that timezone settings get ignored when you work with timestamps. This might get you into some trouble. My solution was to format the timestamp into a date string: echo IntlDateFormatter::formatObject( new DateTime(date("d.m.Y", $timestamp)), "EEEE d LLLL yyyy", 'de_DE' );1 point
-
1 point
-
Hey @Thromisios welcome to the forum ? In my opinion: ProcessWire is perfect for this scenario! Why I think that: ProcessWire has a very active and friendly community that will always be there to help (that's very important when learning something new). I used other systems before ProcessWire and in their forum you never knew if you would get an answer or not. Terrible. In the PW forum you'll almost instantly get great answers or even ready to use code snippets or even modules ? ProcessWire hides a lot of complexity in the beginning. That makes it easy to use and you can come very far by using a few very basic concepts. Often it's just using fields together with the API. On the other hand ProcessWire is capable of so much more. That's all hidden under the hood and once you grow, you can start exploring more and more of it's features. In other systems you'll have to learn a lot upfront just to get simple things done. For example with other PHP frameworks you'd have to build the admin interface for your users completely from scratch (not all systems of course, but there are many where you have to do so). Hooks are such a brilliant concept that not every system has. Most of the time when you want a small customization of your system/program/website that means a small snippet of code. In other systems you often need to understand the whole OOP model to extend the correct class or you need to build a plugin or an extension. In ProcessWire you hook into the correct spot (if you don't find that the forum will help) and you add some simple lines of PHP and you get what you want. We have Adrian's great TracyDebugger which is such a huge help while developing. Just a simple dump of a variable is so much more helpful than doing a var_dump(). Other systems might have similar tools, but there are for sure systems that don't have anything like that. For me it was an eye opener in many cases. For the last part you can head over to my signature link "afraid of hooks?" A simple example could be: <?php // send me an email when the client adds a new blog post $wire->addHookAfter("Pages::added", function($event) { $page = $event->arguments(0); // only execute this hook for pages of type "blog-post" if($page->template != 'blog-post') return; // send mail $mail = new WireMail(); $mail->to('your@mail.com'); $mail->from('robot@yoursite.com'); $mail->subject('New blog post at yoursite.com'); $mail->bodyHTML("Url of the new post: ".$page->httpUrl()); $mail->send(); }); Good luck and have fun ?1 point
-
From PW Weekly: This week we're happy to introduce a brand new module from Bernhard Baumrock, called RockLanguage. As the name suggests, RockLanguage is a tool for dealing with translations, and more specifically with translations related to ProcessWire modules. While ProcessWire natively ships with extensive language support, including the ability to ship module translations with the module itself, this does still require some manual work. That is exactly what RockLanguage aims to solve. Here's what the module translation process looks like with RockLanguage: Install RockLanguage on your site and (optionally) configure custom language code mapping via the module configuration screen. Add a directory for the language you'd like to include translations for within your own module's directory, e.g. /site/modules/MyModule/RockLanguage/FI/ for the Finnish language. Translate your module for said language via ProcessWire's translations manager. RockLanguage will automatically notice the update and duplicate the translation file from its original source to the directory you've just created. Now if you install this module to another site with the language folder included, and the site has RockLanguage installed and Finnish as one of its languages, the translation files for your module will be automatically synced with ProcessWire. What's nice about this workflow is that it takes some manual steps out of the equation, thus streamlining translation management. It's too early to say how widely this module will be adopted among public third party modules, but if you like the concept, you can easily start using it for your own modules right away. Download + Docs: baumrock.com/RockLanguage1 point
-
Hi folks, I just released version 1.1.1 which fixes the PHP 8.1 related errors from this issue: https://github.com/wanze/SeoMaestro/issues/41 These issues have been fixed by merging a pull request. I appreciate if the community can help me out, as I am quite disconnected from the ProcessWire world (as you might have noticed). However, I still want to support this module with bugfix releases. Cheers1 point
-
An old topic but I just hit this problem too, where I want to give an example of Markdown format in the field description without that actually being converted into HTML. I solved it by setting the Inputfield textFormat property in a hook: // Avoid Markdown in description/notes being converted into HTML // Adjust as needed for your Inputfield type and field name $wire->addHookAfter('InputfieldTextarea::renderReadyHook', function(HookEvent $event) { /** @var InputfieldTextarea $inputfield */ $inputfield = $event->object; if($inputfield->name === 'my_field_name') { $inputfield->textFormat = Inputfield::textFormatNone; } });1 point
-
You can learn from studying the Helloworld module: https://processwire.com/modules/helloworld/ From the readme:1 point
-
First, ensure that you have these countries set up in shop > tax-rates. You get there via the menu Taxes > Tax Rates. If you already added a country, it will be listed in the table there. Ensure the country is not unpublished. It will show 'unpublished' below the name of the country if it is unpublished. If your countries are not yet added, you will need to add them by clicking on 'add new country'. Then, select your countries and save or save + publish. You can then add the countries to the shipping zones as needed.1 point
-
I usually go for a modular layout. You take a repeater, and add all the fields you'll need for all types of content block: body, title, images, etc. You add another field called type, make it an options field, and get in there all the types of block you need. Text, image gallery, video... whatever. Then you customise each field's visibility to appear only when type=1, for example. That will allow the admin to freely add a chunk of text, then a gallery, then more text... No weird tags to remember, simple and straightforward. On the frontend, you make include files for each type (remember the options field) to keep it neat and tidy, foreach the repeater, and include() the correct block template file according to the value of the type field. Generate away.1 point