10706 Posts in 2388 Topics by 1763 members
Page: 1 2
|Go to End||Next >|
21 July 2009 at 4:53pm Last edited: 21 July 2009 5:10pm
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.
* 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!
22 July 2009 at 4:26am Last edited: 27 July 2009 3:24am
I updated the metamanager with more options.
*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.
23 July 2009 at 2:58pm
Yeah, such a module can be really helpful and time saving. Thanks.
23 July 2009 at 10:46pm
Your welcome, Hope it can be of use!
If you find anything strange let me know.
31 July 2009 at 5:47am Last edited: 31 July 2009 5:49am
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.
1 August 2009 at 1:05pm
Thanks for reporting.
I will check it out!
22 October 2009 at 5:25am
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,
6 November 2009 at 1:21pm
How can I set it so that the Navigation is also auto updated?
Page: 1 2
|Go to Top||Next >|