-
Posts
11,092 -
Joined
-
Last visited
-
Days Won
365
Everything posted by adrian
-
Hi @gmclelland - to be honest I don't really use this module for replacement of the main links - I only use it as a means of providing a shorter URL if required. I actually think that the Page Path History module does an excellent job of preventing broken links. I have never actually been a fan of Drupal's /node/nnnn/ links, but in previous custom systems I have built, I have included the page ID as part of the URL, like: mydomain.com/nnnn-title-of-my-page/ which this module allows. As for changing the insert link - this should already work - at least it does for me: Sorry if I am missing your point - in a bit of a hurry! PS Did you select the "Rewrite Links" in the module settings?
-
What about this setting in Advanced Mode: Modules can accomplish almost anything - if you are willing to make a start, I am sure you will get plenty of help if you need it. There might be something useful in this thread: https://processwire.com/talk/topic/3543-register-users-and-add-page-same-as-username/ You might also like to look at the way the EmailNewUser module triggers an email when a new user is created - you might be able to use that as a starting point for modifying to create the member page instead.
-
Thanks for the report @ukyo - sorry that you and Ryan spent time debugging this. I have committed a new version which appears to fix the problem for me. Could you please test and let me know if it now works for you? If anyone is interested in what the problem was, take a read of the Github issue.
-
You wouldn't need another full module, you could just use AdminRrestrictBranch and add an additional hook that is triggered when a new user is added which takes care of creating the member pages. But, what I would do is use the "Multiple templates or parents for users" ability instead: https://processwire.com/blog/posts/processwire-core-updates-2.5.14/#multiple-templates-or-parents-for-users That way the member page is the user page, so one less thing to create and maintain. Sorry my answers aren't complete with examples today - lots to do and not much time
-
Could you put the X, Y, etc branches under an extra parent and just add that to the branch edit exclusions - that will take care of making all new ones excluded. I would suggest that AdminRestrictBranch might still be useful for you - you just need to add an additional hook somewhere that will automatically create the required branch when the user is created - this should be very easy - let us know if you need help. You might also consider connection the user to the parent branch by one of the other options - role name or PHP custom code - this might be able to automate this process for you. Good luck with whatever approach you choose!
-
I guess my question for you, is does it work as you want? Seriously though, I think it should, but if the editors need to directly edit pages under Section X then you would need to use the "Editing Only" option, so that the page tree view is not actually restricted. With that setting, I think it should work as you described - how did it work out? Was there anything that didn't work as you need?
-
I think I must be missing something - have you tried the AdminRestrictBranch module? Can you please highlight exactly what it doesn't support for your needs - perhaps they might be a worthwhile addition, or perhaps not
-
@clsource - fantastic writeup - thanks for sharing!
-
PageTableExtended can be used for generating previews: http://modules.processwire.com/modules/fieldtype-page-table-extended/
-
Sorry Jon - just realized I didn't answer the last part of your question. To read more about ready.php, take a look here: https://processwire.com/blog/posts/processwire-2.6.7-core-updates-and-more/ I think it is much easier than setting up a module for custom tweaks like this and I don't think there are any disadvantages. Actually, for admin specific stuff (assuming you aren't saving your pages via the API), you might actually want to put that code in /templates/admin.php so it is only called on the backend.
-
Where is the ProcessWire 3.0.1 (alpha-4) download?
adrian replied to zota's topic in Getting Started
You can click the Download Zip button on this page: https://github.com/ryancramerdesign/ProcessWire/tree/devns Or use the Upgrade module: https://github.com/ryancramerdesign/ProcessWireUpgrade to get it. -
There is a little info on SaveReady here: https://github.com/ryancramerdesign/ProcessWire/blob/dev/wire/core/Pages.php#L2293 With save you need to be careful you don't end up going recursive which can happen when hooking after save because your hook function then needs to call save again, which triggers the hook again Maybe hookbefore save would be ok - I don't actually recall - I just tend to default to saveReady because it usually suits my needs!
-
I haven't come across this - I wonder if it's the fingerprint config setting - try setting that to false and see how it goes.
-
Try something like this in your ready.php: $this->pages->addHookAfter('saveReady', null, 'buildName'); function buildName($event) { $page = $event->arguments[0]; if($page->template != 'cruise') return; $page->title = '$page->parent->title . '-' . $page->date . '-' . $page->boat_name'; $page->name = wire('sanitizer')->pageName($page->title,true); } EDIT: You may also want to make use of the Name Format for Children option so that the page title/name initial dialog is not needed. You could have this set to create a dummy name since the code above will rename after anyway.
-
Actually I just realized I might have been a bit confused by what you want - I thought what I wrote answered the first sentence in your question, but the second sentence suggests you want to hide the pub/unpub action buttons, in which case try this in your ready.php $this->addHookAfter('ProcessPageListActions::getExtraActions', null, 'hookGetExtraActions'); function hookGetExtraActions($event) { $page = $event->arguments[0]; $extras = $event->return; if($page->template->name == "basic-page" && $page->hasStatus(Page::statusUnpublished)) { unset($extras["pub"]); } $event->return = $extras; } You can remove the page status check for unpublished and also add: unset($extras["unpub"]); if you want to remove that as well.
-
I think you should be able to achieve what you want by hooking into Page::editable I think this should do what you are looking for - just edit the template you want to match. Keep in mind that in this form it will even prevent superusers from editing the page, so you might want to check that before adding the hook $this->addHookAfter('Page::editable', null, 'hookPageEditable'); function hookPageEditable($event) { $p = $event->object; // in case there is already a defined exclusion for this user's role for this page if(!$event->return) return; if($p->template->name == "basic-page" && $p->hasStatus(Page::statusUnpublished)) { $event->return = false; } else { $event->return = true; } }
-
How to modify admin breadcrumbs from module
adrian replied to Adam Kiss's topic in Module/Plugin Development
Thanks Adam - no problem at all - it's for a request for my AdminRestrictBranch module. I'll take a look when I get a chance to see how might be the best way to implement it. -
How to modify admin breadcrumbs from module
adrian replied to Adam Kiss's topic in Module/Plugin Development
Hey Adam, Did you ever get a working solution for this? I haven't tried to code anything up yet, but thought I'd be lazy and see if you had anything to share first -
Thanks @tpr - I did think about the breadcrumbs issue, but wasn't actually sure if it should be modified or not - perhaps it is actually useful for editors to know where their branch fits in the site (even though they don't have access to the rest of it). Perhaps this could be an optional change? I am curious about your comment about setting up the roles and permissions being a huge amount of work - do you feel like it was extra work because of this module, or juts because of the way PW roles and permissions work? In my experience with this module so far, it actually reduces the complexity of the setup, because I can actually all roles full editing privileges inherited down from the "home" template, knowing that they can't actually mess with any pages that aren't in their restricted branch, but I can see situations where you still might want restrict what they can do within templates within the branch, but for that I am finding the new " Additional edit permissions and overrides" setting in the template access tab incredibly useful.
-
Back to @elabx's question - if you want to tackle this, have a read of these two threads: https://processwire.com/talk/topic/4253-modal-pop-up-for-page-editing-problem-with-dynamically-generated-page-tree/ https://processwire.com/talk/topic/2380-fancy-admin-mode/
-
I never noticed that - thanks for the head's up - I'll see if I can fix it in the next couple of days. @tpr - sorry for hijacking your thread!
-
The title changes immediately for me - as soon as the modal is closed. The name however doesn't change until the parent page is reloaded. This is actually on my list of things to do, although it's been there for quite some time - maybe I need to make it a higher priority.
-
This could actually probable be done quite easily using CustomAdminFiles to apply the "pw-modal" class to the edit action button. Sorry, no time for an example, but you could probably steal from PageTable's edit trigger. Otherwise, you could alway use Batch Child Editor - the edit icons trigger a modal for editing:
-
You can always edit your module in the modules directory - simply open the edit mode and save - it will query Github and update the version number which will then make it available via the Upgrade module instantly.
-
Awesome - would love to see more of these. Please let us know your experience with it - maybe some day soon there will be enough PW devs in my part of the world to do host one.