<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Silverstripe | Nerdpress.org</title>
	<atom:link href="https://nerdpress.org/tag/silverstripe/feed/" rel="self" type="application/rss+xml" />
	<link>https://nerdpress.org</link>
	<description>...dev, tech problems and solutions.</description>
	<lastBuildDate>Wed, 13 Jul 2022 07:02:46 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>
	<item>
		<title>Silverstripe file credits addon</title>
		<link>https://nerdpress.org/2022/07/13/silverstripe-file-credits-addon/</link>
		
		<dc:creator><![CDATA[Ivo Bathke]]></dc:creator>
		<pubDate>Wed, 13 Jul 2022 07:02:45 +0000</pubDate>
				<category><![CDATA[Silverstripe]]></category>
		<guid isPermaLink="false">https://nerdpress.org/?p=3155</guid>

					<description><![CDATA[<p>I released a new small Addon (or Module or Plugin) for SilverStripe CMS which adds a credits tab to the FileAdmin, so you can add f.e. the copyright holder of the image or any file. Useful when you need to name credits, licence and source links for any asset used on your SilverStripe site. https://github.com/ivoba/silverstripe-file-credits &#8230; </p>
<p class="link-more"><a href="https://nerdpress.org/2022/07/13/silverstripe-file-credits-addon/" class="more-link">Continue reading<span class="screen-reader-text"> "Silverstripe file credits addon"</span></a></p>
The post <a href="https://nerdpress.org/2022/07/13/silverstripe-file-credits-addon/">Silverstripe file credits addon</a> first appeared on <a href="https://nerdpress.org">Nerdpress.org</a>.]]></description>
										<content:encoded><![CDATA[<p>I released a new small Addon (or Module or Plugin) for SilverStripe CMS which adds a credits tab to the FileAdmin, so you can add f.e. the copyright holder of the image or any file.</p>



<p>Useful when you need to name credits, licence and source links for any asset used on your SilverStripe site.</p>



<figure class="wp-block-image size-full"><a href="https://nerdpress.org/wp-content/uploads/2022/07/silverstripe-file-credits.png"><img fetchpriority="high" decoding="async" width="433" height="315" src="https://nerdpress.org/wp-content/uploads/2022/07/silverstripe-file-credits.png" alt="" class="wp-image-3156" srcset="https://nerdpress.org/wp-content/uploads/2022/07/silverstripe-file-credits.png 433w, https://nerdpress.org/wp-content/uploads/2022/07/silverstripe-file-credits-300x218.png 300w" sizes="(max-width: 433px) 100vw, 433px" /></a><figcaption>SilverStripe File Credits Tab in FileAdmin</figcaption></figure>



<p><a href="https://github.com/ivoba/silverstripe-file-credits" target="_blank" rel="noreferrer noopener">https://github.com/ivoba/silverstripe-file-credits</a> <br /><a href="https://packagist.org/packages/ivoba/silverstripe-file-credits" target="_blank" rel="noreferrer noopener">https://packagist.org/packages/ivoba/silverstripe-file-credits</a><br /><a href="https://addons.silverstripe.org/add-ons/ivoba/silverstripe-file-credits" target="_blank" rel="noreferrer noopener">https://addons.silverstripe.org/add-ons/ivoba/silverstripe-file-credits</a></p>The post <a href="https://nerdpress.org/2022/07/13/silverstripe-file-credits-addon/">Silverstripe file credits addon</a> first appeared on <a href="https://nerdpress.org">Nerdpress.org</a>.]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Disable SilverStripe deprecation warnings in PHP8.1</title>
		<link>https://nerdpress.org/2022/04/22/disable-silverstripe-deprecation-warnings-in-php8-1/</link>
		
		<dc:creator><![CDATA[Ivo Bathke]]></dc:creator>
		<pubDate>Fri, 22 Apr 2022 09:58:11 +0000</pubDate>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[composer]]></category>
		<category><![CDATA[Silverstripe]]></category>
		<guid isPermaLink="false">https://nerdpress.org/?p=3129</guid>

					<description><![CDATA[<p>Since SilverStripe 4.10 is not yet fully ready for PHP8.1 you wil receive quite some deprecation warnings in dev mode when you are brave and run it nonetheless on PHP8.1. Unfortunatly we can&#8217;t control the error_reporting from SilverStripe since it is set in the kernel of the framework.So we are forced to hack the Kernel &#8230; </p>
<p class="link-more"><a href="https://nerdpress.org/2022/04/22/disable-silverstripe-deprecation-warnings-in-php8-1/" class="more-link">Continue reading<span class="screen-reader-text"> "Disable SilverStripe deprecation warnings in PHP8.1"</span></a></p>
The post <a href="https://nerdpress.org/2022/04/22/disable-silverstripe-deprecation-warnings-in-php8-1/">Disable SilverStripe deprecation warnings in PHP8.1</a> first appeared on <a href="https://nerdpress.org">Nerdpress.org</a>.]]></description>
										<content:encoded><![CDATA[<p>Since SilverStripe 4.10 is not yet fully ready for PHP8.1 you wil receive quite some deprecation warnings in dev mode when you are brave and run it nonetheless on PHP8.1.</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: php; title: ; notranslate">
Deprecated: SilverStripe\Config\Collections\MemoryConfigCollection implements the Serializable interface, which is deprecated. Implement __serialize() and __unserialize() instead (or in addition, if support for old PHP versions is necessary) in /var/www/html/vendor/silverstripe/config/src/Collections/MemoryConfigCollection.php on line 13
</pre></div>


<p>Unfortunatly we can&#8217;t control the<em> error_reporting</em> from SilverStripe since it is set in the kernel of the framework.<br />So we are forced to hack the Kernel which is rather unfortunate.</p>



<p>In the <a href="https://silverstripe-users.slack.com/">SilverStripe Slack</a> channel someone proposed to use <a href="https://github.com/cweagans/composer-patches" target="_blank" rel="noreferrer noopener">composer-patch</a> which will apply a patch to a given vendor dependency during composer install.<br />This is quite cool because you don&#8217;t need to fork the dependency and take care of getting upstream changes.</p>



<p>So i went this path down and it looks like in this gist:<br /><a href="https://gist.github.com/ivoba/d8c4379236149a8c42e1922ae98a93e3" target="_blank" rel="noreferrer noopener">https://gist.github.com/ivoba/d8c4379236149a8c42e1922ae98a93e3</a></p>



<span id="more-3129"></span>



<p>Basically you have to install composer patch:</p>



<p><code>composer require cweagans/composer-patches</code></p>



<p>Create the patch and add the patch file to your project.<br />You can create a patch by cloning the package i.e. silverstripe/framework into IntelliJ / PHPStorm, apply the change and under Git -&gt; Patch create the patch file.</p>



<p>Then add it to composer.json so the patch can be applied on next <code>composer install</code>.</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: jscript; title: ; notranslate">
&quot;extra&quot;: {
       &quot;patches&quot;: {
            &quot;silverstripe/framework&quot;: {
                &quot;Fix SilverStripe deprecations error_reporting for PHP 8.1&quot;: &quot;./fix-deprecation-error_reporting.4.10.4.patch&quot;
            }
       }
    }
</pre></div>


<p>Now we have patched the error_reporting and the deprecation warnings are supressed.<br />Once SilverStripe fully supports PHP8.1 we then can remove this patch.</p>The post <a href="https://nerdpress.org/2022/04/22/disable-silverstripe-deprecation-warnings-in-php8-1/">Disable SilverStripe deprecation warnings in PHP8.1</a> first appeared on <a href="https://nerdpress.org">Nerdpress.org</a>.]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>SilverStripe with php built-in server</title>
		<link>https://nerdpress.org/2016/06/21/silverstripe-php-built-server/</link>
					<comments>https://nerdpress.org/2016/06/21/silverstripe-php-built-server/#comments</comments>
		
		<dc:creator><![CDATA[Ivo Bathke]]></dc:creator>
		<pubDate>Tue, 21 Jun 2016 08:15:44 +0000</pubDate>
				<category><![CDATA[Silverstripe]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<guid isPermaLink="false">https://nerdpress.org/?p=2698</guid>

					<description><![CDATA[<p>Sometimes you just want to check a SilverStripe version, module or theme fast and dont want to setup the whole stack. Then simply use PHPs built-in webserver to serve your SilverStripe site. Now you can call http://localhost:8000 to check your SilverStripe website. Or, a bit more verbose, use https://github.com/assertchris/silverstripe-serve which is a nice wrapper around &#8230; </p>
<p class="link-more"><a href="https://nerdpress.org/2016/06/21/silverstripe-php-built-server/" class="more-link">Continue reading<span class="screen-reader-text"> "SilverStripe with php built-in server"</span></a></p>
The post <a href="https://nerdpress.org/2016/06/21/silverstripe-php-built-server/">SilverStripe with php built-in server</a> first appeared on <a href="https://nerdpress.org">Nerdpress.org</a>.]]></description>
										<content:encoded><![CDATA[<p>Sometimes you just want to check a <a href="https://www.silverstripe.org">SilverStripe</a> version, module or theme fast and dont want to setup the whole stack.<br />
Then simply use PHPs built-in webserver to serve your SilverStripe site.</p>
<pre class="brush: plain; title: ; notranslate">
php -S localhost:8000 ./framework/main.php
</pre>
<p>Now you can call <em>http://localhost:8000</em> to check your SilverStripe website.</p>
<p>Or, a bit more verbose, use <a href="https://github.com/assertchris/silverstripe-serve">https://github.com/assertchris/silverstripe-serve</a><br />
which is a nice wrapper around this.<br />
<span id="more-2698"></span></p>
<p>In case you also need a vanilla database with default pages, you can add the environment file in mysite/_config.php:</p>
<pre class="brush: php; title: ; notranslate">
require_once('conf/ConfigureFromEnv.php');
</pre>
<p>create the file <em>./_ss_environment.php</em>:</p>
<pre class="brush: php; title: ; notranslate">
define('SS_DATABASE_SERVER', 'localhost');
define('SS_DATABASE_USERNAME', 'root');
define('SS_DATABASE_PASSWORD', '');
define('SS_DATABASE_NAME', 'SS_Mysite');
define('SS_DEFAULT_ADMIN_USERNAME', 'admin');
define('SS_DEFAULT_ADMIN_PASSWORD', 'admin');
</pre>
<p>and run in the console:</p>
<pre class="brush: plain; title: ; notranslate">
framework/sake dev/build flush=1
</pre>
<p>If your user is allowed to create databases (for dev purposes on the local machine i simply use the root user) you will now have a new database with default pages.</p>
<p>When the project gets into serious development phase i would recommend to setup a real environment setup with apache/nginx with f.e docker. (Post on this is coming soon :))</p>The post <a href="https://nerdpress.org/2016/06/21/silverstripe-php-built-server/">SilverStripe with php built-in server</a> first appeared on <a href="https://nerdpress.org">Nerdpress.org</a>.]]></content:encoded>
					
					<wfw:commentRss>https://nerdpress.org/2016/06/21/silverstripe-php-built-server/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>SilverStripe LinkField addon</title>
		<link>https://nerdpress.org/2014/03/26/silverstripe-linkfield-addon/</link>
		
		<dc:creator><![CDATA[Ivo Bathke]]></dc:creator>
		<pubDate>Wed, 26 Mar 2014 15:50:18 +0000</pubDate>
				<category><![CDATA[Silverstripe]]></category>
		<guid isPermaLink="false">https://nerdpress.org/?p=2534</guid>

					<description><![CDATA[<p>Alright folks, so here is the SilverStripe addon of the month: https://github.com/sheadawson/silverstripe-linkable Its the missing LinkField, you might look for. There are some more addons for a LinkField out there, but this one is the best. No wonder, the author is SilverStripe employee. It features: external links link validation link a page from your site &#8230; </p>
<p class="link-more"><a href="https://nerdpress.org/2014/03/26/silverstripe-linkfield-addon/" class="more-link">Continue reading<span class="screen-reader-text"> "SilverStripe LinkField addon"</span></a></p>
The post <a href="https://nerdpress.org/2014/03/26/silverstripe-linkfield-addon/">SilverStripe LinkField addon</a> first appeared on <a href="https://nerdpress.org">Nerdpress.org</a>.]]></description>
										<content:encoded><![CDATA[<p>Alright folks, so here is the SilverStripe addon of the month:<br />
<a href="https://github.com/sheadawson/silverstripe-linkable" target="_blank">https://github.com/sheadawson/silverstripe-linkable</a></p>
<p>Its the missing <strong>LinkField</strong>, you might look for.<br />
There are some more addons for a <a href="http://addons.silverstripe.org/add-ons?tags%5B0%5D=link" target="_blank">LinkField</a> out there, but this one is the best.<br />
No wonder, the author is SilverStripe employee.</p>
<p>It features:</p>
<ul>
<li>external links</li>
<li>link validation</li>
<li>link a page from your site</li>
<li>link a file from your assets</li>
<li>oEmbed links</li>
<li>the addon is translated, currently only for german, but add your own, its easy!</li>
</ul>
<p><span id="more-2534"></span></p>
<p>Handling in the backend is very comfortable as you can see here:<br />
<a href="https://nerdpress.org/wp-content/uploads/2014/03/silverstripe_linkable.png"><img decoding="async" src="https://nerdpress.org/wp-content/uploads/2014/03/silverstripe_linkable-300x153.png" alt="silverstripe linkable" width="300" height="153" class="alignnone size-medium wp-image-2536" srcset="https://nerdpress.org/wp-content/uploads/2014/03/silverstripe_linkable-300x153.png 300w, https://nerdpress.org/wp-content/uploads/2014/03/silverstripe_linkable-1024x522.png 1024w, https://nerdpress.org/wp-content/uploads/2014/03/silverstripe_linkable.png 1107w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p>It took me some time to evaluate all LinkField addons and to find the right one, so maybe it saves you some time.</p>The post <a href="https://nerdpress.org/2014/03/26/silverstripe-linkfield-addon/">SilverStripe LinkField addon</a> first appeared on <a href="https://nerdpress.org">Nerdpress.org</a>.]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Using Silverstripe Templates outside Silverstripe</title>
		<link>https://nerdpress.org/2013/11/15/silverstripe-templates-outside-silverstripe/</link>
		
		<dc:creator><![CDATA[Max Girkens]]></dc:creator>
		<pubDate>Fri, 15 Nov 2013 08:21:21 +0000</pubDate>
				<category><![CDATA[CMS]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Silverstripe]]></category>
		<category><![CDATA[templates]]></category>
		<category><![CDATA[Wordpress]]></category>
		<guid isPermaLink="false">https://nerdpress.org/?p=2462</guid>

					<description><![CDATA[<p>In a recent website-project i had a WordPress Blog running next to the main CMS Silverstripe, handling the Blog-part of the site. Integrating the Blog in Silverstripe (which indeed would have made things simpler) was not  an option at the time. The usage of loads of WordPress plugins would&#8217;ve made a rewrite a major task, which &#8230; </p>
<p class="link-more"><a href="https://nerdpress.org/2013/11/15/silverstripe-templates-outside-silverstripe/" class="more-link">Continue reading<span class="screen-reader-text"> "Using Silverstripe Templates outside Silverstripe"</span></a></p>
The post <a href="https://nerdpress.org/2013/11/15/silverstripe-templates-outside-silverstripe/">Using Silverstripe Templates outside Silverstripe</a> first appeared on <a href="https://nerdpress.org">Nerdpress.org</a>.]]></description>
										<content:encoded><![CDATA[<p>In a recent website-project i had a <a href="http://wordpress.org/">WordPress</a> Blog running next to the main CMS <a href="http://www.silverstripe.org/">Silverstripe</a>, handling the Blog-part of the site.</p>
<p><em>Integrating the Blog in Silverstripe (which indeed would have made things simpler) was not  an option at the time. The usage of loads of WordPress plugins would&#8217;ve made a rewrite a major task, which was out of the budget.</em></p>
<p>The blog was integrated in the same page layout as the rest of the website. So ideally it would at least share the same Templates for header, footer etc. and would integrate the sites navigation built by Silverstripe.</p>
<p><strong>But how to use the pre-rendered <a href="http://doc.silverstripe.org/framework/en/3.0/reference/templates">Silverstripe template</a> <code>.ss</code> files in a WordPress theme?<br />
</strong></p>
<p>The following worked fine for me, using Silverstripe 3.0:<br />
<span id="more-2462"></span><br />
In the functions.php of the wordpress theme i added this code to init a silverstripe controller:</p>
<pre class="brush: php; title: ; notranslate">
//init silverstripe
require_once '&#x5B;path-to-silverstripe-root-folder]/framework/core/Core.php';
require_once '&#x5B;path-to-silverstripe-root-folder]/framework/model/DB.php';
//init the Database connection
DB::connect($databaseConfig);
//fetch some page, it that case i used the 404 ErrorPage
$SSPage = DataObject::get_by_id('Page', 4);
//init a the controller and cache it as a global variable
$SSctrl = new ContentController($SSPage);
//add the controller to the stack, so it becomes available as the current controller for the template
$SSctrl-&gt;pushCurrent();

</pre>
<p>and also some helper functions to get the actual templates</p>
<pre class="brush: php; title: ; notranslate">
function get_Silverstripe_Header()
{
    global $SSctrl;
    //render the controller with the includes/Header.ss template
    return $SSctrl-&gt;renderWith('Header');
}

function get_Silverstripe_Footer()
{
    global $SSctrl;
    //..or any other template, like the footer
    return $SSctrl-&gt;renderWith('Footer');
}
</pre>
<p>&#8230;and then just use these in the templates:</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php echo get_Silverstripe_Header() ?&gt;
</pre>
<p>Of course this is no way limited to WordPress. It just an idea how<em> to access Silverstripe Templates outside of Silverstripe code</em>.</p>The post <a href="https://nerdpress.org/2013/11/15/silverstripe-templates-outside-silverstripe/">Using Silverstripe Templates outside Silverstripe</a> first appeared on <a href="https://nerdpress.org">Nerdpress.org</a>.]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>more Silverstripe bookmarklets</title>
		<link>https://nerdpress.org/2013/05/31/more-silverstripe-bookmarklets/</link>
					<comments>https://nerdpress.org/2013/05/31/more-silverstripe-bookmarklets/#comments</comments>
		
		<dc:creator><![CDATA[Max Girkens]]></dc:creator>
		<pubDate>Fri, 31 May 2013 10:56:50 +0000</pubDate>
				<category><![CDATA[Silverstripe]]></category>
		<category><![CDATA[bookmarklet]]></category>
		<category><![CDATA[Development]]></category>
		<guid isPermaLink="false">https://nerdpress.org/?p=2443</guid>

					<description><![CDATA[<p>Since the Silverstripe-Developer Bookmarklets on ssbits.com are great, i thought it would be even better to have them as a editable/extendable collection: So here are some more as a JSFiddle: http://jsfiddle.net/HMkad/2/embedded/result/ If you&#8217;d like to extend the collection just edit the markup in the fiddle. And add something like this: &#60;li&#62; &#60;p&#62; &#60;strong&#62;?showqueries=1&#60;/strong&#62; - List all &#8230; </p>
<p class="link-more"><a href="https://nerdpress.org/2013/05/31/more-silverstripe-bookmarklets/" class="more-link">Continue reading<span class="screen-reader-text"> "more Silverstripe bookmarklets"</span></a></p>
The post <a href="https://nerdpress.org/2013/05/31/more-silverstripe-bookmarklets/">more Silverstripe bookmarklets</a> first appeared on <a href="https://nerdpress.org">Nerdpress.org</a>.]]></description>
										<content:encoded><![CDATA[<p>Since the Silverstripe-Developer Bookmarklets <a href="http://www.ssbits.com/snippets/2012/silverstripe-developer-bookmarklets/">on ssbits.com</a> are great,<br />
i thought it would be even better to have them as a editable/extendable collection:</p>
<p>So here are some more as a JSFiddle:</p>
<p><a href="http://jsfiddle.net/HMkad/2/embedded/result/">http://jsfiddle.net/HMkad/2/embedded/result/<span id="more-2443"></span></a></p>
<p>If you&#8217;d like to extend the collection just edit the markup <a href="http://jsfiddle.net/HMkad/2/light/">in the fiddle</a>.<br />
And add something like this:</p>
<pre class="brush: xml; title: ; notranslate">
&lt;li&gt;
  &lt;p&gt;
    &lt;strong&gt;?showqueries=1&lt;/strong&gt; - List all SQL queries executed
  &lt;/p&gt;
  &lt;a data-param=&quot;showqueries=1&quot; href=&quot;#&quot;&gt;
    SS:showqueries=1
  &lt;/a&gt;
&lt;/li&gt;
</pre>
<p>&#8230;or this:</p>
<pre class="brush: xml; title: ; notranslate">
 &lt;li&gt;
   &lt;p&gt;
    &lt;strong&gt;dev/build&lt;/strong&gt; - Rebuild the entire database and manifest
   &lt;/p&gt;
   &lt;a data-param=&quot;dev/build&quot; href=&quot;#&quot;&gt;
     SS:dev/build
   &lt;/a&gt;
&lt;/li&gt;
</pre>
<p>Have fun!</p>The post <a href="https://nerdpress.org/2013/05/31/more-silverstripe-bookmarklets/">more Silverstripe bookmarklets</a> first appeared on <a href="https://nerdpress.org">Nerdpress.org</a>.]]></content:encoded>
					
					<wfw:commentRss>https://nerdpress.org/2013/05/31/more-silverstripe-bookmarklets/feed/</wfw:commentRss>
			<slash:comments>3</slash:comments>
		
		
			</item>
		<item>
		<title>Rename admin menu items in SilverStripe</title>
		<link>https://nerdpress.org/2013/05/28/rename-admin-menu-items-in-silverstripe/</link>
					<comments>https://nerdpress.org/2013/05/28/rename-admin-menu-items-in-silverstripe/#comments</comments>
		
		<dc:creator><![CDATA[Ivo Bathke]]></dc:creator>
		<pubDate>Tue, 28 May 2013 12:16:27 +0000</pubDate>
				<category><![CDATA[CMS]]></category>
		<category><![CDATA[Silverstripe]]></category>
		<guid isPermaLink="false">https://nerdpress.org/?p=2431</guid>

					<description><![CDATA[<p>SilverStripe 3.0.x cheap trick of the week: If you want to rename a menu item in the SilverStripe Admin Area, because f.e. you find &#8220;Security&#8221; or &#8220;Sicherheit&#8221;(since we are german ;)) a too harsh wording and you prefer &#8220;Members&#8221; or &#8220;Benutzer&#8221;: simply override the translation! Add a lang folder in your project folder and add &#8230; </p>
<p class="link-more"><a href="https://nerdpress.org/2013/05/28/rename-admin-menu-items-in-silverstripe/" class="more-link">Continue reading<span class="screen-reader-text"> "Rename admin menu items in SilverStripe"</span></a></p>
The post <a href="https://nerdpress.org/2013/05/28/rename-admin-menu-items-in-silverstripe/">Rename admin menu items in SilverStripe</a> first appeared on <a href="https://nerdpress.org">Nerdpress.org</a>.]]></description>
										<content:encoded><![CDATA[<p>SilverStripe 3.0.x cheap trick of the week:</p>
<p>If you want to rename a menu item in the SilverStripe Admin Area, because f.e. you find &#8220;Security&#8221; or &#8220;Sicherheit&#8221;(since we are german ;)) a too harsh wording and you prefer &#8220;Members&#8221; or &#8220;Benutzer&#8221;:<br />
simply override the translation!</p>
<p>Add a lang folder in your project folder and add the language file:<br />
de.yml or en.yml and place your wording:</p>
<pre class="brush: yaml; title: ; notranslate">
de:
  SecurityAdmin:
    MENUTITLE: Benutzer
</pre>
<p><span id="more-2431"></span><br />
Flush the cache, call the admin area again and you will see the menu item with changed wording.</p>
<p><small><em>Thanx to UndefinedOffset from IRC for the advise :)</em></small></p>
<p>In SilverStripe 2.4 overriding language files doesnt seem to work.<br />
What you can do here is remove &#038; add the menu item via config:</p>
<pre class="brush: php; title: ; notranslate">
CMSMenu::remove_menu_item('SecurityAdmin');
CMSMenu::add_menu_item('SecurityAdmin','Benutzer','admin/security/');
</pre>
<p>Taken from the comments here: <a href="http://www.ssbits.com/snippets/2009/removing-an-item-from-the-main-cms-menu/">http://www.ssbits.com/snippets/2009/removing-an-item-from-the-main-cms-menu/</a></p>The post <a href="https://nerdpress.org/2013/05/28/rename-admin-menu-items-in-silverstripe/">Rename admin menu items in SilverStripe</a> first appeared on <a href="https://nerdpress.org">Nerdpress.org</a>.]]></content:encoded>
					
					<wfw:commentRss>https://nerdpress.org/2013/05/28/rename-admin-menu-items-in-silverstripe/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
		<item>
		<title>SilverStripe speed up Portfolio Sites with Static Publisher</title>
		<link>https://nerdpress.org/2013/02/05/silverstripe-speed-up-portfolio-sites-with-static-publisher/</link>
					<comments>https://nerdpress.org/2013/02/05/silverstripe-speed-up-portfolio-sites-with-static-publisher/#comments</comments>
		
		<dc:creator><![CDATA[Ivo Bathke]]></dc:creator>
		<pubDate>Tue, 05 Feb 2013 13:20:16 +0000</pubDate>
				<category><![CDATA[Silverstripe]]></category>
		<guid isPermaLink="false">https://nerdpress.org/?p=2394</guid>

					<description><![CDATA[<p>A common site type that we build are portfolio pages which mostly get filled once in the beginning and then only periodically, rather rarely. They also have almost never User interaction from the Frontend. So we consider them as almost &#8220;readonly&#8221; sites. These sites you can easily speed up &#8220;dramatically&#8221; with the SilverStripe builtin StaticPublisher. &#8230; </p>
<p class="link-more"><a href="https://nerdpress.org/2013/02/05/silverstripe-speed-up-portfolio-sites-with-static-publisher/" class="more-link">Continue reading<span class="screen-reader-text"> "SilverStripe speed up Portfolio Sites with Static Publisher"</span></a></p>
The post <a href="https://nerdpress.org/2013/02/05/silverstripe-speed-up-portfolio-sites-with-static-publisher/">SilverStripe speed up Portfolio Sites with Static Publisher</a> first appeared on <a href="https://nerdpress.org">Nerdpress.org</a>.]]></description>
										<content:encoded><![CDATA[<p>A common site type that <a href="http://wonderfulwebsolutions.net/">we</a> build are portfolio pages<br />
which mostly get filled once in the beginning and then only periodically, rather rarely.<br />
They also have almost never User interaction from the Frontend.</p>
<p>So we consider them as almost &#8220;<strong>readonly</strong>&#8221; sites.</p>
<p>These sites you can easily speed up &#8220;<strong>dramatically</strong>&#8221; with the SilverStripe builtin <a href="http://doc.silverstripe.org/framework/en/reference/staticpublisher">StaticPublisher</a>.<br />
The tweaks you need for this are moderate to easy.</p>
<p>You can read the <a href="http://doc.silverstripe.org/framework/en/reference/staticpublisher">Docs</a> to get a glimpse of what is possible.<br />
I will just describe the basic setup to make a site static.<br />
<span id="more-2394"></span><br />
Add this to your Page.php, this will tell SilverStripe what do export to the static cache:</p>
<pre class="brush: php; title: ; notranslate">
/**
     * Return a list of all the pages to cache
     */
    public function allPagesToCache() {
        // Get each page type to define its sub-urls
        $urls = array();

        // memory intensive depending on number of pages
        $pages = SiteTree::get();

        foreach ($pages as $page) {
            $urls = array_merge($urls, (array) $page-&gt;subPagesToCache());
        }

        return $urls;
    }

    /**
     * Get a list of URLs to cache related to this page
     */
    public function subPagesToCache() {
        $urls = array();

        // add current page
        $urls&#x5B;] = $this-&gt;Link();

        return $urls;
    }
</pre>
<p>Add this to your _config:</p>
<pre class="brush: php; title: ; notranslate">
Object::add_extension(&quot;SiteTree&quot;, &quot;FilesystemPublisher('silverstripe-cache/static/', 'html')&quot;);
</pre>
<p>I placed the cache folder in the cache dir since its already writeable and can be cleared via flush.<br />
But this you can define yourself.<br />
&#8212; But notice if you change this path, you also have to change <em>$cacheBaseDir</em> in <em>framework/static-main.php</em>!</p>
<p>Now we can fill up the cache:</p>
<p><em>http://www.example.com/dev/buildcache?flush=1</em></p>
<p><strong>EDIT:</strong> The below part can be skipped, if you use the method <em>pagesAffectedByChanges()</em>, see comments below.<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p>A bit of a downside is that after you have altered the content in your backend you have to refresh your cache via the above build command.<br />
This might be too much for a client to remember.<br />
There for you could override the admin template:<br />
<em>cms/templates/Includes/CMSPagesController_ContentToolActions.ss</em><br />
and add a button to call this command.</p>
<pre class="brush: php; title: ; notranslate">
&lt;div class=&quot;cms-actions-row&quot;&gt;
        &lt;a href=&quot;/dev/buildcache&quot; target=&quot;_blank&quot; class=&quot;ss-ui-button ss-ui-action-constructive&quot; style=&quot;float: right&quot;&gt;StaticPublisher&lt;/a&gt;
	&lt;a class=&quot;cms-page-add-button ss-ui-button ss-ui-action-constructive&quot; data-icon=&quot;add&quot; href=&quot;$LinkPageAdd&quot; data-url-addpage=&quot;{$LinkPageAdd('?ParentID=%s')}&quot;&gt;&lt;% _t('CMSMain.AddNewButton', 'Add new') %&gt;&lt;/a&gt;
&lt;/div&gt;
</pre>
<p>See:<br />
<a href="https://nerdpress.org/wp-content/uploads/2013/02/Silverstripe-StaticPublisher.png"><img decoding="async" src="https://nerdpress.org/wp-content/uploads/2013/02/Silverstripe-StaticPublisher-300x17.png" alt="Silverstripe-StaticPublisher" width="300" height="17" class="alignnone size-medium wp-image-2398" srcset="https://nerdpress.org/wp-content/uploads/2013/02/Silverstripe-StaticPublisher-300x17.png 300w, https://nerdpress.org/wp-content/uploads/2013/02/Silverstripe-StaticPublisher-1024x59.png 1024w, https://nerdpress.org/wp-content/uploads/2013/02/Silverstripe-StaticPublisher.png 1025w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>The post <a href="https://nerdpress.org/2013/02/05/silverstripe-speed-up-portfolio-sites-with-static-publisher/">SilverStripe speed up Portfolio Sites with Static Publisher</a> first appeared on <a href="https://nerdpress.org">Nerdpress.org</a>.]]></content:encoded>
					
					<wfw:commentRss>https://nerdpress.org/2013/02/05/silverstripe-speed-up-portfolio-sites-with-static-publisher/feed/</wfw:commentRss>
			<slash:comments>3</slash:comments>
		
		
			</item>
		<item>
		<title>Silverstripe remove CustomScript</title>
		<link>https://nerdpress.org/2012/12/31/silverstripe-remove-customscript/</link>
		
		<dc:creator><![CDATA[Ivo Bathke]]></dc:creator>
		<pubDate>Mon, 31 Dec 2012 15:29:28 +0000</pubDate>
				<category><![CDATA[Silverstripe]]></category>
		<guid isPermaLink="false">https://nerdpress.org/?p=2351</guid>

					<description><![CDATA[<p>Silverstripe Tip of the week: Sometimes you have to remove a customScript of a module, because you want to script it differently. If the module author was so wise to give his customScript a ID (UserFormsValidation in this case) like they did in UserForms: Requirements::customScript(&#60;&#60;&#60;JS (function($) {...})(jQuery); JS , 'UserFormsValidation'); then you can do the &#8230; </p>
<p class="link-more"><a href="https://nerdpress.org/2012/12/31/silverstripe-remove-customscript/" class="more-link">Continue reading<span class="screen-reader-text"> "Silverstripe remove CustomScript"</span></a></p>
The post <a href="https://nerdpress.org/2012/12/31/silverstripe-remove-customscript/">Silverstripe remove CustomScript</a> first appeared on <a href="https://nerdpress.org">Nerdpress.org</a>.]]></description>
										<content:encoded><![CDATA[<p>Silverstripe Tip of the week:</p>
<p>Sometimes you have to remove a customScript of a module, because you want to script it differently.</p>
<p>If the module author was so wise to give his customScript a ID (UserFormsValidation in this case) like they did in <a href="https://github.com/silverstripe/silverstripe-userforms">UserForms</a>:</p>
<pre class="brush: php; title: ; notranslate">
Requirements::customScript(&lt;&lt;&lt;JS
    (function($) {...})(jQuery);
JS
, 'UserFormsValidation');
</pre>
<p>then you can do the following in the init function of your subclass controller:</p>
<pre class="brush: php; title: ; notranslate">Requirements::block('UserFormsValidation');</pre>
<p>Easy, isnt it?</p>The post <a href="https://nerdpress.org/2012/12/31/silverstripe-remove-customscript/">Silverstripe remove CustomScript</a> first appeared on <a href="https://nerdpress.org">Nerdpress.org</a>.]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Opengraph MetaTags in SilverStripe</title>
		<link>https://nerdpress.org/2012/06/14/opengraph-metatags-in-silverstripe/</link>
					<comments>https://nerdpress.org/2012/06/14/opengraph-metatags-in-silverstripe/#comments</comments>
		
		<dc:creator><![CDATA[Ivo Bathke]]></dc:creator>
		<pubDate>Thu, 14 Jun 2012 15:33:41 +0000</pubDate>
				<category><![CDATA[Silverstripe]]></category>
		<category><![CDATA[Facebook]]></category>
		<category><![CDATA[OpenGraph]]></category>
		<guid isPermaLink="false">https://nerdpress.org/?p=2208</guid>

					<description><![CDATA[<p>First off some general thoughts on how to use opengraph metatags. Since the uprise of Social Media, sharing sites, deeplinking and snippetting content has become a important aspect of SEO and so almost every site has some kind of facebook-like-button to let user easily share the page. Most sharing endpoints, facebook f.e, bring a more &#8230; </p>
<p class="link-more"><a href="https://nerdpress.org/2012/06/14/opengraph-metatags-in-silverstripe/" class="more-link">Continue reading<span class="screen-reader-text"> "Opengraph MetaTags in SilverStripe"</span></a></p>
The post <a href="https://nerdpress.org/2012/06/14/opengraph-metatags-in-silverstripe/">Opengraph MetaTags in SilverStripe</a> first appeared on <a href="https://nerdpress.org">Nerdpress.org</a>.]]></description>
										<content:encoded><![CDATA[<p>First off some general thoughts on how to use opengraph metatags.<br />
Since the uprise of Social Media, sharing sites, deeplinking and snippetting content has become a important aspect of SEO and so almost every site has some kind of facebook-like-button to let user easily share the page.<br />
Most sharing endpoints, facebook f.e, bring a more or less good parser/linter to summarize the page content. So the first text paragraph will be taken as text snippet and all images that fit certain requirements will be offered to chose a preview-thumbnail from.<br />
So far so good.<br />
<span id="more-2208"></span><br />
But sometimes you want to have control of the content that is used for the preview on the sharer site.<br />
And thats where the opengraph metatags come into play. With them you can specify title, description and image of the preview snippet.</p>
<p>Thats great, but it has some caveats, which i like to describe while introducing the silverstripe <a href="https://github.com/tractorcow/silverstripe-opengraph">opengraph module</a> by Damian Mooyman.</p>
<p>The module is pretty well done and delivers most content prefilled. So just install it and the rest comes automatically through the <em>$MetaTags</em> var in your template.<br />
In the backend you can insert some information like locality and your facebook app id.<br />

<a href='https://nerdpress.org/wp-content/uploads/2012/06/facebook-opengraph-silverstripe.png'><img decoding="async" width="150" height="150" src="https://nerdpress.org/wp-content/uploads/2012/06/facebook-opengraph-silverstripe-150x150.png" class="attachment-thumbnail size-thumbnail" alt="" sizes="(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px" /></a>
<a href='https://nerdpress.org/wp-content/uploads/2012/06/opengraph-module-silverstripe.png'><img decoding="async" width="150" height="150" src="https://nerdpress.org/wp-content/uploads/2012/06/opengraph-module-silverstripe-150x150.png" class="attachment-thumbnail size-thumbnail" alt="" sizes="(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px" /></a>
</p>
<p>You should further add a default 200x200px image in your config:</p>
<pre class="brush: php; title: ; notranslate">OpenGraphPageExtension::$default_image = '/themes/myTheme/images/og_image.png';</pre>
<p>and add the opengraph namespace var in your html tag:</p>
<pre class="brush: xml; title: ; notranslate">&lt;html lang=&quot;en&quot; $OGNS&gt;</pre>
<p>Thats basically it, wow!</p>
<p>But of course you have to do some finetuning to represent your content best.<br />
So these questions you should ask yourself for each site where you would like to implement the metatags:</p>
<p><strong>Why should you use opengraph metatags?</strong><br />
To have control over the content of the sharer snippets.</p>
<p><strong>Where should you use opengraph metatags?</strong><br />
Where you can control / predict the content.<br />
Its not always a good idea to preselect the image.<br />
F.E when you have RichText HTML Field where the Content Manager can insert images. Then those images might be good to be shared.<br />
But with a preselected image via the og:image tag, the facebook share box will <strong>not</strong> list the other images.<br />
So on some pagetypes it might be better to not use the og tags and let the facebook parser do its <del datetime="2012-06-14T15:02:22+00:00">dirty</del> work.<br />
This you can achieve with overwriting the getOGType function in your pagetype:</p>
<pre class="brush: php; title: ; notranslate">
NonOGPage extends Page
{
    function getOGType() {
        return null;
    }
}
</pre>
<p>(thanx <a href="https://github.com/tractorcow">Damian</a>)</p>
<p><strong>How should you use it?</strong><br />
Treat your content right. So if you have a structured page type, think of which content fits and overwrite the resp. function of the module to serve the content you would like to see.<br />
F.E. if you have multiple images and you want the user to choose from while in the share dialog then do something like that:</p>
<pre class="brush: php; title: ; notranslate">
PageWithImages extends Page {
     function OGImage() {
        $imgs = array();
        if ($this-&gt;Images()) {
            $images = $this-&gt;Images();

            foreach ($images as $value) {
                $og_img = $value-&gt;Thumb()-&gt;CroppedImage(200, 200);
                $imgs&#x5B;] = $og_img-&gt;Url;
            }
        }
        if(empty($imgs)){
            $imgs&#x5B;] = Director::absoluteURL(OpenGraphPageExtension::$default_image);
        }
        return $imgs;
    }
}
</pre>
<p><strong>Who uses the opengraph metatags?</strong><br />
&#8211; Facebook of course.<br />
&#8211; Google+ seems	to prefer schema.org annotation but uses opengraph as fallback and then meta tags and then content.<br />
&#8211; Pinterest also seems to use it, partly.<br />
Here is a interesting discussion about it:<br />
<a href="http://stackoverflow.com/questions/6536213/are-there-tags-to-specify-the-google-1-story-format-in-google-like-og-meta-for">http://stackoverflow.com/questions/6536213/are-there-tags-to-specify-the-google-1-story-format-in-google-like-og-meta-for</a><br />
&#8211; and probably some more&#8230;</p>
<p>And at last here is the facebook <a href="http://developers.facebook.com/tools/debug">debug tool</a> to check your opengraph contents.</p>The post <a href="https://nerdpress.org/2012/06/14/opengraph-metatags-in-silverstripe/">Opengraph MetaTags in SilverStripe</a> first appeared on <a href="https://nerdpress.org">Nerdpress.org</a>.]]></content:encoded>
					
					<wfw:commentRss>https://nerdpress.org/2012/06/14/opengraph-metatags-in-silverstripe/feed/</wfw:commentRss>
			<slash:comments>4</slash:comments>
		
		
			</item>
	</channel>
</rss>
