Jump to content

J_Szwarga

Members
  • Content Count

    34
  • Joined

  • Last visited

Community Reputation

4 Neutral

About J_Szwarga

  • Rank
    Jr. Member

Recent Profile Visitors

334 profile views
  1. This one has got me scratching my head for 2 days so hoping someone can shed light... I have a couple grand-child pages that require a top-level url for business reasons. I followed the ideas present in this thread and they work great... 1. Enabled url segments on home page 2. Add code to home.php that looks for specific url segment and outputs appropriate grand-child page instead of home page. 3. Add hook before "Page::path" that removes the parent from the generated url segment. So now instead of /calendar/events, it now works as just /events However, one of these grand-child pages (/calendar/events) also uses pagination to present a list of items. Before making the above changes, pagination works correctly...the url that gets generated with "renderPager()" to get to page 2 results is like this: calendar/events/page2 After adding the above code to remove the "parent" from the grand-child url, I would expect the "renderPager()" to return THIS: /events/page2 but instead it is returning THIS: /events/events/page2 Which of course, doesn't work. After clicking the page 2 link (/events/events/page2) the page re-renders with all page 1 results still, and then the pager continues to generate bad links, this time like: /events/events/events/page2/page2 Is there a known issue with combining url segments with pagination on the same page? If I need to, I'll end up just doing a permanent redirect from my top-level urls down to the grand-child pages, if that's the only way to get pagination to work. I was hoping for another way unless this is a know and un-fixable issue. Thanks!
  2. I created a custom page type almost exactly as in the tutorial here: https://processwire.com/docs/tutorials/using-custom-page-types-in-processwire/ Everything working great with custom methods that I added to the Event object as well as the Events object. However, whenever I try to use $events->findOne($selector) I get Method Events::findOne does not exist or is not callable in this context $events->find() works, and $events->get() works. But I need findOne since I dont want to retrieve the page if it is not viewable. Since my $events class is based on PagesType, I thought that findOne should come with that for free. But looking at the PagesType class, there is no findOne method at all... I'm confused why PagesType doesn't implement findOne, and how do I get my custom events class to make that method available?
  3. Looking forward to when the good news comes! 👍🤞 As @Pete said earlier, if you need anyone to test it out, give us a shout.
  4. Here's my query: $pages->find("template=collection, sort=-children.count"); However it is sorting my collections based on the total number of children. I've searched all over and cannot find a way to take visibility into account for this property. (I don't want to include any hidden or unpublished children). While rendering the child items in the html, I use $collection->numChildren(true) to show the number of visible, published children. But the sorting is all messed up because it includes all the hidden and unpublished. There's got to be some way to find the count of visible children in an efficient manner, without retrieving every single record to check it with a for loop??
  5. Can this module be altered to work with 12 HR instead of 24 HR?
  6. @Macrura Would you be able to provide some example code for how to implement fullcalendar? Trying to get it working for several projects.
  7. @gmclelland Did you ever find a solution to this issue? I've been searching the forums for this exact thing and can't find anyone else with this problem. Thanks!
  8. What is the best practice for having a form (only accessible to a logged in user) save the user's progress between sections of the form? Fieldsets? Multiple forms? Use case: I have a very long application form that would take 30 minutes for the applicant to fill out and I would hate for all progress to be lost due to user error. The progress needs to be logged into the user's page. Thanks!
  9. Rookie Question Alert: Attached is my piece of code from my _main.php. What do I need to do in this section of my code to remove the dropdown-toggle from the grandchildren of "Home" in my menu? I don't want to remove the toggles from Home's children, but their children I do. if($child->numChildren > 0 && $child->url <> "/"){ $class .= " dropdown-toggle "; } if($page == $child){ $class .= " active "; } elseif ($page->parents->has($child) && $child->url <> "/") { $class .= " active "; }
  10. Do you notice in my screenshot of my site, there's extra divs being generated? I think it's a problem with my foreach loop. I'm guessing the solution would be to stop the foreach loop after all the page references are echoed...if that makes any more sense.
  11. No empty speakers. I'm using a page reference to assign certain speakers to certain camps
×
×
  • Create New...