Jump to content

Comments module integration


theqbap
 Share

Recommended Posts

Hello everyone!

I'm using ProcessWire to run my webpage, and I'm always looking for articles and post to fix or improve some thing on the forum. I'm using now DISQUS for comments on my ProcessWire webpage ex. Avast Free Antivirus download, but it's heavy. The best solution would be to switch to fieldtype Comments. The trick part is that I'm using a hook to rewrite the URL for SEO reasons, I code a redirect mode based on page id -> https://kubadownload.com/avast-free-antivirus-download.1223.html

wire()->addHookAfter('Page::path', null, 'hookPagePath');
function hookPagePath(HookEvent $e) {
$page = $e->object;
if($page->template == 'template-name') $e->return = "$page->name" . "." . "$page->id" . ".html";

Of course I can install the Comments field, but it's now working. When I add a comment it redirects to home page, and it's not saved to database. Any ideas how can i fix this?

Every help would be highly appreciated ?

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...