Leaderboard
Popular Content
Showing content with the highest reputation on 09/03/2016 in all areas
-
[...] <td class="item"><a href=""><img class="article-image<?php echo ($article->article_reserved == 1) ? ' reserved' : ''; // 1 = checked, 0 = unchecked ?>" src="<?php echo $article->article_image->url; ?>"></a></td> [...]4 points
-
This week we’ve loaded up our new ProcessWire repository with the latest 3.x version and we have some more details on that, as well as the official 3.x release date. We’ve also got a recipe you might find useful here as well. https://processwire.com/blog/posts/pw-3.0.33/3 points
-
2 points
-
Thanks Z-I-M! Fixed. v058 is available, containing the AdminLangSwitcher demoed earlier. I may add a setting to "Switch language title and name" to it later.2 points
-
Great stuff, Ryan - nice to see ProcessWire in an organisation! I wish GitHub had a "copy repo" tool so that issues could go along with it... That said, it really is nice to see zero issues.2 points
-
2 points
-
WordPress: Grade D 65, 10.29 seconds load time, 3.5 MB page size, and 206 (!!) requests (URL) ProcessWire: Grade A 93, 1.73 seconds load time, 2.5 MB page size, and 70 requests (URL) (Using the same service and location) Good work2 points
-
Croppable Image 3 for PW 3.0.20+ Module Version 1.2.0 Sponsored by http://dreikon.de/, many thanks Timo & Niko! You can get it in the modules directory! Please refer to the readme on github for instructions. - + - + - + - + - + - + - + - + - + - NEWS - 2020/03/19 - + - + - + - + - + - + - + - + - + - There is a new Version in the pipe, that supports WebP too: - + - + - + - + - + - + - + - + - + - NEWS - 2020/03/19 - + - + - + - + - + - + - + - + - + - ------------------------------------------------------------------------- Updating from prior versions: Updating from Croppable Image 3 with versions prior to 1.1.7, please do this as a one time step: In the PW Admin, go to side -> modules -> new, use "install via ClassName" and use CroppableImage3 for the Module Class Name. This will update your existing CroppableImage3 module sub directory, even if it is called a new install. After that, the module will be recogniced by the PW updater module, what makes it a lot easier on further updates. ------------------------------------------------------------------------- For updating from the legacy Thumbnail / CropImage to CroppableImage3 read on here. -------------------------------------------------------------------------1 point
-
I've just added a pull request for a ProcessWire driver to laravel valet: https://github.com/laravel/valet/pull/55/files For anyone wanting to have a quick local dev environment (on a mac) you should certainly take a look. https://laravel.com/docs/master/valet1 point
-
Hello, in one of my current projects, we have a test and production stage with their own ProcessWire installations, and we regularly want to migrate template/field configuration to the next stage without migrating content as well. ProcessWire supports this via the import/export functionality in the admin GUI. However we (and some others) would like to do this as part of an automated process. There seem to have been some discussion on this topic and two existing modules that get pretty near our requirements: https://github.com/mindplay-dk/SystemMigrations/blob/master/SystemMigrations.module https://github.com/LostKobrakai/Migrations However, they try to solve more then we need and for mindplay-dk's module, development seems to have discontinued. At that point I decided to build a more simple module with reduced scope that basically just makes ProcessWire's import/export automation-ready. Thanks in advance for trying this out and any feedback! About this Module CAUTION: This module is incompatible with repeater fields and ProFields. The module enables you to transfer template and field configuration from one processwire installation to another in an automated way. Changes to templates or fields are exported to the file system immediately (so they can be added to source control together with changes in the template files) The import script is designed to run from the command line (so it can be invoked from your build/deployment tool). On invocation in import mode, a DB backup is created template/field changes from the persist directory are imported into the DB In restore mode, the import script can restore any of the DB backups previously saved How to Use Make sure the module is installed in the source and destination ProcessWire environments. After installation of the module, you should check if the module's default persistDirectory configuration setting fits your requirements. The module will automatically export all fields, fieldgroups, and templates to JSON files in the directory specified by that setting. Note that the same setting is used by the import script as well, so if you change it, make sure you change it in all affected ProcessWire environments. The JSON files can be transferred to the destination ProcessWire environment. Running the import script from the command line will import template and field data in the destination ProcessWire environment. Manual Installation Caution: Beta software - do not use in a production environment without prior testing and regular back-ups. Caution: This module is incompatible with repeater fields and ProFields. In case automatic installation does not work, get the code at https://github.com/jaromic/pw-autoexport-tf/ and follow the instructions in README.md for manual installation. Manual Uninstall Delete the following files and directories from your module directory: AutoExportTemplatesAndFields/ AutoExportTemplatesAndFields.module Download Install from the module directory, clone the repository via GitHub, or download ZIP.1 point
-
We had to add this to our latest project and I am happy to share here. I couldn't find anything on the forums for this so apologies if it has been done before. But there are always different ways of doing things: $firstEntry = $pages->find("parent_id=1037, sort=date_1, limit=1"); foreach (range(date("Y"), date("Y", $pages->get("$firstEntry")->date_1)) as $year) { $start = strtotime(date("$year-01-01")); $end = strtotime(date("$year-12-31")); $count = $pages->count("parent_id=1037, date_1>=$start, date_1<=$end"); if ($count > 0) echo '<li><a href="' . $page->parent->url . $year . '/">' . $year . '(' . $count . ')</a></li>'; } So what is going on: first of all, our pages were children, so we set the parent_id, and our date field is called date_1 we need to get the year of the oldest entry, so that happens with $firstEntry and a simple find next we create an array using a range of years, we start with the current year, then we get the year from our $firstEntry (note: if you have an output format for your date set in the field settings you will want to use $pages->get("$firstEntry")->getUnformatted("date_1") within the foreach) next we create a start date and end date for the year we count if there are any entries for that year if there are display them in a list Your next step would be to create the $input->urlSegment code to display your pages.1 point
-
It isn't designed to support this. But I also don't see much disadvantage for this usecase. Lets assume the width you want to support is 1400, 960, 480. Setup the image field with min-width: 1400 and min-height: 788 (= 1400 / 16 * 9) Create a cropsetting image16x9, call it with 100% quality as master-source for the variations $master = $page->images->first()->getCrop("image16x9", "quality=100"); $large = $master->width(1400); $medium = $master->width(960); $small = $master->width(480); Or directly use the markup srcset module from @tpr and only pass the master to it!1 point
-
You don't have to move files into templates folder. I have linked to solutions with template files stored in the modules folder already above: https://github.com/horst-n/LocalAudioFiles/blob/master/site-default/modules/LocalAudioFiles/LocalAudioFiles.module#L53 https://github.com/horst-n/LocalAudioFiles/blob/master/site-default/modules/LocalAudioFiles/LocalAudioFiles.module#L121 https://github.com/horst-n/LocalAudioFiles/blob/master/site-default/modules/LocalAudioFiles/view.php1 point
-
I have spent some more time on the Module Disabler panel to make it easy to restore things if disabling a particular module breaks your site. Ryan has mentioned that there are some situations where this may happen and there is no way to avoid it, so I think this panel is now the safest way to disable modules for testing purposes. Whenever you disable any modules, a backup of the "modules" database table is automatically saved. To restore you have two choices: Copy "/site/assets/cache/TracyDebugger/restoremodules.php" to the root of your site and load it in your browser OR Execute "/site/assets/cache/TracyDebugger/modulesBackup.sql" manually (via PHPMyAdmin, the command line, etc) After you run the restoremodules.php file, it will automatically remove the backup file and itself from all locations. Please let me know if you notice any problems or have suggestions for improving this.1 point
-
The editors only translate text and therefore they dont need this feature, because I use language tabs for translations of fields. I use your language switcher fe to check if all the page labels were translated and so on. In general I use it to check if the admin section is understandable for non native speakers as well, because some editors have another mother language and this makes it (only for me as superuser) much easier.1 point
-
I haven't got the need for this so I need to think about it a bit more. Are your "editors" responsible for only one language? On "think more" I actually meant that it would be better to create a module setting that is more general. For example a setting where you could enable/disable submodules for each role, eg. using asmSelects. It's just a quick idea but this would allow fine-tuning permissions for every submodule.1 point
-
As a sample, if you open _main.php under the processwire installation => site-default folder, you can add google adsense scripts before </head> tag or at the end of that file before the closing body tag - </body>1 point
-
Exactly. I moved wireshell from my private account to an GitHub organization and everything got redirected.1 point
-
I kinda polluted the new ProcessWire repo on GitHub with a first pull request https://github.com/processwire/processwire/pull/11 point
-
What say the doc : also $this is not callable in this context as you're not in an object. In order to get the hook working, you should write the hook in _init.php : function example1(HookEvent $event) { $page = $event->arguments[0]; wire('session')->message("Hello World 2 ! You saved {$page->path}"); } $pages->addHookAfter('Pages::save', null, 'example1'); And in admin.php, add : include("./_init.php"); Now go to in backend, and save a page, the message 'Hello World 2 ! You saved /your/page/' should appear.1 point
-
Horst, the problem was in our code. I imagined it was more complicated than it was (multiple people making changes sometimes leads to surprises). I very much appreciate your comment about adding the "sort=-timestamp" clause to the selector. I hadn't done that before.1 point
-
Just been toying around with this a little more. You can now backup the settings for any module anytime you want using the "Backup Current Settings" button. You can also "Restore Settings from Backup" at any time. By default it automatically backs up the settings of any module when it is uninstalled, but you can turn this off if you want. Even with it on, restore on reinstall still has to be manually triggered anyway, so probably no real reason to turn off. And of course you can still manually import settings that you have pasted in from another install. Anyone have any further thoughts? In particular I am looking at @tpr (AOS) and @horst (ALIF) because they are the two module authors who I know have built some sort of dedicated settings backup / migration into their modules. Do you think it would be weird having this module installed and adding this functionality on top of what you have already built into your modules? I guess ideally if this functionality was in the core it wouldn't be an issue because you'd know that everyone has access to it, so no need to build it in.1 point
-
If you want to keep the original Pageimages WireArray but use an index you can create your own index counter: $index = 0; foreach($data->img_gallery as $image) { // do whatever with $index and $image here $index++; }1 point
-
To lock and protect the file, you will have to modify its permissions on the file system. To do that, you will have to execute "chmod 400 config.php" on command line. There is no "setting" inside config.php. To run that command, you will have to gain ssh access to the server. If ssh is not your thing, you can change file permissions in your FTP client as well -- at least most FTP clients support it. In your FTP client, right-click on config.php and and click on file permissions. Then set the permissions to 400.1 point
-
Our new site is built on the magnificient PW. Niinu Agility Sport is leading dog trainer in Finland with top of the notch quality of coaching. Our target, when choosing PW as the platform, was to find a tool that would help us maximise the level of automatisation in enrollment to our classes, billing and capacity management processes. Along the way we found we could improve so many other areas in our services that directly affect our end-user statisfaction. This was not the first project for us to use PW as the platform, but is absolutely the most effective one. Previous ones have mainly been "just websites". Now we have been able to integrate PW into the core of our business. Thus, able to leverage to level of our execution to compeltely new level. Most of the eyecandy for us lies in the back-end where we are able to drastically reduce the amount of manual labour in the course management and yet improve and enhance our customer experience and our ability in customer nurturation. I'm not sure if we could thank to mr. @apeisa enough for his ingeniousness and efforts in this project and in helping us to accomplish all of this. Outcome exceeds our expectations in every aspect, thanks to the incredible flexibility of PW as platform. https://niinuagilitysport.com1 point
-
Thanks @szabesz for pointing this out! There's something not completely working in our import script from our previous Wordpress site. I've gotta check it out!1 point
-
No problem - thanks for the explanation. Seems like one of those rare times I can see a valid use for the silence operator. I think I'll add it to all the strtotime calls in Tracy which should at least prevent the error for you.1 point
-
@szabesz I am pretty sure the docs don't say "We can just provide the hanna code itself", I saw that part of the docs and was looking for that exact type of phrase, but even though I couldn't find that, it was enough for my trial and error to work it out, so all's well that ends well1 point
-
Hello tpr, z-index man is back with a new z-index issue concerning the date/time inputfield. As you can see the date/time picker div will be overlapped by using the static header. The CSS used for this inputfield: .ui-datepicker {z-index: 100!important} So you have to add this line of code also to your Stylesheet with a higher index than the static header divs and the important addition. This is what it looks like with a much higher index: Best regards the z-index man1 point
-
This is the version to stay. It is close to get stable 1.0.0 ! The quirks with the first tries in PW3 was mainly because of misunderstandings between Ryan and me when first time talking about the changes in core image field. And also because my insuficient knowledge of PW But know we have a solution that (only) extends the core image field with additional functionality. Possible changes, enhancements on the core imagefield will automatically inherited know, like it was with the versions before the core image change.1 point
-
Hi, and welcome to the forums. How do you have linked to the file? (code example) Where is the file hosted? (locally, remote)1 point
-
1 point
-
Thank you Ryan, and thank you for providing such awesome software open source. It makes many projects like this and more possible.1 point
-
You should validate the user input using $sanitizer and use CSRF in the form.1 point
-
I find it easier to manage these things in a module like this. Also you need to use a before hook, as saving the page with the new title after saving would trigger an infinite loop. See next posts <?php /** * ProcessWire 'Hello world' demonstration module * * ProcessWire 2.x * Copyright (C) 2014 by Ryan Cramer * Licensed under GNU/GPL v2, see LICENSE.TXT * * http://processwire.com * */ class PutYourNameHere extends WireData implements Module { /** * getModuleInfo is a module required by all modules to tell ProcessWire about them * * @return array * */ public static function getModuleInfo() { return array( 'title' => '', 'version' => 1, 'summary' => '', 'singular' => true, 'autoload' => true, ); } public function init() { $this->addHookAfter('Pages::saveReady', $this, 'doStuffOnPage'); } public function doStuffOnPage($event) { $page = $event->arguments[0]; if($page->template->name === "blog_page" && $page->blog_categories == "Swatch"){ // Do your thing } } }1 point