<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>Page comments</title>
		<link>http://www.ssbits.com/home/</link>
		

		
		<item>
			<title>Comment by 'Jeremy' on Autofill MetaDescription and MetaKeywords on page save</title>
			<link>http://www.ssbits.com/autofill-metadescription-and-metakeywords-on-page-save/#PageComment_738</link>
			<description>Just a suggestion. I didn't like the basics of the code, in that it saved *every* time, even if I go back and want to make changes, it would overwrite those changes. Also, it didn't do nearly enough clean up for my taste, so I added to that. Hopefully it will be useful to someone else:

        if($this-&gt;ID){
            // fill in MetaDescription without any tags
            if($this-&gt;record['Content'] &amp;&amp; empty($this-&gt;record['MetaDescription'])){
                //$this-&gt;record['MetaDescription'] = preg_replace($p,$r,htmlspecialchars(strip_tags($this-&gt;record['Content'])));
                $this-&gt;record['MetaDescription']=preg_replace('/ (?= )/', '', trim(preg_replace('/[\\~`!\&quot;$%^&amp;*()+{}[\]&lt;&gt;?\/|=]/', '', trim(strip_tags(htmlspecialchars_decode($this-&gt;record['Content']))))));
                
            }
            // fill in MetaKeywords
            if($this-&gt;record['Content'] &amp;&amp; empty($this-&gt;record['MetaKeywords'])){
                $this-&gt;record['MetaKeywords'] = self::calculateKeywords(preg_replace('/ (?= )/', '', trim(preg_replace('/[\\~`!\&quot;$%^&amp;*()+{}[\]&lt;&gt;?\/|=]/', '', trim(strip_tags(htmlspecialchars_decode($this-&gt;record['Content'], 4, 15)))))));
            }
        }
    }</description>
			<pubDate>Fri, 09 Jul 2010 01:34:34 -0500</pubDate>
			<author>Jeremy</author>
			<guid>http://www.ssbits.com/autofill-metadescription-and-metakeywords-on-page-save/#PageComment_738</guid>
		</item>
		
		<item>
			<title>Comment by 'Richard' on Autofill MetaDescription and MetaKeywords on page save</title>
			<link>http://www.ssbits.com/autofill-metadescription-and-metakeywords-on-page-save/#PageComment_707</link>
			<description>This is a very good example of how to use onBeforeWrite and onAfterWrite thanks.

An alternative, so long as you don't want keywords (which as discussed are not actually useful), is to overload the MetaTags function in your Page.php and test if $this-&gt;MetaDecription is populated otherwise use $this-&gt;Content instead. Similar to how the title tag is populated. See SiteTree-&gt;MetaTags()

This way you don't need to set a preference to auto populate in the CMS. It just happens if there is no MetaDescription entered.</description>
			<pubDate>Tue, 22 Jun 2010 19:07:21 -0500</pubDate>
			<author>Richard</author>
			<guid>http://www.ssbits.com/autofill-metadescription-and-metakeywords-on-page-save/#PageComment_707</guid>
		</item>
		
		<item>
			<title>Comment by 'mike mcvey' on Autofill MetaDescription and MetaKeywords on page save</title>
			<link>http://www.ssbits.com/autofill-metadescription-and-metakeywords-on-page-save/#PageComment_706</link>
			<description>There is an update that doesnt require editing your page.php... and works on 2.4

