glensc / dokuwiki-plugin-pageredirect

Redirects page requests based on content
https://www.dokuwiki.org/plugin:pageredirect
19 stars 19 forks source link

RFE: work with backlinks #3

Open juray opened 11 years ago

juray commented 11 years ago

Suppose, there are synonymic pagenames and other wiki pages refer to all (with roughly equal counts). With redirect all such links lead to one "target" page, well.

What is wanted: view on backlinks search all pages refer to all this synonyms (now links to this page found only directly refer to this target page)

Is this possible by modify this plugin or need to rewrite dokuwiki core?

michitux commented 11 years ago

This is possible in the plugin by handling the INDEXER_PAGE_ADD event and modifying the recorded link information. The plugin would need to check for each recorded link if the target page redirects to another page and if yes add the page that is the target of the redirect to the list of links.

glensc commented 8 years ago

@juray can you make example which page should be related to which page. i.e describe three pages, their content and their inner relations. say page a, page b, page c.

glensc commented 8 years ago

i suppose for backlinks need to set $metadata[relation][references] list of page ids?

michitux commented 8 years ago

@glensc: yes, that is the information that is used by the indexer. I think a possible scenario is the following: page A links to page B. However, page B redirects to C. When viewing backlinks of page C, A should be shown. As I said in my previous comment, this could be done by modifying the information of page A when it is added to the index.

glensc commented 8 years ago

@michitux do you have example of project which unit tests this?

also the $metadata['relation']['references'] should be updated not replaced. how to ensure it doesn't get stale if i just "add" items there. because i can't remove items from the list, they could be added there by other plugins.