Closed shallimus closed 8 years ago
I don't think this is a bug, exactly, but hopefully I'm not alone in wanting to achieve the expected behaviour I describe above. I submitted this as a feature request as suggested at https://www.dokuwiki.org/plugin:backlinks2
I recognize that there may be use cases where the current behaviour is desirable (although I can't think of any?) so perhaps this behaviour should be controlled via a switch/argument to the backlinks invocation.
Thank you for your time spent reading & thinking about this.
this behaviour seems to be caused by the include plugin; your template should use the sidebar mechanism which we handle correctly afaik. See: https://github.com/mprins/dokuwiki-plugin-backlinks/blob/master/syntax.php#L69
Thank you @mprins for taking a look.
I am using bootstrap3 template, which as far as I know does not depend on the include plugin. I used the word "include", but that was a poor choice of word on my part - I used it generically, but it has a specific meaning here. I'm not doing an include of my footer, but rather using the bootstrap3 template standard footer mechanism.
Would it make sense for me to edit the title of this Issue to omit any mention of the word "include"? I don't want to cause confusion, but I see now that my original title is not very clear.
Based on what you said, I tried adding {{backlinks>.}} to my :sidebar. When I did this, and then navigated to a page to which there are certainly backlinks, the plugin displayed "no results were found", which is also not expected. I'm not using the include plugin anywhere on the content page, nor on the sidebar. Are you suggesting that backlinks is incompatible with include plugin if the latter is installed, even if the include plugin isn't used on a particular page, or only that you cannot expect backlinks to work when it's included? I'm not doing the latter.
I realise that you cannot reasonably be expected to provide support for every template out there, but any suggestions for what I might look for next are appreciated. If there's anything specific I could provide from the debug log, please let me know. I cannot provide the entire thing, as the wiki contains information which belongs to my employer.
Whether or not you have further advice to offer, thank you for your work on the backlinks plugin.
I have not used this plugin inside a sidebar, looking at the comments in the code a sidebar should have an empty $INFO array and the the id of the page embedding the sidebar should be used
A footer is any different from a sidebar really, but the bootstrap3 template seems to be using it's own functions to load things
Based on what you said, I tried adding {{backlinks>.}} to my :sidebar. When I did this, and then navigated to a page to which there are certainly backlinks, the plugin displayed "no results were found", which is also not expected.
You may need to purge the page, add ?purge=1
or &purge=1
to the url to force this
Thanks @mprins
I tried ?purge=1, and I went from "no results" to a long list of backlinks - many more pages than actually link to the content page(s) I tested; it looks like the same too-long list I described in my initial post.
Next, I did some more testing, using pages in a different namespace, and discovered that the backlinks results are being cached somehow, so that they don't necessarily match up at all with the content page I'm looking at. If I append ?purge=1 to a content page X's URL, the correct backlinks for X now appear, but then when I navigate to a second content page Y, the backlinks shown are still for page X.
I tried adding NOCACHE directive to the sidebar, and when that alone didn't work, I also added NOCACHE to each content page X and Y, but only ?purge=1 seems to cause the correct backlinks to appear.
I have had the same probs. I think the current version of the backlinks-plugin don't work outside of the mainpage (sidebar, pageheader, pagefooter).
So I build a very simple plugin only for this usecase. See mozblink.zip
Syntax {{mozblink}}
without any options.
This work in dokuwiki and bootstrap template as well.
Thank you @moz0817
I gave your syntax.php a quick read, manually installed the plugin, altered the German message to English, and this works exactly as expected. From what you've written here, and from comments in your code, I'm guessing this is a stripped-down forked version of the backlinks plugin?
...but yes, this does what I'm looking for. Vielen dank, und schöne grüsse aus Canada!
... yes it's a stripped-down forked version. I'm not familar with the GitHub system to load it up.
It make's me happy you can use it.
environment
expected behaviour
NOTE: I don't think this is a bug, but rather a feature which would make sense, at least to me.
When {{backlinks>.}} is entered onto Page A (e.g. a footer), and Page A is included within Page B (e.g. any standard wiki content page), the plugin should show backlinks to Page B rather than the included Page A.
actual behaviour
Footer contains backlinks to lots of other pages. I haven't yet determined exactly what the criteria are, but I suspect it is a truncated list of all pages on the wiki. I think backlinks is looking at pages which include :footer
steps to reproduce actual behaviour
Use bootstrap3 template, which has a :footer hook to include a footer page on each wiki page; place {{backlinks>.}} in :footer page; navigate to any other page; backlinks plugin should show backlinks to the current page, not to :footer
error log
n/a
debug log
n/a - I think?