-
Posts
1,473 -
Joined
-
Last visited
-
Days Won
16
Everything posted by Ivan Gretsky
-
So true! And I can't believe it is not in the modules directory yet))) Hope that Adrian will find time for it eventually. This module deserves its place in the top rankings (if not in the core).
-
You got to use $input->whitelist.
-
Hey, @jds43! You should be able to just add 'baseUrl' => '', to the options array above.
-
Just recently @ryan presented a little module for making batch user role assignment with lister easier. You can already batch send emails to users from lister. I am not sure we can expect such a module to be developed quickly, so would suggest adding functionality to lister with action modules. But you can probably hire Ryan to build this module (or some of its parts) if that is affordable.
-
Good day! I am putting @adrian's TracDebugger's bd() in a Hanna Code and it seem to be running 3 times while rendering only one Hanna code item. Why is that?
-
One way would be to give them labels sorted in alphabetical order. Something like: 01 - Most used template (a label for most_used_template) 02 - Not so much used template (a label for not_so_much_used_template)
-
CKEditor 5 is a completely different kind of editor. It doesn't store the entered text/markup as is, but rather transforms it to it's in built data model. The transition to it would probably be pretty complicated if possible. Things like text formatters, image plugin and a lot of textarea-related stuff would probably have to be redesigned. So do not think it is going to happen soon (but Ryan can surprise us like he did a million times)))
-
1. Change this AOS module setting as you wish: 2. Add templates definitions to that file (as described here or here).
-
You can try CKEditor content templates. I think you can get it into your system with AOS module.
-
Sounds like a minor thing in the end just to finish the post, unless it's your issue, your site falls apart without it being solved) Thanks!
-
Changing the condition to use a super global variable indeed helped me to prevent _init.php from running once again. But in this case the TemplateFile object doesn't get any variables from _init.php which it need to render correctly. I thought, that I need to move all the code to another hook before the Page:render. So I made PageRender::beforeRenderPage hookable and moved the code there. But that still didn't work. I am definitely lost here((
-
Actually, if there is no more than one CKEditor field in a Repeater item, custom styles should work. Check it out again. But when there are more, I know no solution. Please give a thumb up to the issue and write a comment, so @ryan gets a notification. I has been a while without anything new on this issue, so your voice could make a difference)
-
I think, you could use MarkupPagerNav module directly with specific options. renderPager() function calls it internally like this. I guess, you need to adjust the baseUrl option.
-
Seems like double-posting worked for you better in this topic, @Jessie) Anyway, please do not double post not to clutter the forum)
-
No direct answer from me) Just googled that and this seems to be something you might want to take a look at.
-
Hi @Jessie! When does the error happen exactly? When you ad the field to the template? When you create the field?
-
function _x() not working within custom functions
Ivan Gretsky replied to froot's topic in API & Templates
How are you including this function? Is it in ProcessWire namespace? -
If it is only one project per user, you could use this module. If you need to grant a user access to 2 or more branches, you probably need to hide the tree of pages to that user and display accessible pages with a custom module. I hope I understood your question properly)
-
I checked my site that had custom styles. This is what I have there in site/modules/InputfieldCKEditor/mystyles.js: CKEDITOR.stylesSet.add( 'mystyles', [ { name: 'Inline Code', element: 'code' }, { name: 'Inline Quotation', element: 'q' }, { name: 'Left Aligned Photo', element: 'img', attributes: { 'class': 'align_left' } }, { name: 'Right Aligned Photo', element: 'img', attributes: { 'class': 'align_right' } }, { name: 'Centered Photo', element: 'img', attributes: { 'class': 'align_center' } }, { name: 'Small', element: 'small' }, { name: 'Deleted Text', element: 'del' }, { name: 'Inserted Text', element: 'ins' }, { name: 'Cited Work', element: 'cite' }, { name: 'Left Heading', element: 'h2', attributes: { 'class': 'u-align-left' } }, { name: 'Right Heading', element: 'h2', attributes: { 'class': 'u-align-right' } }, { name: 'Important', element: 'div', attributes: { 'class': 'u-important u-important--brand' } }, { name: 'Bordered Table', element: 'div', attributes: { 'class': 'u-table-bordered' } } ]); My added styles are at the end of the list. They do work, if there is only one CKEditor field on the page edited (see this issue). Also keep in mind, that the styles for ul elements are only shown when this type of element is selected in the editor working area. P.S. If everything works out, don't forget to add you custom styles to site/modules/InputfieldCKEditor/contents.css or site/modules/InputfieldCKEditor/contents-inline.css so they display as they should: ... .u-important--brand { font-size: 21px; line-height: 1.3; padding-left: 40px; } .u-table-bordered { color: blue; }
-
Search selectors and empty repetear fields
Ivan Gretsky replied to lele_ballack's topic in General Support
Maybe something as simple as this will do? if(isset($input->get->q) && !empty($input->get->q)) { ... -
Good day! I am trying to do a frontend check in a Page::render hook and return completely different markup on condition: <?php // This is site/ready.php wire()->addHookAfter('Page::render', function (HookEvent $event) { $page = $event->object; ... //Some condition here $config = wire("config"); $t = new ProcessWire\TemplateFile($config->paths->templates . "test.php"); $t->setArray(array( 'page' => wire()->pages->get("1234"), ) ); $t->setPrependFilename($config->paths->templates . '_init.php'); $t->setAppendFilename($config->paths->templates . '_main.php'); $out = $t->render(); $event->return = $out; } But I get this error: Cannot redeclare SomeFubction() (previously declared in ...\site\templates\_func.php:123) _func.php is included with include_once in _init.php. But somehow _init.php happens to run twice. Can't get my head around this one. Please help!
-
Getting the page title a repeater field is on from a pageField
Ivan Gretsky replied to a-ok's topic in General Support
Resurrecting this is an old topic) Is there now an easy way to use the title of a page a repeater field is on in a Custom Page Label Format? Like {getForPage.title} with a special keyword? Probably like {parent.title}, which works. I solved the problem with the hook, but it could've been easier)