Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Template Questions /

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Need help with theme.


Go to End


3 Posts   2389 Views

Avatar
tjille

Community Member, 1 Post

31 July 2012 at 10:34pm

Edited: 31/07/2012 11:35pm

Hello My namn is Phil and have started to use SilverStripe.

I followed a tutorial how to make build your own theme on Silver

Link http://vimeo.com/34760038

But i have some problems... The Template im using doesnt show anything besides some css colors..
And i dont know how too fix this, ive been looking around alot so now i'm asking you guys for help.

Here is my Page.ss

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" type="text/css" href="css/layout.css" />
$MetaTags
<% base_tag %>
</head>
<body>
<div id="website">
<div id="header">

<a href="#" class="logo"><img src="images/logo.jpg" alt="" width="195" height="80" /></a>
<ul id="menu">
<% loop Menu(1)%>
<li><a id="" class="$LinkingMode"<a href="$Link" id="active">$MenuTitle</li></a>
<% end_loop %>

</ul>
<div id="brading">
<h1><a href="AbsoluteBaseURL">$SiteConfig.Title</a></h1>
<h1 class="tagline">$SiteConfig.Tagline</h1>
</div>
</div>
<div id="content">
<img src="images/title1.gif" alt="" width="271" height="41" /><br />
<h2>$Title</h2>
$Content
$Form
</div>
</div>
<div id="footer">
<div class="vlinks"><a href="http://www.webdesign.org">Web design</a> by <a title="Free Templates Online" href="http://www.freetemplatesonline.com">Free Templates</a> Online</div>

</div>
</div>
<map name="Map">
<area shape="rect" coords="27,41,562,88" href="#">
<area shape="rect" coords="589,2,724,185" href="#">
</map>
</body>
</html>

- Phil

Attached Files
Avatar
carlo

Community Member, 6 Posts

1 August 2012 at 3:43am

Hey Phil,

try to replace:

<link rel="stylesheet" type="text/css" href="css/layout.css" />

by:
<link rel="stylesheet" type="text/css" href="/themes/YOURTEMPLATENAME/css/layout.css" />

You can also use this preferred method (HTML-Shortcut to layout.css will be automatically generated by SilverStripe when rendering the Page):

<% require themedCSS(layout) %>

Avatar
DesignerX.com.au

Community Member, 107 Posts

6 August 2012 at 8:21am

Hi:
I like to use $Themedir or $Themedir(SubTheme) as I like to have control over the location of my CSS & thier order so I do the following :
<link rel="stylesheet" type="text/css" href="$Themedir/css/layout.css" /> this way its more dynamic & allows you to just copy & rename your theme without having to re-link all CSS & JS files ;)