Slightly Some

Nucleus plugin: NP_LMFancierURL v2.0

By: Leo
27/06-11, 22:55
Category: Code
Nucleus CMS

Version 2.0 of NP_LMFancierURL is a total rewrite from version 1.0. It contains several major additions and changes. Among these are:

  • 2 new URL schemes: Compact and Classic. URL schemes are configurable on site and blog level. The Compact URL scheme is like the Fancier URL scheme in the previous version of the plugin, but drops the keywords from the URL.
  • All URL parts are editable.
  • Keywords are configurable on site and blog level.
  • Better handling of non ASCII 7-bit characters when making URL friendly text values.
  • How to handle category in item URLs is configurable on site and blog level.
  • Will return a 404 not found HTML error using the error skin when the URL contain unknown parts.
  • Item skinvar that return a canonical item URL that can be used as canonical link in item page <head> section.

The full documentation and the latest version of the plugin can be found on the LMFancierURL plugin page.

Comments

  1. From: Lord Matt
    18/07-11, 15:26
    It still tickles me that your chose the prefix LM as a lot of my custom (and of no interest to anyone else) plugins are also NP_LM* as LM stands for Lord Matt. Thus I automatically love it just a little bit more.
  2. From: Leo
    18/07-11, 21:38
    :) The LM prefix is an inheritance from when my blog site was meant to use an other domain name. LM is an abbreviation for the old domain name.
  3. From: BabyBichu
    03/08-11, 09:03
    It's a wonderful plugin but when I had added,the member link(For Example,the author link under an item title.) didn't work.Also,the archive link(http://babybichu.co.de/enblog/archives) don't work.
    Help me
  4. From: BabyBichu
    03/08-11, 09:27
    I'm sorry now I changed it to compact and the error fixed.
  5. From: BabyBichu
    03/08-11, 10:01
    I've got another question that my member link is "http://babybichu.co.de/enblog/babybichu-2"
    why does the -2 appear?just because i'm the creator of the blog?also,i wanna know to remove -2.
  6. From: Leo
    03/08-11, 14:12
    Thanks for trying out my plugin.

    the member link didn't work. Also,the archive don't work.

    It seems to be a bug with the fancier url scheme in the plugin, I'll look into it later.

    why does the -2 appear?

    Each object identification needs to be unique, and at the time this member was added was there 2 other objects on the blog called babybichu. To make the identification for this member unique was a -2 added.

    The other objects called babybichu on your blog seems to not exist anymore, so you should be able to go use the LMURLParts plugin admin page to change the identification for this member and remove the -2 part. (Choose "Edit URLParts" for "Top Level parts", and then "Edit URLParts" for "Members")
  7. From: BabyBichu
    05/08-11, 05:01
    I can't find Top Level parts,what's up?
  8. From: BabyBichu
    05/08-11, 11:40
    I'm sure I'm the super admin,but look at this:http://i55.tinypic.com/15oi0qb.jpg
    Where's the Top Level parts?
  9. From: Leo
    05/08-11, 13:29
    It seems to be impossible to get the link for the top level parts when your blog site only has one blog. You can use the direct url to the top level parts: /enblog/nucleus/plugins/lmurlparts/?blogid=-1 or create a dummy blog.

    I have noted this as a bug, and will look into it.
  10. From: Leo
    06/08-11, 16:04
    All known problems with the v2.0 version of the plugin has been addressed in the v2.0.1 release.
  11. From: Lord Matt
    07/08-11, 23:45
    On install I got a white screen. This does not seem to have broken anything but I did have to update the subscriptions as only some of them had been recorded. [2.0.1]
  12. From: Leo
    08/08-11, 00:10
    You probably got some php error on the install. Do you have access to the server error log? Without the error message is it quite hard to find what did go wrong. What version of php are your server using?
  13. From: Lord Matt
    18/08-11, 14:52
    I turned on error reporting and got:

    Notice: Undefined index: global_encoding in /.../public_html/nucleus/libs/PLUGIN.php on line 512

    Fatal error: Call to undefined function mb_detect_order() in /.../public_html/nucleus/plugins/NP_LMURLParts.php on line 667

    Which suggests to me that MultiByte encoding handling is not present.
  14. From: Leo
    18/08-11, 15:56
    Thanks for the error messages. The problem seems to be the mbstring extension. The extension is non-default, so it may not be available in the php installation.

    I'll look into making a workaround for this.
  15. From: Lord Matt
    18/08-11, 17:52
    Cool. I installed php-multibyte via yum and restarted apache which seems to have solved things for me but now the URLs which it seems to be generating correctly all 404. Any ideas?
  16. From: Lord Matt
    18/08-11, 18:02
    Actually forget that last comment about 404s. My bad - I forgot to set up a .htaccess file. I hang my head in shame.
  17. From: Leo
    18/08-11, 18:03
    Good you got it working. :)
  18. From: Jezzer
    25/08-11, 19:58
    Very impressive - thank you!!

    However.....

    I have been trying to use your plugin to replace the FancierURL2 plugin which I only discovered has issues with categories when I added a second blog.

    My blog is already indexed well with search engines, so it's obviously important to me that URL formats remain identical if I am to change plugins.

    My initial observation regarding keeping the same URLs as the FancierURL2 format is that my pages are currently indexed using dates in the yyyy/mm format, whereas your plugin seems to offer dates in the yyyy-mm format.

    I had hoped to be able to fix this myself easily by changing a couple of lines of code in the NP_LMFancierURL.php file (lines 1016 and 1017). I have used phpMyAdmin to verify that the urlpartnames are now in the correct format in the database, but the item URL is always returned in the format /Archive-nn/ instead of in a date format, regardless of whatever date setting I enter in the admin control panel.

    I figure there's a bit more code that needs to be altered. :)

    Are you able to help please?
  19. From: Leo
    26/08-11, 01:07
    Having yyyy/mm instead of yyy-mm in item URLs goes against some of the design choices that was made when the V2 of the plugin was made.

    Each part of the URL must be unique and the URL part value must have a record in the LMURLPart plugin. And an URL part can't be a valid number.

    It would be possible to create records for years and months in the LMURLPart plugin, but I don't know if I can loose the not a valid number rule.

    Even if it would be possible to use the yyyy/mm parts in item URLs, the item URLs generated with LMFancierURL may be different to the item URLs generated by the FancierURL2 plugin. For this I made the LMRedirectToItem plugin. With it you can set up permanent redirects from all item URLs in the old URL scheme to the item URLs in the new URL scheme. With the redirect plugin it is no longer necessary to keep the same item URLs after the plugin change.

    An other option maybe is to use the new free form item URL feature that will come in the next version of the LMFancierURL plugin. (Which is released soon.)

    A final option is to use v1.0 of the LMFancierURL plugin. It should fix many of the problems in the FancierURL2 plugin and have the option to use yyyy/mm in item URLs. But you still may get problems with item URLs not being the same as the FancierURL2 item URLs.
  20. From: Jezzer
    26/08-11, 09:30
    Hi Leo, and thanks for the reply.

    I think the answer, as you suggest, is probably a 301 redirect using your LMRedirectToItem plugin. It should be relatively easy to implement.

    It did get me thinking, however, on the whole subject of using dates within the fancy URLs. Is there actually any benefit in using them (eg. better SEO), other than to see at a glance when the blog post was written? Or do they simply make the URL more bloated than necessary?
  21. From: Leo
    26/08-11, 13:07
    I don't know much about SEO, but I would think that the date in the URL doesn't matter.

    I'm using dates in the item URLs on this blog mostly because it makes it look that the item URLs and the archive URLs are part of the same directory structure.

Add new comment

This item is closed, it's not possible to add new comments to it.

Comments must be approved before being published.

nucleuscms.org
Valid XHTML
Creative Commons License

Unless otherwise specified is all original material on this website licensed under a Creative Commons License.

Baronial