-
Posts
11,097 -
Joined
-
Last visited
-
Days Won
365
Everything posted by adrian
-
Fatal error editing page with repeater field with APC enabled
adrian replied to adrian's topic in General Support
Just wanted to note that I had this same error again, this time with a PageTableExtended field. Restarting APC fixed things again. I'll keep a eye on things and see if I can find something reproducible. -
Try the attached module - works here. Let me know if that works at your end. CustomPageListButtons.module
-
user module for login, logout, register
adrian replied to pwFoo's topic in Module/Plugin Development
I haven't looked to see if it's possible or not, but I wouldn't want to hide it for admin users, just for front-end users using your profile edit approach, so not sure that option would be much help anyway. Just thinking through scenarios here - not meaning to pull apart your ideas -
user module for login, logout, register
adrian replied to pwFoo's topic in Module/Plugin Development
Hi kixe, Seems like a cool approach to things, but I just did a little testing and am having some issues - maybe you made some changes to your code just before posting. Firstly, you need wire('config') because it's inside a function. It can't get the root url the way you have it. $event->return = wire('config')->urls->root; Also, the redirect still happens with the code you have. If I change it to a "before" hook it doesn't redirect, but you are stuck with the "Continue" link on the page. Looking at the edit Profile option - not sure I'd want any front-end only users to have the options to change the admin theme, which will show up in that form if you have more than one installed. It won't be relevant to them and just confusing. It might seem like more work, but there are simple ways to create your own custom login and profile edit form with not too much code. I have based most of mine off this post by Ryan: https://processwire.com/talk/topic/1716-integrating-a-member-visitor-login-form/?p=15919 -
Hey Nico - I just submitted a PR to fix the uninstall problem: https://github.com/NicoKnoll/ProcessPageDelete/pull/11 Just a matter of adding an "include=hidden" when looking for the page. I guess this is a fairly new issue from when you added the hidden status to the page when Ryan added the new "Tree/Find" submenus to the admin.
-
Strategy for flexible content types in a template
adrian replied to jordanlev's topic in Getting Started
Or here: Check out the drop down at the top right which allows you to choose the template which the settings will be applied to. -
Nico - one thing I did notice is that if you uninstall the module and go to reinstall you get an integrity violation. At least for me, the Delete page that is added during install is not being removed properly, so when it goes to add it again, that causes the error. If I manually delete the page, then the re-install works fine. I haven't tested thoroughly and just heading out for the day, but might be something you can look into.
-
What happens if you use: https://github.com/NicoKnoll/ProcessPageDelete/archive/master.zip in the new "Add Module from URL" option?
-
Strategy for flexible content types in a template
adrian replied to jordanlev's topic in Getting Started
Check out this helper module from Soma: https://processwire.com/talk/topic/3159-hide-settings-tab-in-page-edition/?p=31126 -
Works great for me on 2.4.18 Sounds like kixe and mr-fam are actually having issues with it working on 2.4 stable. Maybe you guys could try an older version from Github. I thought it might be related to the autoload condition that was added a while back, but then the delete button wouldn't show either, so not sure. Not sure that it is worth Nico messing around too much though since 2.5 is only a week or so away
-
Strategy for flexible content types in a template
adrian replied to jordanlev's topic in Getting Started
No need to remove it from the template, just make it hidden and not required in the context of that template. I don't think there is really any need to populate it all in this case, but it would be possible via a hook if you really want to. You could also remove the global flag for title so it is not in the template at all, but I think the former approach is better. -
"Using $form->processInput($input->post) will prevent CSRF attacks and the form will append a hidden field automatically." https://processwire.com/talk/topic/2089-create-simple-forms-using-api/
-
Strategy for flexible content types in a template
adrian replied to jordanlev's topic in Getting Started
It's on the Input tab of the PageTable field. I usually just name it contentblock or something along those lines and each new page that is created with have -n appended to it, e.g.: content block-1, contentblock-2, etc -
Strategy for flexible content types in a template
adrian replied to jordanlev's topic in Getting Started
1) a) I think the best approach is to store all the content pages under one hidden parent using the Details > Select a Parent for Items b) Not really an issue if you do a) c) Make use of Input > Automatic Page Name Format, and then go to the template context settings for the title field and make it invisible and not required. 2) This can be handled by setting the allowed parents for these content block templates. Hope that helps. -
Strategy for flexible content types in a template
adrian replied to jordanlev's topic in Getting Started
PageTable is in the core already - you just need to go to Modules > Core and scroll down to PageTable and install. Then it will appear from the list when creating a new field. -
Here's a starting point: https://processwire.com/talk/topic/960-comment-spam-filtering-alternatives/?p=8097 But there are other links on how to do this in the forum as well.
-
Hey Zahari, In a bit of a rush, but PHP's strstr might be what you are looking for. Not sure that you really need a Hanna Code in this situation. Just parse the content of the field in your template. $introtext = strstr($page->body, '[[readmore]]', true); Then when you echo out the body on the full version, just: echo str_replace("[[readmore]]", "", $page->body); Hope that helps to get you started. I am sure there are lots of other ways to approach this. I usually go with automatic truncation because editors usually forget to add things like a [[readmore]] tag.
-
Exactly my point (maybe I wasn't clear) - use a commonly used CDN like google, rather than github, which is rarely used for this purpose (especially when linking to a version in the PW repo).
-
I think the problem with that approach is that you won't get the local caching benefit of using the Google CDN, because no other visitors to your site will have those files cached from the PW git repo. I would suggest either using a well known CDN (eg google), or use the local version from your PW install - afterall, those files are already on your server. I would however use the excellent AIOM module on them. I am no expert in this area, but hope that helps.
-
This works for me. This replaces all the existing buttons and adds a new one called "custom". Is that what you are looking for? public function init () { parent::init(); wire()->addHookAfter("ProcessPageListRender::getPageActions", function($event) { // anonymous function $event->replace = true; $new_action = array( 'cn' => 'custom', 'name' => 'Custom', 'url' => '/my/path' ); $event->return = $new_action; }); }
-
Sorry about that - I have just committed a fix that I think should take care of it. Please let me know if it works for you now. Not sure why you got that error, but I have never seen it - maybe a PHP version difference? Also, note that it requires PW dev due to the way I set up the module info in a separate file.
-
PW 2.5 (https://github.com/ryancramerdesign/ProcessWire/tree/dev) will be released within the next couple of weeks. Many of us have been using the dev version in production with no problems. It always pays to test though, so if you don't have a test server setup, rename your existing wire folder to wire-old or similar so you can revert quickly should there be any problems.
-
Noob question: Problem with page field used as link
adrian replied to manlio's topic in Getting Started
Sorry that didn't work. I think I must not be fully understanding the setup you have, because that should work. Can you please show us the selector you are using to define $menus ? -
Noob question: Problem with page field used as link
adrian replied to manlio's topic in Getting Started
If it's a multiple select page field, then you either need to convert it to single select, or grab the first one: $menu->pagereference->first()->url;