Leaderboard
Popular Content
Showing content with the highest reputation on 06/24/2018 in all areas
-
Attention: This is the thread for the archived open source version of RockPdf. This module is neither developed any further nor maintained nor will it get any fixes. Modules Directory: https://modules.processwire.com/modules/rock-pdf/ Download & Docs: https://github.com/BernhardBaumrock/RockPDF Please see the new version here:2 points
-
That's likely not going to be trivial. Adding check_access=0 in a selector to display the link is quite another thing as serving the secure file to a guest user. When you have pageFileSecure enabled, the following happens: PW prefixes the file directory site/assets/files/[PAGEID] with $config->pagefileSecurePathPrefix ("-" by default so it will be site/assets/files/-[PAGEID]) When the browsers tries to show the image (i.e. open the URL /path/to/pw/site/assets/files/1258/image.jpg in a separate request), the file isn't found by .htaccess .htaccess hands off the request to index.php index.php calls PageRender::execute with the request URL PageRender::execute checks if the request is to a file, then checks if the page it belongs to is published and viewable by the current user Since $user->hasPermission('page-view', $page) returns false (the guest user doesn't have view permissions) that fails (otherwise, PW would prefix the path now and output the file) PW outputs the 404 page Since the method where the check is are done is not hookable (and some necessary properties and methods are protected, i.e. not reachable from a hook) you'd probably have to hook before ProcessPageView::execute and duplicate a lot of code from ProcessPageView or hook after User::hasPagePermission and at least duplicate ProcessPageView::checkRequestFile in both cases, match the file URL to $page->image to prevent handing out a access to other file/image fields on the page Another approach (if the images aren't too big and the protected pages aren't too many) would be to include the real image data as data URIs: <?php foreach($protected_pages as $protected_page) { echo $protected_page->title . "<br>"; $fn = $protected_page->image->filename; $imgdata = "data:" . mime_content_type($fn) . ";base64," . base64_encode(file_get_contents($fn)); echo "<img src='$imgdata' alt='{$protected_page->image->description}' />"; } If the images are small enough but you have many pages, using PW's pagination might be an option too.2 points
-
I think that's a good idea. Though I'm not sure we've got enough existing material on the forums to warrant creating a new board for the purpose just yet (?), but would suggest maybe the Pub or Beer Garden as a good place for now. We can always create a new board when the amount of content reaches a critical mass, which is the strategy we've been using so far. I don't think we can support video uploads here, though embedding from YouTube/Vimeo is a good way to go for this.1 point
-
The unzipping behaviour is part of the inputfield itself not the PageFiles/PageImages class: https://github.com/processwire/processwire/blob/341342dc5b1c58012ae7cb26cffe2c57cd915552/wire/modules/Inputfield/InputfieldFile/InputfieldFile.module#L943-L9451 point
-
There's lots of tooling and services available for po/mo files though. People might not want to translate things manually if there are ways to outsource or automate that task. So not needing to touch the JSON files is not necessarily an advantage.1 point
-
@LAPS form-builder.inc: /** * * Add custom scripts to the form. * */ $forms->addHookBefore('FormBuilder::render', function($event) { $form = $event->arguments(0); $config = wire('config'); switch ($form->name) { case 'name-of-form': $config->scripts->add($config->urls->templates . "libraries/chosen/name-of-js.js"); $config->styles->add($config->urls->templates . "libraries/chosen/name-of-css.css"); $config->scripts->add($config->urls->templates . "FormBuilder/custom-js-init-file.js"); break; // other forms can be added below... } }); in your init file: $("#Inputfield_name_of_input").chosen({ no_results_text: "The planet exists not", allow_single_deselect: true, width: '100%' });1 point
-
No. Read the instructions and infos here: https://modules.processwire.com/modules/textformatter-soundmanager/ Support forum:1 point
-
Could the culprit can be a Password Manager like LastPass or another one ?1 point
-
https://www.google.ch/search?q=ckeditor+bug+copy+and+paste+from+word It seems like there are many others encountering that same bug. Someone here e.g. suggests to only use "basic HTML" instead of "full HTML" https://www.drupal.org/project/drupal/issues/2940054 https://github.com/ckeditor/ckeditor-dev/issues/595 ^ seems like pasting on mobile browsers is/was also an issue...1 point
-
Thanks @flydev and @dragan for your suggestions. I forgot to mention in my original post that I did try paste as plain text. While it works well and is a great option in some situations, it's probably a bit of a last resort for us in this instance. As @ryan has pointed out, we don't want our editors to have to remember to do it (or force them to do it), and they'll just get irritated that all their formatting disappears. They don't always paste from Word, but it happens enough for us to have to make it as simple as possible for them (but not too painful for us as the ones who then have to check their pages prior to publishing them). Indeed! I've been using PW for personal sites for a few years now, so when it became evident we needed to change our CMS I introduced it to the rest of the Web Team and then we managed to argue the case for it to be our new CMS! ? Finally thanks to @ryan for your fantastic advice. I might look into HTML Purifier a little, but that hook code should be enough to get it operating how we need it. I'll give it a try when I'm back at work on Tuesday!1 point
-
1 point
-
I want to add to tpr's comment that bd() is actually one of the 2 most used features of tracy for me. bd() makes a dump to the tracy bar (also for ajax requests, that's great!) and d() dumps directly and is great when using the console (see my screenshot above)1 point
-
https://www.baumrock.com/portfolio/hrdiamonds-360-feedback-tool/ This tool was developed for the vienna based HR company hrdiamonds.com. They can create projects for their clients, setup the feedback architecture, choose from a library of competences and create their very own surveys and provide highly customized services for their clients. Highlights: Everything multilingual (EN/DE) PDF reports with custom designs, table of contents, page numbers, importable custom pdfs (annex, written in MS Word, so they have perfect freedom and ease of use) and of course: pretty charts (done by chart.js): Scalable and nice UI by RockGrid+batcher in several custom process modules: Automatic multilingual e-mails with several variables: Another example of RockGrid: Customizable groupings of feedback-roles (there have to be at least 3 feedbacks per role so they need to have the possibility of aggregating different feedbacks-roles). This project was online for some time already but I ported it from RockDatatables to RockGrid which I plan to release in the next days. If anybody is interested in using/reselling this tool feel free to contact me via PM ?1 point
-
Thx Sergio, sure I'm happy to share some insights. The library is mPdf (version 7) https://mpdf.github.io/ and I created a little helper module and just set it to public if anyone is interested: The custom design is just a regular PDF done by a designer and it is then imported into the pdf as needed (see line one in the next screenshot). My helper module provides a possibility to create only the HTML (not the pdf) so debugging is a lot easier: This is the result. The second logo would be the logo of the actual client of course... CSS is done with LESS, so it is easy to style and modify variables. LESS is compiled via AIOM on the fly without the need of any other compilers/setup. widows/orphans are controlled by a .nopagebreak class that can be applied so some blocks that should stay together: Charts have a fixed size so the amount of text above those charts is limited so that everything stays on one page. To get the TOC working with the custom design without page numbers etc. was quite tricky but finally it works very well. Also the "annex" feature is very nice, where they can upload a custom PDF without background and page numbers and the text is imported in the document automatically with the correct background and page numbers: We just created a word-template with the correct colors, fonts and headline sizes and that's it ?1 point
-
The best Debugging solution so far for ProcessWire ! ? https://processwire.com/api/ref/session/set-for/1 point
-
@MarcoPLY my comment was for @autofahrn and since he is german he will understand besserwisserisch ? a processmodule might be overkill in your situation. it's more advanced but once you get the concept it makes you more efficient in lots of ways. Regarding your problem: Start with this code and then continue step by step until you get your result. Use d() = dump() to chech the content of your variables. Then you see instantly wheter the variable contains some data or is NULL: $UserData = json_decode($http->get('localhost:8888/playwood/pw_users.json'), true); d($UserData); edit: $http will not work, you can just try d($http); which will show you this error: Error: Undefined variable: http on line: 1 null So you need to do this first: $http = new WireHttp(); d($http); // shows ProcessWire\WireHttp1 point
-
i'm not sure but i think hannacode does not support the if statements like [myifstatement]this is shown only to superusers for example[/myifstatement] second, hannacode is a textformatter module that works only as a formatter for fields. i use my module to replace tags in emails and pdfs (ok that would also be possible with the textformatter and i'm thinking of adding a textformatter to call all my replacements, but i just wanted to have my own way of doing it...). and third, i prefer to define things with single files and not to write code into some field's config field. you can then use git for version control. next on the roadmap is to support else-statements like this: [superuser] access [else] sorry, only for superusers :) [/superuser]1 point