Jump to content

JoshoB

Members
  • Content Count

    98
  • Joined

  • Last visited

Community Reputation

21 Excellent

About JoshoB

  • Rank
    Full Member
  • Birthday 01/27/1980

Profile Information

  • Gender
    Male

Recent Profile Visitors

2,173 profile views
  1. Wow, that is perfect! You should add it to the module repository. Thank you so much!
  2. I'm testing it by putting the code in init.php (which gets loaded first), then going to the page in question via another browser with ?preview=true, and I get a 404 page instead of the article I want to preview. But maybe forcing the 404 page to reload would be an idea. (Even though I cannot get that to work either.)
  3. I upgraded to the latest version of PW, but no dice. Doesn't work, with or without slash. I also have AIOM installed -- could that be a problem?
  4. Thank you for the suggestion, but it doesn't work: I still get a 404 error, even when I put it in site/init.php.
  5. So I'm the editor of a large website and it's useful for me if my authors can check their articles before they are published on the web. I'd prefer to do this without needing them to sign in (with either their own account or a preview account). I figured the easiest way to do this is with a GET variable, so if someone goes to e.g. this URL: https://www.examples.com/articles/test?preview=true They would be able to see the specific article in question. But building the override eludes me; I tried to stick it in the template, but it's not working (using $pages->find or $pages->get with check_access=0). I feel like this ought to be simple, but I cannot figure it out. Does anyone have a suggestion on how to solve this? Many thanks in advance, as always!
  6. Cheers @Autofahrn, that put me on the right track. {$page->children} didn't work as expected, but in the PHP file in question, I did loop through all categories to generate a clickable list, so I simply populated $pageSelect with the ID of every item as it looped through them. I then fed the variable into the selector and that did the trick! Thanks again for the help, everyone.
  7. This looks like it ought to work! Sadly, it doesn't. $page->children doesn't seem to do anything (the results get dropped).
  8. Weird, it generates an error: Error: Exception: Unknown Selector operator: '' -- was your selector value properly escaped? has_parent is apparently not valid as a subfield selector.
  9. Ah yeah, sorry. That is correct: $page in this instance has a category.php template. Your solution sadly generated an error. I edited it to read: "template=product, limit=10, categories=[has_parent|id=".$page->id."], sort=categories.sort, sort=$sort_results" But then it doesn't list any products. I think that's because it now specifies it has to either have a parent or the ID needs to be specifically that of the page. What I'd like to do is to specify that the categories field includes either the current $page or one of the current page's children (i.e. the subcategories). So I was hoping something like this might work: categories.parent=$page|$page->children But no dice.
  10. So I have another problem. On one of our websites, we sell educational books. Each book is assigned to one or more categories. Yesterday, I added subcategories and assigned books to them. The structure for the categories are as follows: Home Categories (template: categories.php) Category (template: category.php) Subcategory (template: category.php) Books are assigned categories via a PageArray field (with asmSelect) also called "categories". Books themselves have a template "product.php" and are grouped under "Products" (with template "product.php"). To make sure books are listed in the proper category on the website, I used this selector: $selector = "template=product, limit=10, categories.parent=$page, sort=$sort_results"; $sort_results is a simple variable to switch between alphabetical sort, sort by release date, etc. The issue is the categories.parent=$page element. To my mind, this should list products that have a category that is either the requested page (people are browsing the "Latin" category), as well as all subcategories. The problem is that products in subcategories are ignored by ProcessWire. So if a book is listed in "Latin" and another has a category that's a child of "Latin", the first book is shown when I'm browsing the "Latin" category, but not the second one. The second one is shown ony if I go to the subcategory page. Does someone have a solution for this issue? I just want the category page to list all products in that category including subcategories. Thank you!
  11. They didn't specify, just that they'd "run an update".
  12. Well, it turned out to have been a server error. They "ran an update" and now everything is back to functioning as it did before.
  13. Modules in use are: AIOM Email Obfuscation (EMO) Video embed for YouTube/Vimeo Shouldn't be any issues there. And I have these modules installed on other websites (even on the same server) without any problems.
×
×
  • Create New...