Jump to content

All Activity

This stream auto-updates     

  1. Past hour
  2. $news = $pages->find("template=news-article,sort=-publish_date, publish_date<$today,id!={$page->id}"); PS: if publish_date is a datetime field, then ProcessWire already knows 'today' (string) πŸ™‚.
  3. Today
  4. What's the best way to exclude the current page from results without resorting to filtering the results in a FOR LOOP. $news = $pages->find("template=news-article,sort=-publish_date, publish_date<$today"); In this example If I want to exclude the current page how would I do that? Is there a sibling reference?
  5. Hello, I tried to uninstall this module so I could test another, but I'm getting this error after uninstalling it. Based on what this error seems to be indicating, I made sure that I uninstalled TextformatterPrivacyWire first, before uninstalling PrivacyWire. But that didn't work either. Is there something else that I should be doing? I thought it might be ProCache, but I turned that off too. Please let me know. Thank you! Error: Exception: Module TextformatterPrivacyWire requires: PrivacyWire>=0.0.5 (in /usr/home/jc/public_html/test.com/wire/core/Modules.php line 1857 #0 /usr/home/jc/public_html/test.com/wire/core/Wire.php(383): ProcessWire\Modules->___install('TextformatterPr...') #1 /usr/home/jc/public_html/test.com/wire/core/WireHooks.php(823): ProcessWire\Wire->_callMethod('___install', Array) #2 /usr/home/jc/public_html/test.com/wire/core/Wire.php(450): ProcessWire\WireHooks->runHooks(Object(ProcessWire\Modules), 'install', Array) #3 /usr/home/jc/public_html/test.com/wire/core/Modules.php(1303): ProcessWire\Wire->__call('install', Array) #4 /usr/home/jc/public_html/test.com/wire/core/Modules.php(1194): ProcessWire\Modules->getModule('TextformatterPr...') #5 /usr/home/jc/public_html/test.com/wire/modules/Fieldtype/FieldtypeText.module(97): ProcessWire\Modules->get('TextformatterPr...') This error message was shown because: you are logged in as a Superuser. Error has been logged.
  6. Yesterday
  7. What exactly is the resulting settings or options here with the size call? Have a look at it with: https://processwire.com/api/ref/pageimage/get-debug-info/ // instead of // $img = $image->size($size["width"], $size["height"], $size["settings"]); // call $debuginfo = $pageimage->getDebugInfo($size["settings"], 'string'); // 'string' | 'array' | 'object' // and inspect the $debuginfo with Tracy or a var_dump()
  8. Hi @Greg Lumley, Implementing a "user admin" on the front-end isn't difficult because of PW's API -- In theory, that is. If you aren't familiar with PHP, or aren't familiar with the API, then it obviously will be a little more difficult. You can ask any questions here in the forum and a plethora of highly-skilled programmers will be glad to help. That's another big selling point with PW vs any other. The community support is second to none. The following is an example break-down of one of my sites. I have one site where specific users have the only permissions to access specific pages. All other users could only view pages. Think of it like the *nix RGE permission structure, where Root is super user, Group is any registered user, and Everyone else is a guest just visiting. PW initially gives you the Root and Everyone roles, so you will need to add the Group role. You can name it what you want. And since I don't let *any* user access the PW admin, I don't need to specify any permissions, such as page-edit, etc. I use Processwire's built-in page management to further limit a user to only their pages. Specifically, all pages have a created_users_id, and other information that is saved each time a page is created or updated. So when a user wants to create a new entry (page) their $user->id is assigned to the created_users_id property. Now I have a one-to-many relationship between a user and all of their pages. I also have different sections where a user can create a page. For example, when a user logs into my site acme.com, they can create a page under "high-explosives", and another page under "jet-powered devices". They may not wish to create a page under any other section. Each section has it's own template, so I can easily use selectors to retrieve the user pages by section, or even retrieve all pages. The front-end "user admin" interface is simply a two column layout with a menu on the left and the content on the right. I use the Group role to determine the menu options. I obviously don't want one user viewing details of another user, except for me as super user (Root). This also restricts the admin page(s) from view by the Everyone (Guest) role. I also have a drill-down capability from this initial user admin page to get more specific details. Each user can manage their own personal data page as well. That is the basic overview. The next thing are the modules. If you do not have your own login system then I would recommend LoginRegisterPro as it covers all the bases (register, login, forgot password, etc.) that you will need for your user access requirements. I am currently looking into implementing @bernhard's RockFinder3 module to handle queries because I have many users and they each have many pages and I want to be as efficient as possible. You must have TracyDebugger. That is a requirement (should be in core 😎 ). It will save you many hundreds of hours of scratchin' your head. You may elect to use other modules, such as caching, etc. These are just the minimum I would recommend for a project like yours. I hope this helps.
  9. @horst, if you have a chance, please look at the above? Sorry for pinging you like this.... πŸ™‚
  10. Hi Rick, I'd like it to be a front-end as in "user admin", so essentially a custom front end admin. If that makes sense. 😁
  11. Isn't it required in the new word of EU web bureaucracy to list every single cookie on demand (by category) and explain what is does, where it's from and can set it individually? So, for example, in the same example category "my user settings" I can agree to remember a "my selected language" cookie but not another cookie with "my last page visited"? As Borlabs cookie does it, or Klaro (kind of)? Am I wrong with my understanding of the current GDPR law situation? Or is this implemented already and I just did not find it? (Right now I am evaluation this module against using KLARO directy)
  12. @Robin S Dudeeeeee, you rock! It works like a charm. Didn't know there's such a thing!!!!! Thanks!
  13. When I look at the templates in the site via ftp it does not match what PW sees: The basic-page & session templates are missing from the ftp [yes, it has been refreshed].
  14. I have followed your instructions. There are now some data entered. When the tabs have not been selected: - the current site shows: <div class="accordion"> <div class="accordion-section"> <a class="accordion-section-title community-club" href="#accordion-1">Badminton</a> <div id="accordion-1" class="accordion-section-content" style="display: none;"> </div> </div><!--end .accordion-section--> </div> - whereas the original site shows: <div class="accordion"> <div class="accordion-section"> <a class="accordion-section-title community-club active" href="#accordion-1">Badminton</a> <div id="accordion-1" class="accordion-section-content open" style="display: block;"> <div class="row"> <div class="col-md-12"> <div class="session"> <h3>Huddersfield Eagles Junior Badminton Club</h3> <h4>Royds Hall Sports Centre</h4> <p>Sunday - 9:00am - 12:00pm</p> <p> </p> <p><a href="https://web.archive.org/web/20180815082939/mailto:enquiries@vivesport.co.uk?subject=Huddersfield Eagles Junior Badminton Club booking please" class="btn btn-primary" target="_blank">Book this session</a></p> Clicking the current version alters nothing. When the original is clicked and opened the code starts: <div class="accordion"> <div class="accordion-section"> <a class="accordion-section-title community-club active" href="#accordion-1">Badminton</a> <div id="accordion-1" class="accordion-section-content open" style="display: block;"> So, being a great detective [!!], the accordion isn't opening!
  15. After setting up a new user template using this guide: https://processwire.com/blog/posts/processwire-core-updates-2.5.14/#multiple-templates-or-parents-for-users, the pages are created fine but I can't log in as the newly created user. I did notice that my new template doesn't have a 'name' field like the users in admin/access/users. Is this the field that is checked when logging in? Here is my code that I am using to create the page when someone registers: $np = new Page(); // create new page object $np->template = $templates->get("user-hunt"); $np->parent = $pages->get("/members/"); // Match up the sanitized inputs we just got with the template fields $np->of(false); $np->name = $hunt_name; $np->title = $hunt_name; $np->member_hunt_name = $hunt_name; $np->member_hunt_contact_name = $contactname; $np->member_hunt_position = $position; $np->member_hunt_address = $address; $np->member_hunt_postcode = $postcode; $np->member_hunt_telephone = $telephone; $np->member_hunt_country = $country; $np->email = $email_address; $np->pass = $password; // Save the page $np->save(); $np->of(true); Also, when it creates the page, it's putting the title as the created date/time for some reason. 🀯
  16. No Your 'Our Sessions' page needs to have children for this (and the other similar) code to work: The children will be titled Huddersfield Eagles Junior Badminton Club, etc. In addition, those children: Need to use a template named session. That template (session) needs to have the following fields: session_type, session_day, session_venue, session_time and session_area
  17. Our Sessions No No, but it's template [sessions-page] does now. Text area It does now. Text No, there's one called 'sessions-page'
  18. Hi everybody, First time for me here to ask an help. So I apologize in advance for any section mistakes or forum rules not respected. I'm a newbie in PW, only 1 year working on it. I have a page with Date/Time pickers and they work perfectly, but I should have those in Italian (for safe editors that aren't so good with English). So I followed the translation suggestions founded in some old posts. Once setted the correct URL, the DatePicker are displayed in the right language, but I have an error on page saving: it seems that the field doesn't register the date/time change from the older language. The same problem occurs if I create a new page, not only changing the old ones. May I have missed something? Thanks a lot in advance.
  19. @Mamun Paul, this is a double post (https://processwire.com/talk/topic/9711-map-marker-map/?do=findComment&comment=202283) and also not related to module development, so I'm closing this thread. One topic per issue, please.
  20. Hey @montero4, First of all, just wanted to say that I really need to figure out some way to handle these conflicts with Hanna Code β€” it's becoming a common issue. I'll see what I can do about that soon πŸ™‚ Technically there's nothing wrong in your code. It will work just fine on the front-end, where it's really intended to run. The problem is that in order to get useful index out of field content, SearchEngine actually gets it via $page->getFormatted(), which means that TextFormatters (such as Hanna Code) will also run in the admin side. In this case you're using $pages->get() to get another Page, and since the default in the admin is that output formatting is off, this means that this new Page will have output formatting disabled β€” and that's why $page->image actually returns an instance of Pageimages (instead of a single Pageimage). ... anyway, just wanted to explain what's going on in here πŸ™‚ Right now the easy fix would be checking for the type in the Hanna Code snippet. (Again, I'd like to automatically handle this in SearchEngine, but I can't say for sure when I'll get to that.) $page=$pages->get($id); //gets the page $image = $page->image instanceof Pageimages ? $page->image->eq(0) : $page->image; $image = $image->width(1240, ["suffix" => "srcset"]); //create image that is 1200px wide Alternatively you could make sure that output formatting state is on β€” it's mostly a matter of taste, really: $page=$pages->get($id); //gets the page $of = $page->of() // store initial output formatting state for later use $page->of(true); // make sure that output formatting is on $image = $page->image->width(1240, ["suffix" => "srcset"]); //create image that is 1200px wide $page->of($of); // restore initial output formatting state
  21. I've upgraded Processwire from 2.8 to 3.0.148 and also upgraded map marker module to 2.0.9 Still on the admin sub location maps are not visible on page load on chrome. Need to double click then it appears. While on Mozilla it works fine. Why this is happening?
  22. Big fan of the implementation of this. I was still using soma's Module Manager with a quick hacky fix for the lack of pagination support. I am having an issue, however - when selecting the "Show All" category, it just shows nothing. Permanently. From what I can tell, it's not even sending an XHR request which is probably part of the problem. πŸ˜› (For reference, I'm using PW version 3.0.158 dev) If that could be fixed, it would basically be perfect, imo. Edit: And I do agree with @Peter Knight about using a select rather than radio, and "Active" and "Inactive" seem to have more obvious meanings than "show only uninstalled", imo.
  23. There's a lot I use regularly, but one of my favorites is Soma's ModulesManager. Makes it much easier to install other modules lol It's worth noting though that Soma's module needs a slight update in order to work properly these days: https://github.com/Awesomolocity/ModulesManager/
  24. Last week
  25. For a field named "colour" allowing pages using a template named "colour": $wire->addHookAfter('InputfieldPage::getSelectablePages', function($event) { $page = $event->arguments(0); $pages = $event->wire('pages'); if($event->object->hasField == 'colour') { // Find pages that are already selected on another user page $already_selected = $pages->find("template=colour, colour.owner.template=user, colour.owner.id!=$page->id"); // Selectable pages are those that are not already selected $event->return = $pages->find("template=colour, id!=$already_selected"); } }); Owner selectors: https://processwire.com/blog/posts/processwire-3.0.95-core-updates/
  26. 1. Set the columns to 0 in the Page Reference field settings. 2. Use AdminOnSteroids to add some custom admin CSS that applies columns to the list of checkboxes: #wrap_Inputfield_your_field_name .InputfieldCheckboxesStacked { column-count:2; }
  27. Similar topic: So I guess it's not supported by the core. But it's not difficult to write your own custom JS to show/hide the field: $(document).ready(function() { // Show/hide a field if another field's value is zero function showHideField() { $('#wrap_Inputfield_my_textarea_field').toggle($('input[name="my_integer_field"]').val() === '0'); } // Show/hide on DOM ready showHideField(); // Show/hide on input change $(document).on('change', 'input[name="my_integer_field"]', showHideField); }); You'll need to get clever with the jQuery selectors if you are using fields inside a Repeater.
  28. Thanks! Yes i made it for the specific needs of a client website but the idea is to pollish it a bit and publish it in the Processwire repository, I want to add some options like custom amount of cols etc
  1. Load more activity
  • Create New...