Jump to:

10850 Posts in 2517 Topics by 1793 members

All other Modules

SilverStripe Forums » All other Modules » New MetaManager Module - Automate your MetaDesc & Keywords

Discuss all other Modules here.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1 2
Go to End
Author Topic: 4314 Views
  • Martijn
    Avatar
    Community Member
    271 Posts

    New MetaManager Module - Automate your MetaDesc & Keywords Link to this post

    Coming from a Joomla background, I needed something more flexible and easier to maintain. Silverstripe seems to fit those needs quite well.

    This is my first module build for Silverstripe. I wanted to autopopulate my MetaDescription and MetaTitle fields, based on the contentfield and added some more features.

    Features
    * Set Metadescription with the first lines of your content
    * Set Metakeywords ordered by keyworddensity of your content
    * Exclude words, set amount of keywords and set minimal wordlength
    * Set Metatitle with Title (optional)
    * Disable the popup wich asks if you want to change the urlsegent when you change your page title
    * Hide the extrameta field

    You can set all options in the _config.php file.
    The module adds a checkbox above the Content field, so you can bypass the Meta update function on save. Set default state also in config.

    Improvements or comments?
    Please post them here!

    Attached Files
  • Martijn
    Avatar
    Community Member
    271 Posts

    Re: New MetaManager Module - Automate your MetaDesc & Keywords Link to this post

    I updated the metamanager with more options.

    Changelog
    *Updated disable_update_url so it does alter the URLsegment without the Confirm dialog. SS does fire a 301 Permanently Moved header on url change.
    *Added option to choose wether to update the URLsegment automaticly or not.
    *Added custom UpdateURL.js for autoupdate URLsegment without Confirm dialog.
    *Added option to select wich metafields to update.
    *Added option to hide the checkbox.
    *Added option to select the position of the update checkbox.
    *Added option to show wich metafields will be autoupdated in checkboxlabel.
    *Added option to disable the module without removing the module from the site.
    *Added option to limit the MetaDescription Length.
    *Added translationstring for the Update Meta-data checkbox.
    *Added English and Dutch language files.

    All options can be set in the _config file.

    Please feel free to comment.

    Attached Files
  • Kalileo
    Avatar
    Community Member
    127 Posts

    Re: New MetaManager Module - Automate your MetaDesc & Keywords Link to this post

    Yeah, such a module can be really helpful and time saving. Thanks.

  • Martijn
    Avatar
    Community Member
    271 Posts

    Re: New MetaManager Module - Automate your MetaDesc & Keywords Link to this post

    Hi Kalileo,

    Your welcome, Hope it can be of use!

    If you find anything strange let me know.

  • Juanitou
    Avatar
    Community Member
    322 Posts

    Re: New MetaManager Module - Automate your MetaDesc & Keywords Link to this post

    Hi Martinj!

    That's a really nice idea. There is at least a problem: entities. For example, in a French page containing the word société the MetaDescription field will show société and the list of keywords could include eacute (I don't understand why).

    I thought that decoding entities would be a straightforward task, even for a lame PHP coder as me, and it was the case for the line 279 of MetaManagerDataDecorator.php:

    $this->owner->MetaDescription = html_entity_decode(strip_tags($this->owner->Content), ENT_COMPAT , 'UTF-8');

    Now the MetaDescription is nicely showing all special chars. But if I change in the same way the line 325, in the function calculateKeywords(), the result is a blank keywords field in the CMS and a wrongly encoded <meta name="keywords" …> field in the page's code.

    I don't understand why this is not working, why it's not showing the keywords in the CMS but publishing the meta tag, but wrongly encoded. Sorry for not being more helpful.

    Best regards,
    Juan

  • Martijn
    Avatar
    Community Member
    271 Posts

    Re: New MetaManager Module - Automate your MetaDesc & Keywords Link to this post

    Hi Juanitou,

    Thanks for reporting.
    I will check it out!

  • Juanitou
    Avatar
    Community Member
    322 Posts

    Re: New MetaManager Module - Automate your MetaDesc & Keywords Link to this post

    Hi!

    The solution I’ve found needs to include a str_word_count_utf8() function instead of str_word_count() and using mb_convert_case() instead of strtolower(), all this in your method calculateKeywords(). I don’t know if it fits every config, but it works for me. File attached.

    Hope it helps,
    Juan

    Attached Files
  • steve_nyhof
    Avatar
    Community Member
    224 Posts

    Re: New MetaManager Module - Automate your MetaDesc & Keywords Link to this post

    How can I set it so that the Navigation is also auto updated?

    4314 Views
Page: 1 2
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.