Leaderboard
Popular Content
Showing content with the highest reputation on 11/27/2017 in all areas
-
HELLO! I always struggle adding additional functionality, buttons and other settings to the CKeditor and I guess other people might have the same issue at times. For those who are CKeditor aces would you share your settings in this post to help others with what I guess should be a simple task to extend the default settings. Extra color select and text formating toolbar Format, Styles Bold, Italic, Underline, -, RemoveFormat TextColor, BGColor JustifyLeft , JustifyCenter, JustifyRight, JustifyBlock NumberedList, BulletedList, -, Blockquote PWLink, Unlink, Anchor PWImage, Table, HorizontalRule, SpecialChar PasteText, PasteFromWord Scayt, -, Sourcedialog extra allowed content small[*] section font[style] span[style]{!color} code[*] custom config options colorButton_colors: ec4626,ffde43,00aaeb,004a87,7b9320,ffffff extra plugins colorButton8 points
-
How to install a customized ProcessWire instance in less than a minute All you need is to copy one file to your server, then upload a kickstartfile like this: <?php return [ 'pwurl' => 'https://github.com/processwire/processwire/archive/dev.zip', 'dbName' => 'kick', 'dbUser' => 'kick', 'dbPass' => 'Kix8s08$', ]; and if you want to customize your instance after installation you can create recipe files like this: <?php $this->installModule('TracyDebugger', 'https://github.com/adrianbj/TracyDebugger/archive/master.zip'); $this->installModule('AdminOnSteroids', 'https://github.com/rolandtoth/AdminOnSteroids/archive/master.zip'); $this->installModule('Repeater'); it needs a lot more cleanup and testing but any thoughts and ideas are welcome until i can finish it... BTW: it's not only about saving time - this could also be very helpful to share whole instances for debugging.8 points
-
hi @donald i've never used this module so i cannot provide any support that you requested in the other topic. why don't you just create your own contact form? I'm not talking about creating a module for that. only a template with a simple html form, a honeypot and some lines of code that send you an email and store the results in a page in the backend? all you need is a form: https://getuikit.com/docs/form and a template that handles the request (here it handles an ajax request with some json data): <?php $email = 'your@mail.com'; $subject = 'your email subject'; $html = "<html><body>"; $formdata = json_decode($formdata); foreach($formdata as $field) { switch($field->name) { case 'email': case 'name': case 'tel': $html .= "<p>" . $field->name . ": " . $sanitizer->text($field->value) . "</p>"; if($field->name == 'email') $email = $sanitizer->email($field->value); break; case 'message': $html .= "<p>" . $field->name . ":<br>---<br>" . nl2br($sanitizer->textarea($field->value)) . "<br>---</p>"; //${$field->name} = $sanitizer->textarea($field->value); break; case 'mail': // honeypot if($field->value) $subject = 'SPAM: '.$subject; break; } } $html .= "</body></html>"; $mail = wireMail(); $mail->to('your@mail.com')->from($email); $mail->subject($subject); $mail->bodyHTML($html); if($mail->send()) { ?> <div class="uk-alert uk-alert-success uk-alert-large"> <p>Thank you!</p> </div> <?php } else { ?> <div class="uk-alert uk-alert-danger uk-alert-large"> <p>Error!</p> </div> <?php } // save to log that can be viewed via the pw backend $p = new Page(); $p->template = 'maillogitem'; $p->parent = 1234; $p->title = date('d.m.Y') . ' - ' . $email; $p->body = $html; $p->save();6 points
-
Nice tool @bernhard! I can upload Duplicator - as is - to Github at the end of the day if you would like to compare (maybe @bernhard grabbed a copy). I use the module every day so it should work for everyone at least with decents servers. stay tuned.6 points
-
hm.. good point. maybe. maybe not. with my tool one could change the pw version easily for example. exporting and importing data would need some scripting though. i guess duplicator would be a better option in most cases. maybe we can combine the tools i haven't tried it yet. i'll try it out as soon as possible and see how you did it and if something might be worthful to combine.5 points
-
Fell free to improve the documentation! You could easily send a pull request. This is open source. I develop it in my spare time. I don't receive any money doing this. I developed this module for personal use, and thought, it would be nice to share it with others... @see: Render multiple instances To figure out what causes this, it would be a good starting point to provide a bit more information. For example: which fields are added, how do you execute the module---...4 points
-
Toolbar : Extra plugins : PS: A small suggestion @benbyf, you could include in the first post a) a small "howto customize" the ckeditor and/or b) a list of forum links where people can find useful information on "howto customize" the ckeditor (I remember that sometime I need to look at the javascript source-code of the plugin to find the right button-code to include in the ckeditor settings).4 points
-
Version 0.10.0 is in the module repository. This has a major behind-the-scenes refactoring to allow for remote repository adaptors (with result caching). Github is supported fully, and I've made a start on the BitBucket adaptor... This version also fixes a couple of issues that have been reported by @adrian and @matjazp.4 points
-
Great forum thread idea I don't have time right now for creating screenshots and copy-pasting settings, but from the top of my head here are a few things I like to use: maximize (open RTE in fullscreen, a.k.a. distraction-free writing mode) show blocks (puts visual border around the currently selected block accessibility checker embed media from external sites (Youtube etc.) I'll follow up tomorrow with links, screenshots etc.2 points
-
2 points
-
i've used mPDF standalone (my own module). and indeed i've had a project recently where i created reports with charts rendered by chartjs. i did a "hacky" solution where the charts are rendered, screenshot and integrated as PNG image by phantomjs. it's a bit slow but it was the best solution i could find - and the result looks very good2 points
-
Couldn't a module like this would be a better solution for "sharing"? @flydev has not yet released it so it's hard to compare two sneak-peek projects but still...2 points
-
I opted for this one here: https://www.szepelet.com/products/product-categories_cleansers/ for example: product-categories_body-care vs skin-concerns_body-care Where product-categories and skin-concerns are parent categories while body-care and body-care are different subcategories under their respective parents. However, these categories are sort of set in stone, meaning that they rarely change – if ever – and not manageable by the site editor by design.2 points
-
Continuing on from yesterday's Console enhancements: 1) History stack now supports the state of text selection and the scroll position, so now much easier to run different versions without reselecting. 2) This selection and scroll position state is also recorded as you edit so it is also available if you reload your browser, etc so everything will be as you left it. 3) The editor window within the console should now always get focused when the panel itself is made visible (by hover or click). Previously this wasn't reliable. This makes running code much easier because the keyboard shortcuts for running will work without needing to click into the editor window to focus it. Unrelated to the Console panel - I have made the "Show debug bar in backend" checked by default on module install. Of course you can always uncheck this, but I find the debug bar just as useful in the backend, especially the Request Info panel when editing a page, template, field, or module settings. So consider this an attempt to enlighten new users to the benefits of it in the backend because I am sure many never bother to enable it. Please let me know if you find anything amiss with the new Console functionality.2 points
-
A URL segment can include any characters that are valid in a page name. So you could separate your category names with an underscore or period perhaps, then explode on that character and match each category to pages. But you'd be sort of fighting against the workings of URL segments so why not use a GET variable instead? Then you can separate your categories with any character you want... http://yourdomain.com/your-page/?categories=one|two ...and support for arrays is actually built-in... http://yourdomain.com/your-page/?categories[]=one&categories[]=two2 points
-
2 points
-
Hey! Thanks for your fast reply. It seems like everything is alright with my comment field, I just wrote "Comments" instead of "comments" and completely forgot it was case sensitive. Thanks again!2 points
-
2 points
-
Hi @Gideon So basically you have to switch the user's language like this: $user->language = $languages->get('en'); $page->setAndSave('title', 'My title'); $user->language = $languages->get('de'); $page->setAndSave('title', 'Mein Titel'); Alternatively, you can use the setLanguageValue() function: $page->of(false); $page->title->setLanguageValue($languages->get('en'), 'My title'); $page->title->setLanguageValue($languages->get('de'), 'Mein Titel'); $page->save(); See docs here2 points
-
Try this in /site/ready.php $wire->addHookAfter('ProcessPageAdd::getAllowedTemplates', function(HookEvent $event) { // Get keys (IDs) of returned templates array $template_ids = array_keys($event->return); // Implode for use in a selector string $template_ids_str = implode('|', $template_ids); // Get TemplatesArray of those templates, sorted by label $templates = $this->templates->find("id=$template_ids_str, sort=label"); // Convert to plain array and return $event->return = $templates->getArray(); });2 points
-
Hi everyone, This new video fieldtype extends FieldtypeFile. Video is available via: $page->video_field->url Module automatically creates a poster image of the video on upload and makes this available via: $page->video_field->poster Shows the duration of the video on the title bar, next to the filesize Stores VTT files for subtitles accessed via: $page->video_field->subtitles Formats a transcript from the subtitles, accessed via: $page->video_field->transcript Users can easily upload videos and enter VTT files. The following code is used in the template file. <video src='{$page->video_field->eq(1)->url}' poster='{$page->video_field->eq(1)->poster}' width='720' height='408' ><track kind='subtitles' src='{$page->video_field->eq(1)->subtitles}' srclang='en' /></video> Additional Settings You can additionally set a few different options in the field's Input tab: Number of poster images to generate - if you change from the default of 1, the editing user will be able to select which image they want to use for the poster image Copy poster image to dedicated image field - not necessary but gives you more options of interacting with the poster image(s) Field that you want poster images copied into - only relevant if the option above is checked Try it out (NB: the code is rough - it works, but needs cleaning up. Github: https://github.com/adrianbj/FieldtypeVideo NB: Requirements The module requires ffmpeg and ffmpeg-php, although I can make the latter optional fairly easily. I don't have any requirement checking implemented yet, so if you don't have these, you'll get php errors. Possible future enhancements Ability to specify what frame is used for the poster - either by number, and/or by offering several options to choose from Done! Push poster image to a dedicated image field Done, although could be improved Field for pasting in or uploading closed captions Done, but need to look into multi-language options etc Support for uploading multiple formats of the same video (mp4, webm, etc) and/or automated video format conversion My biggest concern, is how useful this will be to people - how many hosts actually have ffmpeg setup? Do any have ffmpeg-php? Anyone have any ideas for features they'd like to see?1 point
-
It would be fantastic if we could set different configurations for CKEditor fields based on template or user roles. Like described on https://weekly.pw/issue/14/ under "More CKEditor upgrades", we can use config files in /site/modules/InputfieldCKEditor/ to store settings per field. E.g. for the body field this would be /site/modules/InputfieldCKEditor/config-body.js. Maybe this logic could be extended to something like /site/modules/InputfieldCKEditor/config--field-body--template-home--role-mycustomrole.js. I was coming over from Joomla to PW couple of years ago and there we had an excellent CKEditor integration called JCE where you could define settings per user role etc. Maybe I am wrong but up to now we need to create additional fields if we need editor config settings per template. If there already is a way to do that I'd be happy to know.1 point
-
Found the culprit: Line 113 in InputfieldVisualPageSelector.module: $pageField = $this->wire('fields')->get($this->name); When inside a Repeater field, the field name gets appended by _repeater plus some ID. I brute forced this problem by changing the line to this: $pageField = $this->wire('fields')->get(preg_replace('/_repeater\d+/', '', $this->name)); It works for me, but it's probably not exactly a clean solution. There's probably a better way to get the "clean" field name via the API.1 point
-
Yeah, you have the page id correct. Did you try echoing: $settingsPage->id like I suggested? If that works, check other fields on that page and see if somehow it's just the store_hours field.1 point
-
That won't matter because he is using $pages->get() rather than $pages->find() I think you do need to confirm 1006 and if that is correct, try $settingsPage->id to make sure that works - that way you can narrow down if it's a problem with the page or the store_hours field.1 point
-
Do you have an email field in the form? Make sure that in this field settings under input -> verify email address is not checked. the form is counting this field as two fields instead of one and you will get that error.1 point
-
Thanks for considering using AS, I'm sure some bugs might pop up Will check spatie's image-optimizer and see what can be done.1 point
-
1 point
-
@matjazp - I am thinking about starting to use this, but was wondering your thoughts about maybe integrating https://github.com/spatie/image-optimizer instead or as well as https://github.com/psliwa/image-optimizer It uses a similar collection of tools for optimizing, but the main difference is that it also includes SVGO which of course adds support for "compressing" SVGs. I honestly haven't looked into the two libraries much more than that though, so there might be very valid reasons to stay with the one you have.1 point
-
1 point
-
maybe it would be nice to have a screenshot attached to get an instant impression?1 point
-
This worked for me, Thank you I really appreciate and this is why I love processwire more now xD1 point
-
That was the answer Robin S. I had added a list-style: none - where did that come from? ;-) Thanks a lot!1 point
-
Hi Robin. As expected, the sorting works perfectly now! Thanks, Robert1 point
-
the current version is 1.1.15 please update and try again. We have fixed this already.1 point
-
Hi @incognito.ms, Thanks for your quick answer. Works very well. Gideon1 point
-
Sorry for the even longer delay – as always, the weeks before christmas are the busiest of the year. No worries, I don't feel offended personally, it's just bad PR and that it kind of looks like some careless coding of this module caused data loss. I'd appreciate if you could reword or just remove the link. Thanks for the detailed explanation. I agree, but that's not how I meant it anyway, I was referring to the partial export vs. clean fail design choice. Sticking to the second, I have added a blacklist of known incompatible fieldtypes (containing only repeater so far) for now so the module will not only skip incompatible fields, but refuse to export all fields with a clear error message in that case.1 point
-
Hi and welcome to the forum @vanvt92, I think I am correct saying that there is no limit. You can create as much languages as you need. (but I am curious to see how a big language list is managed in the backend: fields's language tab).1 point
-
1 point
-
I would go with the import option in BatchChildEditor (https://processwire.com/talk/topic/6102-batch-child-editor/) Batch Child Editor makes use of this library.1 point
-
Thanks for the report @Federico. I believe the issue you are seeing is caused by problems in the PW core rather than being specific to the Custom Inputfield Dependencies module. I found problems with several of the inputfield visibility options when used with fieldset inputfields, and created a GitHub issue here: https://github.com/processwire/processwire-issues/issues/441 This is deliberate. It would be pretty easy for the module to hide inputfields via CSS, but by not rendering the inputfields the module allows for cases where it is critical that the inputfields not be seen or modified. The core inputfield dependencies feature works in response to other field values entered in Page Edit and hides/shows inputfields immediately. Therefore the core feature can only hide/show fields via JS and CSS, which may be manipulated by the user using their browser dev tools, or may fail if a JS error occurs. But the Custom Inputfield Dependencies module applies the dependencies via PHP before Page Edit is rendered, so I think it is an advantage to not render hidden fields at all. Hopefully the core inputfield visibility problems with fieldsets will be fixed, however I will also look at whether a workaround is possible within the module. In the meantime, I don't think the visibility dependency you want to set up requires Custom Inputfield Dependencies. You can achieve this using only the core inputfield dependency feature by setting the following for "Show this field only if": proj_code_valid=11 point
-
Welcome to the forum @rareyush ... Sanitizer can help in this case which cleans up the text. https://processwire.com/api/variables/sanitizer/ https://processwire.com/api/ref/sanitizer/ https://processwire.com/api/ref/sanitizer/text/ Try the following: $p_body = $sanitizer->text($key->body,['maxLength' => 250]); echo "<p>{$p_body}</p>";1 point
-
Hi @Donald, I recently used this Module and may have some tips, but I don't know it as well as others: I was able to send as many tests as I liked, as long as I had settings: Minimum time: 1 Maximum time: 300 (i.e. large) Restrict submissions: 300 (i.e. large) Exclude IP: 127.0.0.1 Sorry if you have tried exactly this and it doesn't help. In the GUI Admin, click Setup > Logs > simplecontactform-log This is a bit more involved, but essentially read the docs where it tells you how to use an 'options' array, populated with settings. One of the settings in naming the form and naming the fields that form is able to use. Then elsewhere in your template or another template, you do the same but the contents of the 'options' array is different, naming different fields from those available listed in the Module (where you add them). Essentially the Module GUI allows you to insert any fields that will be used across one or more forms and it's the calling of the forms in your code that determines which fields are rendered and used. I think I have got this correct and I hope it's helpful, very sorry if not. Good luck!1 point
-
https://github.com/kongondo/MenuBuilder#api render() This method renders a menu/navigation list of a specified menu. The method accepts two arguments/parameters: render($menu, $options); The first argument is not optional and can be a Page object, a title, name or id of a menu or an array of menu items returned from a menu's menu_items field. Note that for multilingual environments, you cannot pass the method a title or a name; only the other three choices will work. The second argument is an optional array and will fall back to defaults if no user configurations are passed to the method. @thmsnhl That should resolve your issue .1 point
-
Took it one step further, and with a bit of hackery on the templates and the module file, got my sidebar in and various other tweaks. Not properly responsive, breaks some theme settings, the breadcrumbs are ropey, the sidebar is not full height (or fixed), less needs serious refactoring. Not sure why the masthead is a fixed height, but anyway, this is what I want my admin theme to look like I personally think you don't need theme settings for layout, for me it just makes the admin theme harder to tweak. Why not just have a theme that does one thing? I don't want to use jquery layout, or any fly in anythings, other than the sidebar on mobile. It doesn't need to be overcomplicated. Would be awesome to get something like this working properly so it could be a proper admin theme. I'm a bit stuck on the php side of things, I can handle the less (need more practice with uikit though for sure). I'm more than willing to team up with someone if they like the idea/look of this.1 point
-
Thanks @Samc and @maxf5, you gave me an idea about the future of my AdminOnSteroids module, rewriting it as an admin theme. This has been come up earlier too but there was no Uikit theme then, now it's perhaps more easy to do this.1 point
-
Thanks for the clarification @Robin S. I appreciate the comments, they are helpful. The things that I was unsure about I have asked for clarification and you've provided this. I am passionate about all my modules, both commercial and free. I would never knowingly release a module that is half-finished . In this regard though, I must apologise to all VPS users because there has been an oversight on my part. I'll explain in a minute. My workflow is that I develop my modules in ProcessWire 2.7 using Reno Theme. I then test in the default admin theme. When I have everything working and looking as it should (PHP, JS, CSS, inside repeaters, etc), I repeat the process in ProcessWire 3.x. There are some cases where I even have Reno Theme-specific CSS classes, to make sure everything works fine irrespective of the theme. In the case of the last version of VPS, I now realise, I forgot to test using default theme in ProcessWire 3.x and for this I apologise to all of you. I am glad Robin caught this. I am equally very curious why others didn't notice this. It can only mean, either you don't use the default theme, or mainly use ProcessWire 2.7 or etc? Either way, I will fix this. And it is Robin. Please don't hold back! Like I said, I was unsure about some statements and you've clarified them. To all, please, don't hold back on the feedback. Not wanting to repeat this statement everywhere, this goes not just for VPS, but for all my modules, free and commercial. However, I can't promise to implement every suggestion since I need to consider things like backward compatibility.1 point
-
@flydev : More beta-tester needed ! Hello can I test your module? I have a lot of sites , someone heavy, so I can test and report1 point
-
@flydev I'd like to test too. (Especially after I tried to set up backup/sync cron jobs via a server's crappy control panel where everything just works half-baked...)1 point
-
Hi, just stumbled over a little module that i built for my last project. it helped me to test performance of my rockdatatables module to generate 3000 random json datasets and i want to share it with you. maybe it saves some time for someone. https://gitlab.com/baumrock/RockDummyData/ easy example: $rdd = $modules->get('RockDummyData'); for($i=0; $i<15; $i++) { // this has to be inside the for-loop to always get a new dummy $dummy = $rdd->getDummy(); echo date("d.m.Y H:i:s", $dummy->timestamp) . "<br>"; } more advanced: $json = new stdClass(); $json->data = array(); $rdd = $modules->get('RockDummyData'); for($i=0; $i<3000; $i++) { // this has to be inside the for-loop to always get a new dummy $dummy = $rdd->getDummy(); $obj = new stdClass(); $obj->name = $dummy->forename . ' ' . $dummy->surname; $obj->position = $dummy->job; $obj->office = $dummy->city; $obj->color = $dummy->color; $obj->start_date = new stdClass(); $obj->start_date->display = date('d.m.Y',$dummy->timestamp); $obj->start_date->sort = $dummy->timestamp; $obj->salary = rand(0,10000); $json->data[] = $obj; } echo json_encode($json); you have to store your random datasets on your own into the /data folder. there are several services for creating all kinds of random data on the web - if you know one service that allows sharing those datasets let me know and i can include common needed data into the module1 point