Jump to content

LostKobrakai

PW-Moderators
  • Posts

    4,956
  • Joined

  • Last visited

  • Days Won

    100

Everything posted by LostKobrakai

  1. This is intended behavior. As only superusers can use the trash (see it and restore pages) it's actually favorable to not have users accidentally click a trash action button.
  2. That's mostly owing the fact that the distance calculation must be done in sql syntax.
  3. That's why this is a wishlist topic. There's no pw way for that besides loading all pages to memory (kinda manually) and using unique().
  4. If you're worried about that just use the mysql snippet ryan posted with the DISTINCT selector.
  5. If you need to use pagination (limit=XX) for the resulted pages you'd need to resort to something like this: https://github.com/ryancramerdesign/ProcessWire/issues/556 If you're not using limit in your selector I'd suggest using sort in the $pages->find() selector if possible and fall back to runtime sorting only if needed. Edit: The difference between find() and sort() is, that find() will sort results in mysql and therefore (in conjuction with limit) will only load actually displayed pages, whereas sort() does only sort pages in php (loaded to memory), which might draw a lot of performance if done on a large set of pages.
  6. I think those might be what you're looking for: https://processwire.com/talk/topic/9730-get-pages-used-by-a-pagefield/ http://cheatsheet.processwire.com/pagearray-wirearray/getting-items/a-unique/
  7. Easiest: Implement a password forgotten process and let users use this one to update/change their password on the new system Otherwise: Implement the old system's password comparison and use it to compare it to the submitted password. There are various threads about hooking into the login process of processwire.
  8. @Sergio I thought laravel's rollback does just rollback schema changes. That one can be easily done like I described it in the post bernhard linked above. Maybe I'll try to get it out as (a bit more) polished module on the weekend. It's actually working great for me.
  9. Just be sure to sanitize the entry or people can just pass arbitrary emails to be send to, which you don't want to happen.
  10. I think you're missunderstanding fieldgroups. Fieldgroups hold the fields for templates. Each template does have it's own fieldgroup. You just need to remove your field from the fieldgroup. Do not delete the whole fieldgroup or the template of it won't have fields anymore.
  11. You can sort by runtime fields as well. You'd just need to make sure to populate it before sorting.
  12. If you need partial matching you'd need to use the %= operator. It's using mysql's LIKE to get matches.
  13. If you're talking about the frontend I can suggest talking a look at this: http://adamwathan.me/2016/04/06/cleaning-up-form-input-with-transpose/ In the backend you'll probably use repeaters or pagetables (FieldtypeMultiplier would work, too, for a single repeatable field).
  14. That's what GET parameters are for /enquiry/?email=1234, if you've them saved in some page, or /enquiry/?email=info%40xyz.com if you just want to pass the email address.
  15. One could possibly build that around the core export/import functionality. It's already working with json data.
  16. http://cheatsheet.processwire.com/fields/field-methods/field-getfieldgroups/ This will give you all fieldgroups (aka templates) you need to remove the field from before deleting it.
  17. Maybe the "new" permission suggestion screen, which ryan implemented for the various optional core permissions, could also hold optional module permissions.
  18. Nothing in processwire does automatically update, so what exactly do you mean?
  19. $this->addHook("Pageimage::srcset", $this, "mySrcsetFunction"); The image is $event->object in the hook function. From this you could simply call your current global functions if you like.
  20. note_page_id is a variable, which does need to be defined somewhere. That's the part which is missing, which could lead to an answer about why you need to include its value.
  21. Firstly. Please use the code block option for all the code snippets you're posting. I've edited you posts above. This makes things a great deal more pleasing to read. About you javascript issue. From such a small snippet it's hard so say anything about it, especially as the part is missing, where you get the value of the input field and save it to your variable. Your second question is easily answered with a yes. You can do that. More info about that can be found here: http://php.net/manual/en/language.variables.variable.php
  22. You can look at the returned info in the network tab of the developer tools even if it's an ajax call. But clearly this shouldn't be a php issue, because '[object HTMLInputElement]' is a string javascript does spit out when you try to cast an html node to a string. Therefore please check your javascript to ensure the correct value is actually being sent.
  23. I've recently switched more an more to a functional approach of building markup, which in my mind let's me focus much more on the data I want to display and keep the markup to a minimum in my code. If more than a handful of lines are needed i'm also using wireRenderFile like Macrura suggested. e.g. your second snippet could look like this: // Get bands and prepend all option $band1pa = $pages->find("id=1015|1016|1017"); $band1array = array_map(function($i){ return array('name' => $i->name, 'title' => $i->title); }, $band1pa->getValues()); array_unshift($band1array, array('name' => '', 'title' => 'All')); // Build markup around options $bandlinks = array_reduce($band1array, function($c, $band){ $link = "<a class='w-inline-block pr-tabs' data-group='$band[name]'>"; $link .= "<div class='pr-tabs-text green'>$band[title]</div>"; $link .= "</a>"; return $c . $link; }, ''); // add container markup $band1_content = "<div class='w-container inset-container tabs filter-options'>$bandlinks</div>";
  24. I'd certainly consider it a bug. I've fixed the same thing in I think 2.6 some time ago.
  25. Maybe it would be possible to simply require a forum account to be able to submit drafts (or in the beginning to create user accounts manually for the people wanting to help). It doesn't have to be open for everyone at anytime in my opinion.
×
×
  • Create New...