Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The blog links do not be shown when blogs are placed in a nested namespace #6

Open
shimmtak opened this issue Dec 30, 2018 · 6 comments

Comments

@shimmtak
Copy link

The blog links do not be shown when blogs are placed in a nested namespace.
For example, if a blog is placed at
Dokuwiki_Root/some/path/myblogspace/*
the link does not appear.
It works only when a blog is placed at
Dokuwiki_Root/myblogspace/*
(FYI) Please be careful when you test the issue, because the blog-plugin also has a problem when it is placed in a nested namespace.
Please see below for reference.
dokufreaks/plugin-blog#95

shimmtak added a commit to shimmtak/plugin-bloglinks that referenced this issue Dec 30, 2018
close dokufreaks#6

To fix the issue, getting namespace explicitly in handle_act_render. close dokufreaks#6
@michitux
Copy link
Member

What's the ID of the page where it doesn't work and what's the value of the enabled_namespaces configuration option of the bloglinks plugin?

@shimmtak
Copy link
Author

shimmtak commented Jan 1, 2019

Thanks. I had mistaken at the value.

When I placed the blog at Dokuwiki_Root/some/path/myblogspace/*,
I set the value of the enabled_namespaces only to myblogspace, without some and path.

By the way, I am glad if I can enable bloglinks in the case, without setting the value to some:path:myblogspace.
Because, I would like to create blogs with ease, through forms and namespace templates.
I can fix the name of myblogspace, but the some or path may be arbitrary names (it is specified by wiki users through a bureaucracy form).

@michitux
Copy link
Member

michitux commented Jan 1, 2019

A possibility might be to change the plugin to interpret each part of the value as regular expression. For backwards compatibility, the regular expression would need to match the beginning of the ID. Everything that is matched would then be interpreted as the blog namespace.

@shimmtak
Copy link
Author

shimmtak commented Jan 1, 2019

Yes, using regular expression sounds good.
It is useful if at least one (middle) part of the value can be a wild card or regular expression, for example some:*:myblogspace.
Interpreting each part of the value as regular expression may be the best.
(I am afraid that the backwards compatibility rule is not sure to me...)

shimmtak pushed a commit to shimmtak/plugin-bloglinks that referenced this issue Jan 13, 2019
shimmtak pushed a commit to shimmtak/plugin-bloglinks that referenced this issue Jan 13, 2019
@shimmtak
Copy link
Author

I revised the patch. It enable users to use regular expression to set the enabled_namespaces value such as some:.*:myblogspace.
Each part of the value (some, .*, myblogs) will be compared to the corresponding part of current showing page's $ID.
Therefor, the namespace depths of the value and the target blog should be the same.

@drbeco
Copy link

drbeco commented Feb 24, 2022

I can't seem to get this working.

My blog is in the root, so the blog namespace is empty.

Posts are nested by year and month. This is the default from the old blogger by google, and I'm importing old posts to the same URL to avoid losing links. So the link must be:

http://blog.domain/2022/02/this-is-a-post.html

(using rewrite rules from .htaccess, I managed to allow .html URL's to work with dokuwiki, so that is ok)

I managed to make this work with plugin»blog»namespace empty.

But for plugin»bloglinks»enabled_namespaces, letting it empty doesn't seem to work, and using .*:.* don't help either.

Is there a way to accomplish this? Thanks


Update:

I was able to make bloglink work in these conditions using:

plugin»bloglinks»enabled_namespaces=2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017,2018,2019,2020,2021,2022,2023,2024,2025,2026,2027,2028,2029,2030

But it only link within the year. In the last post of some year, it won't link to January next year, for example (or back).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants