
MSP01
-
Posts
100 -
Joined
-
Last visited
Posts posted by MSP01
-
-
Thanks Robin, that worked perfectly.
-
I'm trying to make a simple module to help handling some specific pages. There's a simple dashboard and under that a page with ProcessPageLister, like the simplified example below.
public function ___execute() { // Dashboard } public function ___executeBrowser() { // Browser $browser = $this->modules->get('ProcessPageLister'); return $browser->execute(); }
Problem is when you use the pagination ProcessPageLister creates, you end up in Dashboard instead of staying inside the "Browser".
What should I do to make this work correctly?
-
This is more general question but relates to need to add external file manager to PW's CKEditor (earlier message below). We have managed to call Responsive Filemanager in CKEditor, but the server is giving Server error 403 since I believe PW's .htaccess is blocking external PHP files. There is a PHP file dialog.php which have to be called in plugin config to run Responsive Filemanager plugin.
Is there (a safe) work around this? Should it be run outside PW or some javascript solution? -
Pretty straightforward selector string:
$pages->find("template=whatever, name=pagename");
This works fine on default language, but if I change language it will only find pages if name= matches the name on default language.
To find the page on second language, I need to add the language id after the name field like this:
$pages->find("template=whatever, name1013=pagename");
Where 1013 is the id of the second language.
Version of PW is 3.0.184, all the usual language fields and modules are enabled nor did I find anything weird in the backend.
Anyone got any ideas?
-
Ah I see, I have a hook that auto generates names for these pages so that was the culprit. Checking for status 'trash' before doing the name change solved this problem.
-
2
-
-
Alas it was pretty fruitless:
Array ( [restorable] => [notes] => Array ( [0] => Page name does not contain restore information ) [parent] => ProcessWire\NullPage Object ( [id] => 0 [name] => [parent] => [template] => ) [parent_id] => 0 [sort] => 0 [name] => [namePrevious] => [name1019] => [name7200] => [name7201] => [name7752] => [name7753] => [name7754] => )
How ever if I just echo $trashedPage->name;
I will get out the data as usual.
-
Hello,
I have one particular template that cannot be restored from trash. The hover menu that appears next to pages only has options Edit and Move. Trying remove the Trash status by api gives an error when you try to save the page "Call to a member function numChildren() on null".Trying to restore the page via api does nothing at all.
Anyone else ran into something like this?
PW version is 3.0.184.
-
Are you refreshing the page right after you have manually submitted a form? If so then that's pretty normal behavior for forms and doesn't really have anything to do with Processwire. One way to stop it is to redirect to another page after the form submission.
But if you don't want to redirect, this little piece of javascript should stop it from happening. Place it at the end of the page where the form is located.
<script> if ( window.history.replaceState ) { window.history.replaceState( null, null, window.location.href ); } </script>
-
It's strange if the JS date picker doesn't work, but I'm glad you found a work around.
-
It works fine for me. If you don't have access to the Pro Fields forum, maybe try sending a message to @ryan
-
1
-
-
Just a hunch, but are you using the HTML or JS based date picker? If it's the HTML, then the browser you're using could potentially have a bug. A while ago there was a bug in Safari that didn't let you pick dates in December if I recall correctly. If it's the JS base date picker, I've no idea. Unless you've set the minimum date higher than what you tried to pick.
-
1
-
-
I see, no that's not it.
-
1 hour ago, wbmnfktr said:
Please check if your Header label contains a textarea and remove it.
What do you mean with the "Header label contains a textarea"?
-
@ryan What version of matrix do the colored background require? I'm using 5 at the moment and only the last label color applied has any effect and it affects all the labels, not just the one it was written on. I'm assuming it's a bug due to version incompatibility or something of the sort?
-
The Admin Actions module lets you do this (assuming the fields are not used by a template). It has some pretty helpful features including cleaning up unused fields and templates.
-
3
-
-
That's a good question. Well I managed to solve it by using combination of different selectors for different cases. It just had me stumped for a while because I wasn't sure what was going on.
-
Yeah, the selector value is sanitized.
I actually made a small mistake in my first post. The actual problem is the trailing zero.
These don't work CASE 1 title*=test_7.50 CASE 2 title*=test_7.00 This works CASE 3 title*=test_7.5
So basically if you search with *= and the value ends with zero, you run into problems. Using ~= works fine, but this example is simplified and I'm actually searching for a phrase.
-
So I'm trying two different selector values, both values exist on page titles that are being searched.
CASE 1 title*=test_7.50 CASE 2 title*=test_7.00
CASE 1 will return all pages with test_7.50 in the title.
However
CASE 2 will return zero pages, even though there are plenty with that exact value in the title. Aside from 5 being replaced by 0, the titles and the search phrases are identical.
If I change the dot to comma, both values return pages.I was wrong on this, comma doesn't actually work any better.Why does CASE 2 not work? I tried to do some googling, but found nothing on this. I'm assuming the search being a "phrase" and not a "word" search is part of the issue.
-
We are in need to have general file management. I am trying to integrate good old Responsive Filemanager (https://www.responsivefilemanager.com) to CKEditor but getting frustrated how to include it to CKEditor's config. Like how to set CKEDITOR.replace and etc.
CKEDITOR.replace( 'ckeditor' ,{filebrowserBrowseUrl : 'filemanager/dialog.php?type=2&editor=ckeditor&fldr=',filebrowserUploadUrl : 'filemanager/dialog.php?type=2&editor=ckeditor&fldr=',filebrowserImageBrowseUrl : 'plugins/filemanager/dialog.php?type=1&editor=ckeditor&fldr=' // or '../../filemanager...?});Nothing seem to bring it to live into general link. Any hints how to achive this, what I am doing wrong or missing?
I bet many other may benefit this too, since general file management is one of the biggest things missing in PW. -
Is there any smart way to get image variants (and create them if necessary) when using findRaw?
We were thinking of using it to get array of several thousand products instead of using page array for performance reasons, but of course getting images becomes a problem. Is using a regular page array a better idea after all? We will need to turn it into an JSON format after so the page array isn't needed except to get the information out.
-
2
-
-
Thanks @elabx,
The FieldtypeDynamicOptions looks exactly like what I need. -
I tried to find a way to reference selected files on a page. It doesn't seem there's any easy way to do this. Is coding a new module/field the only way?
Basically what Ryan has made in CK editor would kind of work. Ability to first select a page, and then select multiple files that have been saved under that page.
-
Images disappeared when they were first reordered and then the page was saved. Actual images are in the page folder but db save did fail with attached error so media field is blank. ProcessWire v.3.0.174. Page uses standard ProcessWire media upload but the field is inside a repeater. No custom hooks in saving process. The images in that page are quite big since the page is basically used as image storage. Any ideas why this happened?
-
It's a little thing, but would it be possible to create images without the .-pim2- part?
Currently:
original.jpg
becomes:
original.-pim2-prefix.jpg
I'd prefer if it became:
originalprefix.jpg-
1
-
Hook for disabling specific pages from guest users without using access rights
in API & Templates
Posted
I have a template that is used on many pages, but some of those pages need to be disabled from guest users.
An addHookBefore('Page::render'...) works fine for throwing a 404 if someone actually gets on the page. But is there a way to disable those pages in site navigation, and any other place where they might be visible in one fell swoop?
I thought that addHookAfter('Page::viewable'...) could work, but I haven't been able to make it do anything at all.
Basically I'd love to have a way to disable those pages without going through every single $pages->find() and similar piece of code where those pages might crop up.
Using access rights would be the easy way, but I cannot change the template and most of those pages are public.