Jump to content


  • Posts

  • Joined

  • Last visited

Everything posted by JoshoB

  1. Edit (complete wipe of original message): I couldn't get this to function, so I've changed how I handled my authors to clean up the users for comments etc. This means I'm using the original database/install instead of a separate one for comments.
  2. Thanks everyone, this has all been really helpful!
  3. Excellent. What would be the best way to connect to the second database/website? Should I make another wire instance? I feel like it should be simple.
  4. Oh yeah, I am familiar with the database structure. I should have added that I want people to be signed in before they're allowed to post comments, so the website would see an influx of users. Currently, all "users" on the website are authors who write articles, and I would like to keep this list as small as possible. (I know I can use roles to manage the lists, but I would prefer a simpler solution.) There's also the issue of security: I don't want there to be any risk that a user is able to mess anything up, and I'd prefer to keep them out of the main database.
  5. Hello everyone, I manage a large site and would like to add the ability for visitors to add comments to articles. However, I also want to keep the core website database relatively "clean". So my idea was to install a fresh copy of ProcessWire to a subdomain (say, account.ancientworldmagazine.com), where users can register, sign in, and edit their profile. I could also sign in and manage comments. My idea is to load the new database into the website, so that a page can check if there's any pages with comments in the new database. So, for example, article X on my original website gets loaded, there's an if-statement that checks if there's a page in the new database with the field awm_page_id = $page->id (where $page is the article on the original website). If yes, it proceeds to load the comments from that database; if no, it creates a new page with the field awm_page_id = $page->id and people who are signed in can then start posting comments. So, is this feasible? Does it pose any security risks? Will it create unnecessary overhead and slow everything down? Am I better off just sacrificing the cleanliness of my website's database and enabling comments on there directly from the backend? I'd love to hear your thoughts.
  6. So I've been using FormBuilder on client websites, but now they want to be able to track the form output using Google Analytics. I have no idea how they should go about this. Any suggestions that I could pass onto them? Thank you very much!
  7. Wow, that is perfect! You should add it to the module repository. Thank you so much!
  8. 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.)
  9. 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?
  10. 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.
  11. 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!
  12. 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.
  13. This looks like it ought to work! Sadly, it doesn't. $page->children doesn't seem to do anything (the results get dropped).
  14. 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.
  15. 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.
  16. 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!
  17. They didn't specify, just that they'd "run an update".
  18. 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.
  19. 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.
  20. No, asm is broken on every field that uses it. No, templates don't seem to matter: it's the asmSelect field that's broken somehow. AutoComplete works as expected. Switching back to asmSelect has no effect. Which cache? Cache module is not activated. How so? Other websites on the same server don't have the issue with asmSelect that this website for some reason has.
  21. No, not to my knowledge. I would have received a notification. I upgraded ProcessWire to the latest version, as I said before, and there were no errors. All other JavaScript in the backend seems to work fine, except for the asmSelect. It's utterly baffling!
  22. Just switched to UIKit and it makes no difference.
  • Create New...