-
Posts
1,078 -
Joined
-
Last visited
-
Days Won
17
Everything posted by dotnetic
-
Preview/Discussion: RockDataTables
dotnetic replied to bernhard's topic in Module/Plugin Development
@bernhard You could use the AIOM Module for this, it should also work in the backend. Please look at the sections "minify Javascript" and "Conditional loading". You can even parse LESS files with it. But who needs LESS, when you have SASS? Oooops, I didn't say anything -
If you want to do this just for a specific language, find the ID of this language and replace {id}, including the curly braces with this ID in the following code: $pag = $pages->find("has_parent!=2"); foreach($pag as $p) { $p->setAndSave("status{id}", 1); }
- 12 replies
-
- 1
-
-
This module does not work with ProcessWire 3.0.x. If you try to edit a page "The process returned no content" appears (translated from german). Must have to do with the hooks not returning correctly. Sadly the README on github says, that this module is no longer maintained.
-
Preview/Discussion: RockDataTables
dotnetic replied to bernhard's topic in Module/Plugin Development
-
Preview/Discussion: RockDataTables
dotnetic replied to bernhard's topic in Module/Plugin Development
Wow @bernhard. This looks so good. Can't wait to get my hands on it. Could you give me access to the source so I can play with it? Really looking forward to this module. -
I don't share the opinion that the installer ist the best thing possible. There could be more improvements, for example the locale setting that you mentioned. Or displaying the installer in another language. But as ProcessWire is Open Source everyone can submit ideas or fixes. If you don't speak English so well, use an online translator such as https://www.deepl.com/translator, which is the best one I know and submit your ideas to this forum or on https://github.com/processwire/processwire-requests
-
@fermion As a reaction to your hosters answer: The setlocale() function only has an effect if the locale you are trying to set is installed on the server, and locales do not have the same name on every system. Some linux distros or windows use different names. If for example the "de_DE" locale isn't installed and you call `setlocale(LC_ALL,'de_DE');` then the default locale would be used instead. That's why there are different namings for a language in my code. On linux you can find out which locales are installed with `locale -a.
-
Hey @adrian, thank you for your continous great work and efforts on this module. Is there any way we can support you with a little donation or something else? Would you even want that? Tracy Debugger helped me so many times, and reduces my work and error finding, so I would like to give something back to thank you. I know, that you invest much time in developing this.
-
Hi @fermion, willkommen in der wunderbaren Welt und der hilfreichen Community von ProcessWire. Wir schreiben hier meistens in Englisch, damit es alle verstehen können. Ich hoffe du verstehst was die meisten hier schreiben. Now I will continue in english: Regarding your question about a risk for setting the locale. I would recommend to set the locale and date format to the corresponding language. Here is the code I use on a large website in my _init.php: $lang = $user->language->name; if ($lang == "default") $lang = "de"; $date_lang = array(); switch ($lang) { case 'en': setlocale(LC_ALL, 'english_gbr', 'english_britain', 'english_england', 'english_great britain', 'english_uk', 'english_united kingdom', 'english_united-kingdom'); $date_lang[0] = "%A %B %dth %Y at %I:%M %p"; $date_lang[1] = "%B %dth %Y"; $date_lang[2] = "%I:%M %p"; $date_lang[3] = "%A"; break; case 'nl': setlocale(LC_ALL, 'english_gbr', 'english_britain', 'english_england', 'english_great britain', 'english_uk', 'english_united kingdom', 'english_united-kingdom'); $date_lang[0] = "%A %B %dth %Y at %I:%M %p"; $date_lang[1] = "%B %dth %Y"; $date_lang[2] = "%I:%M %p"; $date_lang[3] = "%A"; break; case 'fr': setlocale(LC_ALL, "fr_FR", "fra", "fr_FR.UTF8", "French_France"); $date_lang[0] = "%A %d %B %Y à %kh%M"; $date_lang[1] = "%d %B %Y"; $date_lang[2] = "%kh%M"; $date_lang[3] = "%A"; break; default: setlocale(LC_ALL, 'de_DE.UTF8', 'de_DE@euro', 'de_DE', 'deu_deu', 'German_Germany.1252'); $date_lang[0] = "%A, den %d. %B %Y um %k.%Mh"; $date_lang[1] = "%d. %B %Y"; $date_lang[2] = "%k.%Mh"; $date_lang[3] = "%A"; break; } Yes, normally your content is embedded in "fields" in ProcessWire. Then in your template file you output the content of the field in a HTML structure you like, for example a div or a metatag. I agree, that there are not much german tutorials that cover ProcessWire, but I think this is because almost the whole developer community is used to speak and understand english. Anyways: Here is a nice tutorial in german (there are more in the same channel) You will find a nice blog post "Warum ProcessWire die beste Wahl für Ihre Website ist (nicht immer, aber in den meisten Fällen)" on my website, which isn't a tutorial, but an explanation, why and when to use ProcessWire.
-
Wow @Zeka. Nice find.
-
Support for progressive JPGs is integrated into the Dev version. I think it is there since 3.0.80, but don't know exactly. To use it put this into your site/config.php $config->imageSizerOptions('interlace', true);
-
This seems to be a problem if I use a subdirectory like http://localhost/pwtest/kickstart.php instead of http://pwtest.localhost/kickstart.php. I will check this.
-
Hi @bernhard. I wanted to test your module, but it does not work on my system. Maybe it's windows related. I am on Windows 10, with latest PHP/APACHE/MYSQL. When I select "Load a Kickstartfile from URL" and enter the URL to your Example Snippet from Gitlab Repo it downloads ProcessWire and after this my directory looks like this: but then the script says: "404 page not found (no site configuration or install.php available)". I would like to test and help you fix this.
-
Just to clarify: The security problem exists if your server is reachable from the internet. No matter if local or housed.
-
I think this unnecessary, because there is not a single installer (of which I know) out there that is password protected (not PW, not WordPress, not Drupal, not NextCloud, etc.). And even if it was so, I think that most guys develop on a local machine and then upload to a live server. I know: People do stuff differently. However: Because of the upload functionality, it is a high security risk if people can upload files, without checking for permission. I think this does not matter on a local server, but on a live server it does.
-
Thank you Bernhard for your efforts. This looks great. Hope I find the time to test it in the next days.
-
Hey @arjen. This is a list I published in my blog article Why ProcessWire is the best choice for your website (not always, but in most cases) to convince people, that ProcessWire is not so unknown.
-
Thanks, I added a few to the list. But I was looking for really BIG brands (like Nike, Porsche, etc.)
-
It would be really nice, if you could share your insights @wbmnfktr @Macrura. Maybe I could update my article with them. @Macrura why isn't it a good idea to post it on the forum? Are there customer specific details in the paper? Maybe they can be removed and you could share it with the public. Would be nice, if you can send it to me per PM. It will help if we bundle our efforts to push ProcessWire´s popularity and acceptance.
-
<?php /** * * TwigExtensions * * See README.md for usage instructions. * * @author Jens Martsch <jmartsch@gmail.com> * @version 1.0.0 * @see http://www.processwire.com */ /** * Class TwigExtensions */ class FriendChipFunctionsForTwig extends WireData implements Module { /** * Retrieves module meta data * Implementation of the Module interface * * @return array * @see http://processwire.com/apigen/class-Module.html */ public static function getModuleInfo() { return array( 'title' => 'Functions for Twig', 'summary' => 'Allows customizing twig, e.g. add extensions', 'version' => 100, 'singular' => true, 'autoload' => true, 'icon' => 'puzzle-piece', 'requires' => array( 'TemplateEngineFactory', 'TemplateEngineTwig' ) ); } public function init() { if ($this->modules->get('TemplateEngineTwig')) { $this->addHookBefore('TemplateEngineTwig::initTwig', $this, 'addExtensions'); } } /** * Hook add twig extensions * * @param HookEvent $event */ public function addExtensions(HookEvent $event) { $this->twig = $event->arguments('twig'); $this->addRelativeTimeStr(); $this->asset_path(''); } private function addRelativeTimeStr() { $twigWireRelativeTimeStr = new Twig_SimpleFunction('wireRelativeTimeStr', function ($date) { return wireRelativeTimeStr($date); }); $this->twig->addFunction($twigWireRelativeTimeStr); } /** * Returns the revved filename if a rev-manifest exists * else it returns the $filename * @param string $filename relative to the template/assets directory * @return string */ private function asset_path($filename) { $assetPathFunction = new Twig_SimpleFunction('asset_path', function ($filename) { $manifest_path = $this->config->paths->templates . 'assets/rev-manifest.json'; if (file_exists($manifest_path)) { $manifest = json_decode(file_get_contents($manifest_path), TRUE); } else { return $this->config->urls->templates . "assets/" . $filename; } if (array_key_exists($filename, $manifest)) { $manifest_filename = \ProcessWire\wire()->config->urls->templates . "assets/public/" . $manifest[$filename]; return $manifest_filename; } }); $this->twig->addFunction($assetPathFunction); } } or take a look at https://github.com/justb3a/processwire-twigextensions
-
@wbmnfktr I removed the security related link, which was outdated anyways, as it was for the 2.x legacy version of ProcessWire. Right now, for PW3 there are no documented security flaws. The article is now translated into English and available here: https://jensmartsch.de/blog/why-processwire-is-the-best-choice-for-your-website Additions and comments are welcome. I also updated the first post, with links to both versions.
- 12 replies
-
- 10
-
-
Regarding my post/bug mentioned here This only happens when I selected or sidebar (left). I know, it's experimental ^^ With the Traditional setting with masthead navigation everything works fine.
-
The article in German is up. Please see this post for details