-
Posts
1,459 -
Joined
-
Last visited
-
Days Won
16
Everything posted by Ivan Gretsky
-
Omit access check in (showif) field dependencies?
Ivan Gretsky replied to kater's topic in API & Templates
This should be possible to do with a hook. Look here for inspiration. Or just search for something like "hook admin inputfield show" (preferably, in Google) -
The hook priority did the trick! Thanks @adrian! I have found the post about the module autoload order. But it did not help me as you predicted (still not quite sure why, though).
-
As of now I am a user of this feature too) Thanks to @adrian's link. I did need it to fix this issue. If you read through the linked thread you'll see that I confused module autoload order with hook order. Actually I thought that the module, that gets loaded first, would add the hook first (or last). So the autoload order would affect hook order. I did play with autoload order of the modules without success. Why is it not it the case? If it was, there could a chance to add an option to override module autoload order in admin, making it adjustable without code hacks , solving this question.
-
Oh, I see. I've indeed confused the two. So looking at the thread it seems I need to modify the modules code, right? No way to sort'em afterwards? Sorry for asking the questions in the wrong thread))
-
Cool! I was sure it has made it's way into the core though, so was looking in the blog posts... Or was it just your Tracy Debugger that got privileged))
-
Thanks! I remember reading about the possibility to change the module load priority, but cannot find it( Could you direct me there to make the answer complete for someone finding it later?
-
Good day, @adrian! I have found your super-module installed on a client's site. And it lives alongside PageEditPerUser. The If no match, give all access or no access? option is set to No Access. For some users we need to apply restrict branch per user limitation via your module. But for others we need to limit page access on a per page basis with PageEditPerUser, leaving the branch option empty. But this does not seem to work. If the branch_parent field is left empty it still rules over other page edit permissions. Could you please explain, why is that happening, can we get around it (like changing the order of hooks applied or something). Or maybe suggest another way to deal with it?
-
There is no easy way I know of to do exactly what you're asking for. But as far as I understand the actual need is to find pages with selected templates. If you do not need to select the templates to be used in selector in admin, you should be able to hard-code the selector like this (see here for explanation): <?php $childChildren = $pages->find("template=template-a|template-b|template-c, sort=sort"); If you need to be able to select the templates in admin, you could add this module to some page, and then use it's value in a selector. Hope the module still works in current version of PW. There is an option to tag fields in admin and then use the tag instead of a list of fields in selectors. If the same thing worked for templates, that could be a good way to solve this task. But I did not find any docs on that, so you just might want give it a try first, and then fallback to the module if it's not possible.
-
Thanks, @ryan! Sometimes I think that ProcessWire is so mature and feature rich that only fixing the issues at hand can make it stand out even more than adding the new stuff (until the the stuff is added and I start thinking that I could not live without the features just added))) Thank you so much for keeping the right balance.
-
Just try it. I think it will work. I fixed my advice above a bit to make it more clear.
-
Aren't en and de just the titles names of corresponding language pages? So just change the name of the secondary language page to en.
-
Hey, @fruid! You can try this algorithm of actions: Export all the strings from German language. Import the exported German strings to default language, making it German. Remove all translations from the secondary language, making it untranslated => English. Maybe rename things here and there for the convenience. Change the name of the secondary page to en.
-
Hey, @strandoo! I think the trick is in the $options argument. Try something like this (or dig into the docs). $sanitizer->purify( $page->summary, array( 'CSS.AllowedProperties' => [] ) );
-
As for me, I always make separate templates for the ajax scripts. Something like ajaх-handler. This way I always get the API working right. I believe it is the recommended way to deal with this. Sorry for not answering the original question directly)
-
Yes. If you're doing simple foreach and not sorting items yourself.
- 1 reply
-
- 4
-
[solved] Issue using Toggle Fieldtype in selector for pagination
Ivan Gretsky replied to ottogal's topic in General Support
Check if the selector returns any results (echo $posts->count;). Looking here, it seems like you've set your field and selector right, but just maybe you have changed default state for the Toggle Inputfield after it has been created for your posts and it still holds the '' (empty string) value for the most of them if not all. You can look in the database to be sure.- 4 replies
-
- 2
-
- toggle fieldtype
- selector
-
(and 1 more)
Tagged with:
-
ImportPagesCSV add repeater field support? (got FieldtypePage)
Ivan Gretsky replied to hellomoto's topic in API & Templates
Good day, @hellomoto ! I seems kind of hard to map arbitrary amount of csv values to repeater item values. I am having hard time imagining how this could be done via GUI. Do you have an idea how this could be done universally UI-wise? ...But it is quite easy to do in a custom script. Looking at a piece of code you presented I am sure you can easily handle this ?. -
Good day! I got a strange issue with webp images on one server. The same image works fine on Firefox and does not show (though blinks for a momдnent when trying to open it) in Chrome. I did regenerate it without luck. Then installed Imagick sizer, regenerated - same thing. Same code works fine on local machine, generating images readable in both browsers (or serving them in correct way), so must be a server issue. But what could it be? Example image used on this page. Please help!
-
Hello, @ukyo! I absolutely love your module. And trying to incorporate it in my site-building workflow. I did install it without a problem and am using it for storing some output settings with great success) But today I found two (probably, related) bugs: I cannot create a new Page Reference field. I am getting this error: "Call to a member function getField() on null" (...\Mystique\FieldtypeMystique.module.php:71). I cannot view a list of pages with certain template (see the screenshot). The error message is the same. Do you understand what it is?
-
LoginRegister: No Password Reset Email
Ivan Gretsky replied to creativejay's topic in General Support
Just to make it clear. You are talking about this module? I never used it myself though) -
Super cool stuff, @Robin S! Your modules are always the thing you wanted to, but never managed to do) I understand it is for all Repeaters not for Repeater Matrix only. But when used with Repeater Matrix it would be useful to: limit the RM types for the 0 level; limit the available children for a type. Maybe it is too much. And would probably require hooks to implement anyway, so not so useful for easy management. But just wanted to get those ideas out of my head)
-
Thanks! But that is obviously not the case for me) Do you think we should try to change the situation by asking Ryan to add similar hookable methods to PageFrontEdit? Or does it seem impossible to implement anyway?
-
Good day, @Robin S! I've just read through the whole forum thread and found out a lot of great things about this module. It is great and way more powerful than I could imagine! But the issue I was hoping to resolve wasn't there. I am trying to use the module in a frontend-edit context, but it doesn't seem to work. The Insert Hanna Code button isn't even in the toolbox. What am I doing wrong? Can I make it work here?
-
Hey @JeevanisM! You probably shouldn't override the core module, as all the good men stated above. But it's nice to know you can (and I actually did this before exactly with Comments field - hope it is easier to customize it now).