Skip to content

Instantly share code, notes, and snippets.

@sminnee
Last active August 29, 2015 14:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save sminnee/8a4958fc12577f8a9f13 to your computer and use it in GitHub Desktop.
Save sminnee/8a4958fc12577f8a9f13 to your computer and use it in GitHub Desktop.
@@ -8,4 +8,8 @@ After:
# See http://doc.silverstripe.org/framework/en/topics/configuration
# Caution: Indentation through two spaces, not tabs
SSViewer:
- theme: 'sam'
\ No newline at end of file
+ theme: 'sam'
+
+SiteConfig:
+ extensions:
+ - CustomConfig
<?php
class CustomConfig extends DataExtension
{
private static $has_one = array(
"Logo" => "Image",
);
function updateCMSFields(FieldList $fields) {
$fields->addFieldToTab('Root.Main',
new UploadField('Logo')
);
}
}
@@ -2,7 +2,15 @@
<div class="inner">
<div class="unit size4of4 lastUnit">
<a href="$BaseHref" class="brand" rel="home">
- <h1>$SiteConfig.Title</h1>
+ <h1>
+ <% if SiteConfig.Logo %>
+ <img
+ style="float: left; margin-right: 10px"
+ src="$SiteConfig.Logo.SetWidth(100).URL">
+ <% end_if %>
+
+ $SiteConfig.Title
+ </h1>
<% if $SiteConfig.Tagline %>
<p>$SiteConfig.Tagline</p>
<% end_if %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment