Jump to content


  • Posts

  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

NikNak's Achievements

Full Member

Full Member (4/6)




Community Answers

  1. Can I ask if you had success with this approach... field:parent.email_field Currently, I can only get this to work with an email field on the current page... but really need to get the value from the immediate parent page. =========UPDATE1============== I can see from this page: https://processwire.com/api/ref/page/get/ that the$page->get('parent.title') should work. But I can't get it to work even in a straight forward template - so the issue isn't with the comments module. Thanks =========UPDATE2============== In case it helps anyone else... no idea why, but the only way I can get this to work is $page->get('{parent.title}') or in the context of the comments module field:{parent.emailfield} Thanks Nik
  2. Hi all I am trying to search for text with a comment including the 'cite' field. This code works to search within the main text of the comment: $items = FieldtypeComments::findComments("comments", "data~=$q"); This code works to search an exact match in the cite field: $items = FieldtypeComments::findComments("comments", "data=$q"); But this code will not work to search within the cite field: $items = FieldtypeComments::findComments("comments", "data~=$q"); Currently I can only get a matching search for 'Joe Bloggs' but not 'Joe' or 'Bloggs'. I have also used another method using $fields->get('comments') - but have the same issue. Any thoughts? Have I found a bug? I was also wondering how you would combine searching within more than one field in the comments. Processwire: 3.0.159 dev. comments 1.0.8 (Latest version from dev branch at time of posting) Many thanks Nik
  3. For anyone having a similar issue, I finally resolved the issue after reading this post... https://processwire.com/blog/posts/pw-3.0.111/ Adding: $event->name = $pages->names()->uniquePageName($event->name) before: $event->save(); sorted it. Many thanks Nik
  4. Thanks for the suggestions... It isn't a browser caching issue for sure. The module Bernhard kindly suggested, just shows that it redirects to itself endlessly (and not back and forth between different urls). For a specific problem page, I have gone into the db and removed all page path history entries for that page id (rather than download modules), but the problem isn't resolved. This leads me to another possibility... The pages here are named with the page id (ie /whats-on/past-events/5336/ is the full path). Looking at how you can now use any shortcode url that features the page's id, I wonder if pw is seeing the pages name, and seeing it as a shortcode, and redirecting it to the same url. In which case, why is the problem resolved by me manually moving the page to a different parent and then back again, in the page tree, rather than doing it via the API? (However, I noticed is that my page moving script doesn't create a corresponding entry in the page path history.) My tests seem to be inconclusive... some pages moved by my script cause redirect errors and some don't, despite being the same types of page and undergoing the same process. V confused... as this was all working fine for a couple of years. Many thanks Nik
  5. Hi This script for moving past events to a different parent has been working fine for a few years, but in the last few months it has resulted in the moved pages having re-direct errors on the front end (ERR_TOO_MANY_REDIRECTS). If I move the pages manually it is fine... so I am wondering what is causing this now. Would I be correct in assuming this is something to do with Page Path History. (I have updated the wire folder a couple of times and I am currently on 3.0.127 Dev.) Any help gratefully received. $old_events = $pages->find("template=event, parent=1039, include=all"); foreach($old_events as $event) { $event->of(false); $date = date("Ymd", $event->get("date_end|date_start")); if ($today > $date) { $event->parent=2388; $event->save(); } $event->of(true); }
  6. Without this module, I am now struggling to find a way to get an image cropped to a particular ratio, that retains the full resolution of the original image. ie - have a cropped image that is as good as it can be at a particular ratio. From that master, i would then make variants. Using CropableImage3 this is not possible - as all defined crops are pixel based rather than ratio based - and not dependent on the original size image. This therefore restricts the flexibility of generating a subsequent scaling of the image from the best master possible. Horst's suggestion of uploading a large image to start with and cropping it to the right proportion at high res and then scaling, is impractical in day to day situations for my use, as you can't always impose that kind of restriction on your client's images. I had hoped that if I turned upscaling off, then perhaps I would be able to set a very large crop setting, and the cropping would just be made as large as possible. Anybody managed to find alternatives to the conundrum this has left, if you want to retain maximum flexibility in the automated scalings of your images. ? Cheers Nik
  7. Thanks Robin. Understood about superuser, and agreed - never let a client have superuser access. Kind regards Nik
  8. Awesome - thank you so much. That is exactly what I needed. Kind regards Nik
  9. Thanks - but if you want to get the id without hard coding it. In other scenarios you use the $page->id which returns the id of the current page being edited. How do you return the id of the current user being edited? Kind regards Nik
  10. Hi again If you are editing a users page at a url like "/admin/access/users/edit/?id=3718" I was trying to access the id 3718, so I could find other pages related to this id. I wasn't trying to get the current $user Sorry for not being clear. Kind regards Nik
  11. Thanks Robin - I was indeed considering this. The RuntimeMarkup module doesn't scope the current $user being edited though - it only works on normal pages. So I think this counts this option out. I didn't realise that $page wouldn't return the current user being edited. Kind regards Nik
  12. Thanks Kongondo - it's just me being thicker than usual - no problem with the description ;-) I assume this means that you cannot self reference fields on a $user page being edited. EDIT: The below solves what I was trying to do - thanks Kongondo $process = wire('process'); $u = $process->getPage(); $id = $u->id; return $id;// will return 40 for guest, 41 for superuser, etc... //return $process->className();// would return ProcessUser. Useful to know if you are using the field elsewhere and want to do different things based on context // return $u->email;// etc... Kind regards Nik
  13. I've done some more testing. The module is working on normal pages whereas I was initially trying it out on $user pages, where it failed. Kind regards Nik
  14. Thanks. I tried the simplest of things, and namespaced it too, but couldnt get any output other than an error. Not to worry - I'll do more testing. Many thanks Nik
  15. Hi Robin Thanks for your hard work on this. One thing I noticed was that if you do not restrict the actions to a role, then none of the restrictions are applied at all. For example, I want to hide the trash buttons for everyone, including superusers, but by not selecting a restriction by role, none of the modifications are made for anyone, and all the buttons and functionality is in place as if you weren't using the module. Kind regards Nik
  • Create New...