Jump to content

PagePathHistory


ngrmm
 Share

Recommended Posts

I have a redirect problem with a page inside a multi language website and would like to have a look at the page path history of that page.
But I get an error if I use this for example:

https://processwire.com/api/ref/page-path-history/

$array  = $pagePathHistory->getPathInfo($page);

// Error: Undefined variable: pagePathHistory on line: 1 Exception: Call to a member function getPathInfo() on null on line: 1

How can I use the page-path-history class.

Link to comment
Share on other sites

Do you have the Page Path History module installed (it's in the core modules)?

Also, I think you should start by using getPathHistory(), and then getPathInfo() for information about a particular path.

Link to comment
Share on other sites

yes it is installed.
It is still giving this error

Call to a member function getPathHistory() on null

maybe it is because it's a backend module and has to be initialized on the frontend before?

Link to comment
Share on other sites

On 3/21/2023 at 5:58 AM, ngrmm said:

would like to have a look at the page path history of that page

You can view the path history when the page is open in Page Edit, on the Settings tab:

image.png.6211134233cb22491cb5eb61786d5881.png

And from the API:

image.png.df587c5d1b8a012138189d1a9869258f.png

  • Like 2
Link to comment
Share on other sites

@Robin S thanks!

Okay. The history is empty!
my page names are

/20years (default – language)
/de/20Jahre (de – german second language)

When I enter www.domain.com/20jahre the page shows up but in the default language. Is there any cache that I have to empty?
Even if I add de:/20jahre in the backend, it does not work as it should.

 

UPDATE: Or is it a problem to have a redirect url-name like the page name of the non default language?

Edited by ngrmm
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...