Last active
August 29, 2015 14:23
-
-
Save sminnee/8a4958fc12577f8a9f13 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class CustomConfig extends DataExtension | |
{ | |
private static $has_one = array( | |
"Logo" => "Image", | |
); | |
function updateCMSFields(FieldList $fields) { | |
$fields->addFieldToTab('Root.Main', | |
new UploadField('Logo') | |
); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -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