On 27 Feb 2011, at 19:18, BIO wrote:

> If I put this into my "header" snippet then the parent and all the
> child pages display images:
> 
> <div id="header"><div id="site-title"><img src="/images/ncg-potpourri-
> big.png" class="shadow" style="align:left"/><r:if_url matches="^/
> $">Nyack Community Garden</r:if_url><r:unless_url matches="^/$"><a
> href="/">Nyack Community Garden</a></r:unless_url><img src="/images/
> ncg-onions-big.png" class="shadow" style="align:right"/></div><div
> id="site-subtitle">Established ...</div></div>
> <hr class="hidden" />
> 
> If I put this into the snippet then only the parent displays the
> images:
> 
> <div id="header"><div id="site-title"><img src="images/ncg-potpourri-
> big.png" class="shadow" style="align:left"/><r:if_url matches="^/
> $">Nyack Community Garden</r:if_url><r:unless_url matches="^/$"><a
> href="/">Nyack Community Garden</a></r:unless_url><img src="images/ncg-
> onions-big.png" class="shadow" style="align:right"/></div><div
> id="site-subtitle">Established ...</div></div>
> <hr class="hidden" />
> 
> The only difference is the leading slash:
> 
> src="/images...

This is normal web server behaviour if you consider that your child pages are 
effectively subdirectories. They have addresses in the form /child, but it is 
quite common for your web server configuration to turn that into /child/, and 
if you have grandchild pages they will look like /child/grandchild/.

Without a leading slash the src attribute specifies a relative url, in this 
case /child/images or /child/grandchild/images, which don't exist. 

Is there a reason why you don't want the leading slash?

best,

will


Reply via email to