I've created my own global.tpl, and placed it in the /templates/local/ folder as instructed (by the comments at top of global.tpl). Works great without short urls enabled, but enabling short urls then breaks the templates!
Have I missed a trick, or is this a bug?
Posts: 32509
how old is your customization? from beta 1? and you use it now in beta 2?
if so:
there has been a big change since beta 1 and this might be the cause for this, don't know. you should create your customization again based on beta 2 templates.
else:
very strange. could you post your customized global.tpl to the forums as an attachement such that we can debug it?
Posts: 23
It's a new customisation, beta2.
global.tpl is below (not sure how to upload an attachment!). The line in question is:
<img src="templates/local/logo.jpg" border="0">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
{* This should help out users whose browsers are confused about the character set *}
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
{* Content that G2 wants to display inside the <head> element *}
{g->head}
</head>
<body class="gallery">
<table width='790'><tr><td>
<div id="gallery"{if $main.isRightToLeft} style="direction:rtl"{/if}>
<div id="gsHeader">
<img src="templates/local/logo.jpg" border="0">
<img src="templates/local/menu.jpg" border="0">
</div>
{* Content that G2 wants to display inside the <body> element *}
{include file="gallery:`$main.viewBodyFile`" l10Domain=$main.viewL10Domain}
<div id="gsFooter">
<img src="templates/local/bottom.jpg">
</div>
</div>
{* If debugging or profiling is enabled, we'll display it here *}
{if isset($main.debug) || isset($main.profile)}
{include file="gallery:templates/debug.tpl"}
{/if}
</td></tr></table>
</body>
</html>
Posts: 8601
<img src="{g->url href="templates/local/logo.jpg"}" ... should work, but i'm not sure what short urls is doing to break the url you have now.. what does 'view source' show when you view the site?
Posts: 23
Hi,
View source shows
"<img src="templates/local/logo.jpg" border="0">"
I'm not sure how mod_rewrite is handling these urls, but obviously there is no "templates/local/logo.jpg" relative to the short urls.
I noticed that the calls to the css files have the full (i.e. not relative) url path, I'll take a look at how those are included in the templates.
Posts: 23
Aye, that did the trick:
<img src="{g->url href="templates/local/logo.jpg"}" alt=""/>
I put the call back into a Smarty bit, instead of plain html, and it works. Thansk for the tip!