All Activity

This stream auto-updates   

  1. Past hour
  2. Regarding your first issue: and in mystyles.js: CKEDITOR.stylesSet.add( 'mystyles', [ { name: 'Warning Paragraph', element: 'p', attributes: {'class': 'uk-alert-warning', 'data-uk-alert': ''} }, { name: 'Success Paragraph', element: 'p', attributes: {'class': 'uk-alert-success', 'data-uk-alert': ''} } ]); This setup works for me in ProcessWire 3.0.62. Is it what you are looking for? Also, something like this is my config-body.js: I have not yet worked with contents.css/contents-inline.css, it is still on my todo list...
  3. As pictures speak thousand words, here it is nicely illustrated And plugin: (function() { CKEDITOR.plugins.add('pwimage', { requires: 'dialog', init: function(editor) { var pluginName = 'pwimage'; // These are the allowed and required elements & attributes for images. // It should clean all other classes but hidpi and three align classes that are generated by ProcessWire var allowed = 'img[alt,id,!src,title,width](uk-align-left,uk-align-center,uk-align-right,hidpi,align-left,align-center,align-right);' + 'a[!href];' + 'figure{width}(uk-align-left,uk-align-center,uk-align-right,hidpi,align-left,align-center,align-right);' + 'figcaption;'; var required = 'img[alt,src]';
  4. I have few issues with CKEditor customisation. PW 3.0.68 here. First, I wish to have custom styles in the bar and I have followed the instructions here. However, my styles still do not appear. Is there a field that needs to be enabled as well and where? Second, when inserting images with pwimage plugin there are style names that I wish to change, for example align_left to uk-align-left. I have copied plugin from wire folder to site, as instructed in 'plugins' section of field input properties. I have changed the styles, but now when aligning image none of the styles are there (not even the original). When I look at the source code, there is no 'class' attribute, although it still respects 'alt' attribute that can be changed via plugin. Any help appreciated.
  5. Today
  6. Update: Runtime Markup Version 0.0.3. Changelog Added support to render PHP, JavaScript and CSS files Thanks to @bernhard for the ideas. Please note: Please read the notes that accompany the field settings. For PHP, you can choose to render files (recommended) vs paste code. JavaScript and CSS work with either PHP rendering method (above). These are optional to use. For each of the 3 file types above, if you only have one file and this is named identical to your field, you can select an option to have those rendered/added. For example, if you have a RuntimeMarkup field called 'my_field', you can have a 'my_field.php', 'my_field.js' and 'my_field.css' automatically rendered/added. However, if you want to render multiple files and/or these are named differently, select the option that indicates the files have different names. In that case, enter comma-separated file names. For example, for CSS: my_css, styles/my-other-css-file. The above can be mixed and matched, e.g. PHP file could have name identical to field but JavaScript are multiple files with different names and CSS multiple file names, one of which could share a name with your field. All files must descend from either of the root paths /site/templates/ or /site/modules/. It is OK for files to be in sub-folders, as long as those descend from one of these root paths. There is a setting to indicate root path. Only one root path can be used at a time, i.e. it applies to all file types. .php, .js and .css extensions are assumed and do not need to be specified with the file names. PHP files such as .inc will need to be input as such, e.g. my_code.inc,includes/my-more-code.tpl. Errors will be shown if files not found. In your rendered PHP file, you have access to $page and $pages. This means you do not need to get the page being edited first to use it as the current page. For frontend, only pasted PHP code option is supported. My take is that this module is primarily used for the backend. Use of the render files option is geared for creating complex and/or more flexible backend apps as opposed to frontend usage. I have no intention of changing this behaviour. Currently available on dev branch only. Please test and let me know (with Listers, etc as well, thanks). Screenshots Backend Settings Backend Output
  7. Actually the intro to the article you linked was just what I needed. I guess I should have been more thoughtful about having an option to use translation context. If I just edit the files like this: it works. I can simply edit the template files in Language translator since the compiled templates also inherit the translation context, dummy me. Thanks a lot
  8. Just a quick note: remove the hints in the function, otherwise it won't work: function getFieldsetOf($context, $fieldsetName, $collectValues = false, $fieldsetCloseIdentifier = '_END'); // this will work function getFieldsetOf($context, String $fieldsetName, bool $collectValues = false, $fieldsetCloseIdentifier = '_END'); // this won't at least not with the latest PW dev on PHP 7.0.9 example function call: $fieldSet_import = getFieldsetOf($templates->get('project'), 'import_only', false, $fieldsetCloseIdentifier = '_END');
  9. This module is great, thanks for sharing it. I am missing one thing that I would like to hear if it could be integrated. What I really would like to see, is what data has been changed. Just the data value. So when an input field changes value, I would like to know what that value is.
  10. Thank you! That sounds like a big issue... And very strange. Hope you find it out soon
  11. I never used Blade, so I don't even know if that's an option, but can you tell Blade to not create that cache file in the first place? If that's not possible, try to disable cache in your template(s). Alternative multilang approaches are described here: And then there's also the recently added functional fields (never used it myself so far): https://processwire.com/blog/posts/functional-fields/
  12. Hi @Martijn Geerts, Thanks for this module. I'm wanting to explore using it with a custom module that extends ProcessPageLister but the way the module checks if the page ID supplied to the url() method has the correct process is a stumbling block. In the module there is this test... if (strpos('ProcessPageListerPro', $listerPage->process) !== false) return $listerPage; ...which seems like a weird way to check that the process is okay. For instance, a process named 'age' would pass this test. And any process that has a different name yet may still be an instance of ProcessPageLister fails the test. How about a different test? $process_module = $this->modules->get($listerPage->process); if($process_module instanceof ProcessPageLister) return $listerPage;
  13. Thank you all, for the quick Response.
  14. Yesterday
  15. Exactly what I was looking for, thanks
  16. This is what I was after. $testimonials = $pages->get(1019)->testimonials->find("limit=5, sort=random"); Credit to @adrian:
  17. I've got a testimonials page, now I wanted to print a few (say 4) to the homepage. So I managed to grab them all: <div class='container'> <div class='row py-5'> <div class='col-sm-12 col-md-6 px-lg-5'> <?php $testimonials = $pages->get(1019)->testimonials; // how to limit here? $testimonials->shuffle(); $firstTestimonial = $testimonials->shift(); ?> <?php foreach($testimonials as $index => $testimonial): ?> <?php if($index == ceil(count($testimonials) / 2)): ?> </div> <div class='col-sm-12 col-md-6 px-lg-5'> <?php endif; ?> <h2 class='py-3'><?= $testimonial->title; ?></h2> <p><?= $testimonial->testimonialBody; ?></p> <p class="font-weight-bold"> <i><?= $testimonial->testimonialReviewee; ?> - Review from <a href='<?= $testimonial->reviewSitePageRef->reviewSiteURL; ?>' target='_blank'><?= $testimonial->reviewSitePageRef->title; ?></a> </i> </p> <?php endforeach; ?> </div> </div> </div> Problem is I've been reading through the docs and can't see a way of limiting the returned results (when using get, it returns a single page so I guess there's nothing to filter). If I were to use $pages->find I can use 'limit=4' in the selector but the testimonials aren't pages, they are a repeater on a single page, hence I thought $pages->get was a good idea. Would it be better to use $page->get("field") or something like that instead, rather than getting the testimonials page itself? Or this? http://cheatsheet.processwire.com/templates/template-properties/template-fields/ Any advice would be awesome, thanks.
  18. For modules you could use the module toolkit module. Though it would be nice to have one place to go to export everything.
  19. Hello, recently i came across this issue. Basically, I am using TemplateEngineBlade module which allows me to use Blade templating engine in my templates. I needed to translate strings like '__(<your string>)', but since the module compiles the templates into its own directory (as highlighted in screenshots), the language translator find the function call in 2 files: Template where the code is written Modules 'compiled'/cache directory where the templates are in their compiled state Now, I actually have to translate the string in its compiled directory else it doesn't work at all. But since that filename changes often it is not usable at all. I tryed prepending all templates with a file (for example _init.php) and getting all translatable strings there which works but not for the use cases where i need to get same string translated in multiple languages in a single page - I would have to create separate variables. Does anyone have any idea which would help me work around my issue? Thanks
  20. Module

    That explains a lot For the sites I migrate to PW option 1 would me my choice, because importing the content is the first priority and editing the content comes later. Nobody wants to sift through a few hundred pages to make it all like it was. In my case editors are skilled, trusted and would be fired if they do monkeybusiness with the HTML. ...but then again... option 2 would work as well since I already deactivated all the purifier options for the fields anyway. For now I will go with the dirty fix
  21. Module

    I do use the $sanitizer->purify option with all content added via BCE, so that will be the source of the problem for sure. I can see two possible options here. 1) Add a BCE config setting to enable you to turn off the purifier sitewide and/or per parent page. 2) Check the purifier status for the field that the content is being added to and respect that. Any thoughts? PS if you want a quick fix, just edit this line: https://github.com/adrianbj/BatchChildEditor/blob/ba228d2f011d306345f02ec4aa19d090f2d89481/BatchChildEditor.module#L1448
  22. Hey @bernhard - I spent quite a bit of time looking into this the other day with no success. It turns out it's not just hooks inside ready.php - it seems like ready.php is never called at all from the Tracy console panel. I will investigate further, but so far a bit of a mystery. I thought perhaps it was an issue with ajax calls (which the console panel uses), but a normal ajax call results in ready.php being called, so really not sure at the moment. I'll see what I can figure out. Cheers, Adrian
  23. Any solution for this i am also getting same error SQLSTATE[42000]: Syntax error or access violation: 1069 Too many keys specified; max 64 keys allowed my web site have 32 language. I contact with host about upgrade the limit but i still waiting. Is there any thing i can do? What is the limitation of the language number for this?
  24. Thanks for the explanation @Robin S, you're a gent! I understand it now, final code: <?php namespace ProcessWire; ?> <?php $testimonials = $page->testimonials; $testimonials->shuffle(); $firstTestimonial = $testimonials->shift(); ?> <div class="jumbotron jumbotron-fluid bg-color"> <div class="container"> <h2><?= $firstTestimonial->title; ?></h2> <p><?= $firstTestimonial->testimonialBody; ?></p> <p class="font-weight-bold"> <i><?= $firstTestimonial->testimonialReviewee; ?> - Review from <a href='<?= $firstTestimonial->reviewSitePageRef->reviewSiteURL; ?>' target='_blank'> <?= $firstTestimonial->reviewSitePageRef->title; ?></a> </i> </p> </div> </div> <div class='container'> <div class='row py-5'> <div class='col-sm-12 col-md-6 px-lg-5'> <?php foreach($testimonials as $index => $testimonial): ?> <?php if($index == ceil(count($testimonials) / 2)): ?> </div> <div class='col-sm-12 col-md-6 px-lg-5'> <?php endif; ?> <h2 class='py-3'><?= $testimonial->title; ?></h2> <p><?= $testimonial->testimonialBody; ?></p> <p class="font-weight-bold"> <i><?= $testimonial->testimonialReviewee; ?> - Review from <a href='<?= $testimonial->reviewSitePageRef->reviewSiteURL; ?>' target='_blank'> <?= $testimonial->reviewSitePageRef->title; ?></a> </i> </p> <?php endforeach; ?> </div> </div> </div> I see that shift() removes the first item of an array and returns it so seems a neat way to extract the first item leaving the rest in the original array. Found the guide here: https://processwire.com/api/arrays/page/ Anyway, thanks again On a side note, I also found a 404 on the PW site where I would have expected a page: 1) Go to https://processwire.com/api/ref/ 2) Choose something from dropdown, say $page, takes you here: https://processwire.com/api/ref/page/ 3) Back to dropdown, choose 'API Reference...' at the very top (I wanted to go back to the root at https://processwire.com/api/ref/ ) 4) Takes you here instead: https://processwire.com/api/ref/class-loader/API Reference … Maybe someone can have a look. Might be intended behaviour but thought I'd mention it.
  25. Module

    Me again... I imported a few hundred pages to more than 30 parents and almost everthing is fine. Then I noticed that all custom ids and classes in my imported textareas were filtered out during save, even with deactivated ACF and HTML Purifier(in textareas settings) Pasting in the same HTML in source mode afterwards leaves the custum stuff alone. So it works. I don't even know wether it's a BCE issue or with Profields textareas? This problem seems familiar but I can't remember...
  26. Hi Wanze, Thanks again for this module, have been really enjoying using it. Have run into a slight issue on a new site where my layout file is getting read but the views files themselves (set in `templates/views` ) aren't outputting anything. I have made sure that the factory module is using Twig and have tried deleting the cache but nothing is outputting from the views folder. I'm pretty sure my paths are correct. Do you have any good ways to debug? Thanks!
  27. module

    I have just tested @owzim's other great module InputfieldAceExtended which works perfectly if we want to use syntax highlighting for YAML. However, @Robin S's suggestion to fix the error changes the Details Tab, making it impossible to configure the InputField Type as seen in the screenshots below: original: after applying the suggestion:
  28. @adrian do you think you can have a look why the hooks inside ready.php are not applied when executed from the tracy console? i had an issue again today... i wanted to test a simple property hook and got an error. i think that's quite a big issue because imho the panel code should just execute as if it were executed inside a template or module. and i guess testing hooks, functions, creating pages via the console etc. is a VERY common usecase for tracy-users... // get group of given fbrole $wire->addHookProperty('Page::group', function($event) { d('test'); $page = $event->object; if($page->template != 'fbrole') return; $event->return = $this->pages->get(1634); }); log (first from ready.php, then from init.php):
  1. Load more activity