Jump to content

All Activity

This stream auto-updates     

  1. Past hour
  2. Disclaimer: please note that this is how I am doing it, it may or may not suit you, so take it with a grain of salt. Also, I apologize for not obeying ProcessWire's code style, I'm just too old and it feels alien to me. Thing I'm trying to get: not having to input the 'Custom Editor CSS File ...' and 'Custom Editor JS Styles Set ....' for each of the fields using CKEditor. Yeah, I know, call me lazy or sloppy or whatever, it is what it is ๐Ÿ˜„ . having the front end styles in the editor container, so the one editing the page would be able to eyeball the styling of the content while stayin in the editor For the first objective I tried to find a way in the CKEditor configuration options, like config.js, or at least a single point to set my options. In the end, what worked for me was hooking the Inputfield in ready.php: if (strpos($_SERVER['REQUEST_URI'], $config->urls->admin) !== 0) { // things I do to frontend pages, believe me, you don't want to know :D } else { $wire->addHookBefore('InputfieldWrapper::renderInputfield', function($event) { // process further if it is an InputfieldCKEditor if (strpos($event->arguments(0)->className(), 'InputfieldCKEditor') === 0) { // store the Inputfield $inputfield = $event->arguments(0); // my custom CKEditor options $my_settings = [ 'contentsCss' => '/site/assets/css/cke.css', 'contentsInlineCss' => '/site/assets/css/cke_inline.css', 'stylesSet' => 'mystyles:/site/modules/InputfieldCKEditor/mystyles.js', 'extraAllowedContent' => '*[id](*); audio[src,controls,preload]; source[src,type]; button[title]; script; i[data-feather]; svg[xmlns,height,width]; path[d,fill,stroke]', ]; // for each option, check if it's empty and if it is set it to the custom value foreach ($my_settings as $key => $value) { if (empty($inputfield->get($key))) { $inputfield->set($key, $value); } } // get the changes into $event $event->arguments(0, $inputfield); } }); } Now, my CSS files are generated by Sass in the /site/assets/css/ directory, because of the second objective. Thus, I'm including the frontend CSS in three places: the two custom CSS files used by CKeditor in regular/inline mode and defined above ('contentsCss' and 'contentsInlineCss' options), and my custom CSS file used by admin.php. The regular mode CSS files contains: // cke.sass - Sass syntax @import "main" where main.sass is my frontend Sass file (I have a real talent for names, I know). So it includes all the frontend styles in the regular CKEditor iframe. The inline mode CSS file contains: // cke_inline.sass .cke_editable_inline @import "main" This way the frontend styles are applied only to elements inside the CKEditor inline container. I know I'm tying myself to the CKEditor markup, but as you may have noticed by now, I'm quite eager to sell myself in slavery for a bit of convenience ๐Ÿ˜„ . The admin styles are built the same, changing only the container class and adding some styles to increase readability: // admin.sass /* force a min width for CKEditor combo, so I can read the text */ .cke_combopanel min-height: 21rem min-width: 25rem > iframe height: 100% !important .cke @import "main" The resulting /site/assets/css/admin.css file is loaded by /site/templates/admin.php by adding $config->styles->add($config->urls->assets.'css/admin.css'); before the require($config->paths->adminTemplates . 'controller.php'); line. Lo and behold, Bulma styles available in the editor toolbar and container (there's a short clip attached). Well, this should be it. I hope it helps someone. If you know a better way to do this or if you notice a mistake, by all means, let me know. Thank you for following me until now - here's the medal you rightly deserve: ๐Ÿฅ‡ ckeditor-2020-04-10-161245.mp4
  3. Sorry to bring this back up but I'm still having issues. I looked at the module at how it's grabbing the feed and tested it in a Tracy console and it returned false... $http = new WireHttp(); $xmlData = $http->get("https://insidemodernism.co.uk/feed/"); $rss = simplexml_load_string($xmlData); bdb($rss); Any further thoughts?
  4. Today
  5. Hi Aleksey, one way to add a new article page would be: Open any existing article for editing and save it with the option "Save + Add New". The new page will automatically get the same template like the sibling one getting saved. But if there's no need for more than a few different categories, why not use an own template for each category? (And make benefit of the family settings). Good luck ottogal
  6. But ProcessWireโ€™s WireShutdown class considers everything hitting it with X-Requested-With: XMLHttpRequest to be CLI use. The way I see it, from a security perspective that makes the differentiation between public and detailed error messages completely useless: if youโ€™re shown the public error, you can just resend the request with the header and any PW installation will gladly tell all. It kinda didnโ€™t occur to me to even look through the source, because I figured something like this would have a prominent setting somewhere, but now I think it just might be a bug? WireShutdown does this: $useHTML = isset($_SERVER['HTTP_HOST']); // is this an HTTP request where we can output HTML? [โ€ฆ] // use text-only output if an http request that is ajax if($useHTML && $config->ajax) $useHTML = false; [โ€ฆ] if($config->debug) { $why = $this->labels['debug-mode'] . " (\$config->debug = true; => /site/config.php)."; } else if(!$useHTML) { $why = $this->labels['cli-mode']; } [โ€ฆ] if($why) { $why = $this->labels['shown-because'] . " $why $who"; $message = $this->amendErrorMessage($message); $this->sendErrorMessage($message, $why, $useHTML); } else { $this->sendFatalError($who, $useHTML); } So for this purpose, sending two headers in your request is essentially equivalent to the site being in debug mode. That canโ€™t be right?
  7. Hi @Mike Rockett first let me repeat what I told you two years ago: Thank you for the Jumplinks module! This is one of the big life savers when it comes to run a real-world website, IMHO. Great job, thanks for maintaining this project! Thought it was time to update the module from 1.5.50 to 1.5.60. Same happened to me what was reported here: I don't feel very comfortable with patching databases myself, but as it's just a test site I fired up phpMyAdmin. The proposed workaround: fixed the problem for me. Of course, besides the 404 log was empty, all the "Last hit" information was gone. No problem on a test site, but I don't want to loose this information on the production site. Any ideas on a better way to handle this?
  8. diogo

    ED works new site

    Thanks Jonatan! It's so great to receive such compliment ๐Ÿ™‚
  9. Hi @jonatan, Nice one! No thanks required - you've highlighted issues which has made the module significantly better! Cheers, Chris
  10. thank you @bernhard, thank you @Sephiroth. Now I know it is worth to learn the basics and more. I look forward to get my handys dirty in "hello worlds". @Sephiroth, I am interested in your PW video content for my education. Now am busy reading the resources for beginners. Enough for me right now ๐Ÿ‘
  11. Hi @LAPS, I've added a setCampaign() method. It is essentially an alias for addTags(), but takes multiple string arguments instead of an array like addTags(). <?php $mg->to("an@email.com") ->subject"A Subject") ->setCampaign("campaign1", "campaign1-a", "testing") ->bodyHTML("<p>A Message</p>") ->send(); It also enables open and click tracking by default, as this is presumably behaviour you want for campaign analytics. If this isn't required, using addTags() is the way to go, but you can also pass false as the first argument to disable this behaviour and use whatever tracking settings you have by default. Cheers, Chris
  12. Exactly, however *shameless insert* , I am working on Screencasting and creating Processwire video contents both for beginners till Advanced level, a bit of me is wondering if it is something that will received by the community. I am currently honing my Video editing skills back. Do you think the community might find this useful. I have always wanted to contribute PW resources since I tend to spend alot of time around the code. Thanks
  13. Depends on what you call "serious" but it will be quite a bit of work for sure. IMHO buying FormBuilder will not be enough. What's more important is that you get a good understanding of how PW works. What is a ProcessModule? What is an Inputfield? What a Fieldtype? How does all this play together? Once you get that you can build anything with PW.
  14. Here "content" is my repeater matrix field. See the first dump - it shows the selector used. If you take that selector you get all items (including unpublished). If you do a status>1 you'll get all that are not regularly published (means hidden etc). Doing status>= Page::statusUnpublished would show only unpublished items (not sure if that makes a difference to status>1). And I'm also sceptical if repeaters are the best option here compared to using regular pages ๐Ÿ™‚
  15. thank you Sepiroth! Seems I got to hone my PW skills
  16. Sure http://reader.romanga.ro/ If you scroll you'll notice the entire content is doubled, I just don't have the time to work on this. I'm still looking for other scripts.
  17. Hi! ๐Ÿ™‚ I tried searching for this, but couldn't find anything on on it... How can I get the deactivated / turned off repeater items? Why? Because I want to use it as an "archive" function, so that the toggle-off makes them show up under "previous events", and when toggled-on they'll show up under "Current events" All the best, Jonatan.
  18. Update: found module Hi! Is it possible to specify explicitly the parent section when creating a new child page with a single template? The idea is to save the user from the possibility of mistakenly choosing a section, but not to create unnecessary identical templates What I mean: Let's say I've got 2 parent categories with names articles & news. Each of them utilized the same admin-template (category) with the category.php file. Also, I have 2 different templates for child pages (article & news). Next, I need to add an article page to the articles category with the "create new" button in admin. At that moment, I must choose the category to place (because both categories use the same template). To runaround this (and create a page right into the exact category without the choosing step) I should create 2 templates for each category, and setup parent-children relations for each pair of templates, right? But Is any way to use only the one category template and different children templates and at the same time, explicitly specify which section to use for child pages, thereby removing the process of selecting a child section? articles (category.php) Article page 1 (page-article.php) Article page 2 (page-article.php) Article page 3 (page-article.php) + Add a new article page here without category chooser news (category.php) News page 1 (page-news.php) News page 2 (page-news.php) News page 3 (page-news.php)
  19. Hi @bramwolf, Could you solve the problem? I also need to integrate a payment module in an existing Processwire installation. Can you share how you did it?
  20. Nevermind, Fixed it: var postnum = <?php echo $postsnum; ?>; // Show spinner if (this$1.total < postnum){ this$1.$loading.show(); } ๐Ÿ˜„
  21. Oooonly thing now though, is that the loading element still keeps showing up, when there's no more content to load ๐Ÿ˜Š
  22. HEUREKA!!! ๐Ÿ’ฅ ๐ŸŽ‰ โœจ No idea what the difference is... but I updated the code and without even looking at the log it just worked perfectly now!! ๐Ÿ˜ƒ๐Ÿ˜ƒ๐Ÿ˜ƒ๐Ÿ˜ƒ Tadaaaa: rec-Wi-Fi High.mp4 I am so so so glad for all of the massive help that you've given me Criss @nbcommunication!!! ๐Ÿ˜ƒ Really could never have gotten even close to getting it working without you and the nice module! I am so glad! Can I please buy you a beer or a coffee?? ๐Ÿบโ˜•I'd love to thank you somehow! ๐Ÿ˜ƒ All the best, Jonatan.
  23. Yesterday
  24. Hi. I had the same problem like @fliwire with changed resource property in template context not getting saved and outputted correctly. I changed the FieldtypeMystique::getBlankValue() method a bit: public function getBlankValue(Page $page, Field $field) { return new MystiqueValue($page, $page->template->fieldgroup->getField($field,true)); } API Ref: https://processwire.com/api/ref/fieldgroup/get-field/ With this change you are getting the field in context of the current page template. Then you have the correct resource filename in $field->resource. This works here in my setup, but I haven't been able to test much for now. Hope this does not break something else. Anyway, thanks for this module. Looks very promising!
  25. jonatan

    ED works new site

    Absolutely love your website @diogo! I've looked at it multiple times for inspiration! Such a nice and inspiring portfolio!
  26. You're very welcome - thanks for spotting and reporting the bug ๐Ÿ™‚
  27. um - yes, those pages not counted in were hidden. So ... quick test ... 2.0.7 fixed the problem for me! @adrian your awesomeness is shining brightly! ๐Ÿ‘ Thank you very much indeed.
  28. ... ...and show it visually! Following is a snippet, not a tutorial. But maybe it is useful for someone. Everyone knows the possibility to define a checkbox as required. However, a submit button would then visually execute the click movements and show the active color on hover. Depending on the status of the checkbox, you can either disable the functionality of the submit button via CSS ( pointer-events: none; ), or display a not-allowed cursor. But IMO, each of the two is asking for the other. If you embed the button in a wrapper element, you can marry both of them together. <fieldset class='gdprconsent'> <input type='checkbox' name='gdprconsent' id='gdprconsent' required='required' autocomplete='off' /> <label for='gdprconsent'>I agree to the privacy policy.</label> <div class='submitWrapper'> <input type='submit' name='submit' id='submit' value='Senden'> </div> </fieldset> #gdprconsent:not(:checked) ~ div.submitWrapper { cursor: not-allowed; } #gdprconsent:not(:checked) ~ div.submitWrapper > input[type='submit'] { pointer-events: none; } #gdprconsent:checked ~ div.submitWrapper > input[type='submit'] { cursor: pointer; }
  1. Load more activity
ร—
ร—
  • Create New...