-
Posts
10,912 -
Joined
-
Last visited
-
Days Won
349
Everything posted by adrian
-
Glad you found a solution by placing under admin, but if you want, here is a tested option. Place this in your admin.php - just replace the xxxx with the id of the Settings page. With this the autocomplete won't return any pages under Settings. $this->pages->addHookAfter('ProcessPageSearch::executeFor', null, 'removeBranchFromSearch'); function removeBranchFromSearch($event) { $response = $event->return; $responseArray = json_decode($response, true); $matches = $responseArray['matches']; $i=0; foreach($matches as $match) { if(wire('pages')->get($match['id'])->is("has_parent=xxxx")) { unset($matches[$i]); } $i++; } $responseArray['matches'] = $matches; $event->return = json_encode($responseArray); }
-
Just an FYI - you only need one of these - they are identical. $page->of(false); $page->setOutputFormatting(false);
-
Pagination issue with three different queries on one template
adrian replied to a-ok's topic in General Support
I know you said you have tried using start, but I only see one "start=1". I admit I haven't really read your code carefully, but the usual issue is that you need to put "start=0" in each of the selectors that is not the main page one - in this case it would be the "then" and "older" queries. But as I said, I didn't read carefully so may be off on this one -
@mr-fan, This actually should be quite simple. Add an after hook on: ProcessPageSearch::executeFor and call this method: public function removeHiddenFromSearch($event) { $response = $event->return; $responseArray = json_decode($response, true); $matches = $responseArray['matches']; $i=0; foreach($matches as $match) { if($this->pages->get($match['id'])->isHidden()) { unset($matches[$i]); } $i++; } $responseArray['matches'] = $matches; $event->return = json_encode($responseArray); } This will remove all hidden pages from the results, but I get the feeling the pages themselves are not actually hidden, just the "Settings" parent. Is that correct? In that case change "isHidden()" to check if the page is a child of the "Settings" parent - I'll let you figure that out
-
Module: Video embed for YouTube/Vimeo (TextformatterVideoEmbed)
adrian replied to ryan's topic in Modules/Plugins
Did you try: $database = wire('database'); You may also need to modify the sql queries to work with PDO. If you're not familiar with the needed changes, a quick google should get you going Once you get it working, a PR for Ryan might nice -
Module: Video embed for YouTube/Vimeo (TextformatterVideoEmbed)
adrian replied to ryan's topic in Modules/Plugins
That error says that you don't have the mysqli php extension installed on the server. I can't see the source for this module right now as Github is down, but I expect it is using mysqli instead of PDO which is what the PW core now uses. So I am guessing this module needs an update to use PDO. Change any instances of $db to $database. Although I am surprised that this module uses any direct db calls. Are you sure it's actually this module that is the problem? -
Disturbing read Willy! but good idea - disposable Twitter account worked a treat - I've voted!
-
True enough - I actually assumed it must have been an omission from the cheatsheet so didn't check!
-
Here a link to a search for "StatusLocked" on the PW Github repo: https://github.com/ryancramerdesign/ProcessWire/search?utf8=%E2%9C%93&q=statuslocked&type=Code That should show you what you need.
-
Me: Hi guys - I would like to join your community but I don't have (or want) a Twitter or Facebook account. Would you consider adding a Github and/or Google login, or even a separate registration process? PH: We don't have any immediate plans for it, but I'll sure to pass along the suggestion to the rest of the team!
-
They won't let me login without a Twitter or Facebook account - what is the world coming to
-
Glad that worked for. Just in case you don't know you can avoid the need for an entire module to add simple hooks like this. You can place the hook and method in site/templates/admin.php There are also site/init.php site/ready.php and site/finished.php files that you can make use of. More reading here: https://processwire.com/blog/posts/processwire-2.6.7-core-updates-and-more/#new-core-files-for-site-hooks
-
Add a new page, title should be linked to another page
adrian replied to cb2004's topic in General Support
Also check out this module for adding more flexibility to the automated page name: http://modules.processwire.com/modules/process-setup-page-name/ -
Just a guess based on a quick look through the repeater source code, but maybe try hooking: FieldtypeRepeater::savePageField https://github.com/ryancramerdesign/ProcessWire/blob/master/wire/modules/Fieldtype/FieldtypeRepeater/FieldtypeRepeater.module#L958 Also possibly: InputfieldRepeater::processInput (although this is before the repeater has saved, so not sure if it will be of any help) https://github.com/ryancramerdesign/ProcessWire/blob/master/wire/modules/Fieldtype/FieldtypeRepeater/InputfieldRepeater.module#L236
-
Don't put anything in the wire directory - put it in site/modules/AdminTheme/ I don't recall if it has to be prefixed with AdminTheme to work, but do you have any reason for not following the convention already used for AdminThemeDefault and AdminThemeReno ?
- 1 reply
-
- 1
-
Nope, there is no workaround for this and I don't really think there should be - call one "image" and one "images" (or similar) and it will be a lot simpler for you to remember which one belongs where and will also make more sense in your template API code.
- 1 reply
-
- 1
-
This is one way: http://modules.processwire.com/modules/admin-restrict-page-tree/ Sometimes when I have complicated forms and I don't want to rebuild on the front end, I use Adminbar: https://github.com/teppokoivula/AdminBar Be sure to use that fork by teppo. Apiesa is not maintaining the original anymore and there are problems on recent versions of PW but I think teppo' should work well. I have my own fork that fixes the recent problems which I can also share if needed. I actually change the css to style it to match the website and it actually looks and works really nicely depending on your needs. Obviously not appropriate for a simple form but it can be great when there are user editable sections of a site but you want to keep your users out of the admin.
-
how could i delete a page instantly, without moving to Trash
adrian replied to adrianmak's topic in General Support
Or if you want via the admin rather than the API per GuruMeditation's suggestion, you could try Nico's module: http://modules.processwire.com/modules/process-page-delete/ In some ways it is obsolete now that the core has a built in trash action button, but it does offer delete/trash options. Keep in mind though that this will only work with the action buttons in the page list view - the "Delete" link in edit mode will still be trash. Otherwise if you really feel the need, you could hook into Pages:trash (https://github.com/ryancramerdesign/ProcessWire/blob/dev/wire/core/Pages.php#L1517) and change the behavior to delete instead. BUT, is trashing really so bad? -
More of an FYI than anything - this is the one I have always used: http://www.ozhiker.com/electronics/pjmt/ It doesn't seem to be actively maintained anymore, but it has always worked for me as needed.
-
It may not cover all needs, but I usually use an InputfiedMarkup: $f = wire('modules')->get("InputfieldMarkup"); $f->value = "Any HTML you want here";
-
Don't forget this thread: https://processwire.com/talk/topic/2089-create-simple-forms-using-api/
-
While I agree with earlier posters about not needing to update PW installations, honestly I agree more with teppo - I want older customers to reap the benefits of improved admin functionality. And course we are not just talking about the PW core here - there are also often 3rd party module updates - sure these updates might just add new functionality and there is always the chance that they might break something, but if you do your due diligence in checking the revised versions, it is nice to be able to update across all your sites at once. I actually had/have some plans to build something like this - but am waiting to see if the demand is going to be there. Module Toolkit is something I use in the meantime for updating all 3rd party modules on a site at once - it can be a significant time saver. But be aware that this module is currently alpha/early beta - I would like to get back to it and release it properly, but juggling priorities as usual
-
Hi @Christophe, I expect the issue is the missing ffmpeg on the server, although they are only used for making the video thumbnail/poster image, so I could probably do a class check and if it's not available, just not generate the image. Would this be acceptable for your needs? It would of course mean that the player would have blank black screen until it starts playing the video.
-
A quote in the conclusions section: "From the platform possibilities ProcessWire was best suited for the task due its developer centered approach by making the design part of the site the responsibility of the developers. This responsibility also brought the desired freedom to change the platform in the ways needed."
-
If you are using the automatic page name format option, then this module makes the name much more configurable: http://modules.processwire.com/modules/process-setup-page-name/