http://www.kreationsbyran.se/blogg/update-to-metamanager-module-for-silverstripe/</description>
			<pubDate>Tue, 22 Jun 2010 17:25:42 -0500</pubDate>
			<author>mike mcvey</author>
			<guid>http://www.ssbits.com/autofill-metadescription-and-metakeywords-on-page-save/#PageComment_706</guid>
		</item>
		
		<item>
			<title>Comment by 'Arthur' on Autofill MetaDescription and MetaKeywords on page save</title>
			<link>http://www.ssbits.com/autofill-metadescription-and-metakeywords-on-page-save/#PageComment_592</link>
			<description>It's didn't work, i can't save a page, maybe it because of different from English language(Russian)?</description>
			<pubDate>Wed, 03 Mar 2010 01:27:49 -0600</pubDate>
			<author>Arthur</author>
			<guid>http://www.ssbits.com/autofill-metadescription-and-metakeywords-on-page-save/#PageComment_592</guid>
		</item>
		
		<item>
			<title>Comment by 'theAlien' on Autofill MetaDescription and MetaKeywords on page save</title>
			<link>http://www.ssbits.com/autofill-metadescription-and-metakeywords-on-page-save/#PageComment_589</link>
			<description>Hi, it seems the stopwords-feature does not work that well... I tested with a Lorem ipsum-text with alot of 'sed's. However they weren't filtered (NB I set the char-limit to 3).</description>
			<pubDate>Mon, 01 Mar 2010 07:55:26 -0600</pubDate>
			<author>theAlien</author>
			<guid>http://www.ssbits.com/autofill-metadescription-and-metakeywords-on-page-save/#PageComment_589</guid>
		</item>
		
		<item>
			<title>Comment by '' on Autofill MetaDescription and MetaKeywords on page save</title>
			<link>http://www.ssbits.com/autofill-metadescription-and-metakeywords-on-page-save/#PageComment_583</link>
			<description></description>
			<pubDate>Thu, 25 Feb 2010 11:55:27 -0600</pubDate>
			<author></author>
			<guid>http://www.ssbits.com/autofill-metadescription-and-metakeywords-on-page-save/#PageComment_583</guid>
		</item>
		
		<item>
			<title>Comment by 'Rohan' on Autofill MetaDescription and MetaKeywords on page save</title>
			<link>http://www.ssbits.com/autofill-metadescription-and-metakeywords-on-page-save/#PageComment_560</link>
			<description>Hi I am trying to implement this but whenever I save I get an error saying error saving content</description>
			<pubDate>Thu, 28 Jan 2010 10:54:12 -0600</pubDate>
			<author>Rohan</author>
			<guid>http://www.ssbits.com/autofill-metadescription-and-metakeywords-on-page-save/#PageComment_560</guid>
		</item>
		
		<item>
			<title>Comment by 'Chase Q. Aucoin' on Autofill MetaDescription and MetaKeywords on page save</title>
			<link>http://www.ssbits.com/autofill-metadescription-and-metakeywords-on-page-save/#PageComment_474</link>
			<description>How would I go about implementing this into a batch action?</description>
			<pubDate>Tue, 17 Nov 2009 12:50:14 -0600</pubDate>
			<author>Chase Q. Aucoin</author>
			<guid>http://www.ssbits.com/autofill-metadescription-and-metakeywords-on-page-save/#PageComment_474</guid>
		</item>
		
		<item>
			<title>Comment by 'Liam' on Autofill MetaDescription and MetaKeywords on page save</title>
			<link>http://www.ssbits.com/autofill-metadescription-and-metakeywords-on-page-save/#PageComment_419</link>
			<description>This looks really great. Would definitely come in handy for clients who don't always bother with this, but should.

Main thing I noticed was the description is limited by characters. It would be good if you could limit it by words. Right now the 255, or whatever limit you set, will cut off the last word unless it happens to be an exact fit, which is rare. </description>
			<pubDate>Thu, 03 Sep 2009 16:02:44 -0500</pubDate>
			<author>Liam</author>
			<guid>http://www.ssbits.com/autofill-metadescription-and-metakeywords-on-page-save/#PageComment_419</guid>
		</item>
		
		<item>
			<title>Comment by 'Martijn' on Autofill MetaDescription and MetaKeywords on page save</title>
			<link>http://www.ssbits.com/autofill-metadescription-and-metakeywords-on-page-save/#PageComment_389</link>
			<description>Hi Yakiv, with the files in the zipfile you can add a commaseparated string with words you want to exclude around r 71 in the config file:

MetaManagerDataDecorator::set_exclude_words('');

There are some problems with special chars like â, é ö. Im working on that. replacing r 296 with :
$this-&gt;owner-&gt;MetaDescription = utf8_encode(html_entity_decode(strip_tags($this-&gt;owner-&gt;Content))); 
will solve this for the MeteDescription, but it has no effect on the MetaKeywords calculation. </description>
			<pubDate>Sun, 02 Aug 2009 07:51:18 -0500</pubDate>
			<author>Martijn</author>
			<guid>http://www.ssbits.com/autofill-metadescription-and-metakeywords-on-page-save/#PageComment_389</guid>
		</item>
		

	</channel>
</rss>
