Adding Banners to a Graffiti Site

Nov 30, 2010 at 8:46 PM

Hi everyone! I'm a graphic designer with very little coding knowledge, I am working on a Graffiti site right now and I wanted to use banners on my site. I added static links to my layout.view

This is an example of what I did

http://usasnowboardracingteam.com.s17.dotnetsql.com/files/media/Image/index_04.jpg

The problem I am having is that whenever I browse the navigation menu, the URL changes for these static images, here is one example, the section is called "Home" and the URL contains the reference to this page, so the image link is broken

http://usasnowboardracingteam.com.s17.dotnetsql.com/home/files/media/Image/index_04.jpg

Is there any way to get around this? I wanted to have some banners available all the time on every page and was going to hard code them into the layout.view page, but with the URLs changing I don't think it will work

Thanks in advance for all the help!

Coordinator
Dec 1, 2010 at 1:37 AM

There are a couple of options.

  1. Just add a forward slash to the beginning. So instead of src="files/media/Image/index_01.jpg" it would be src="/files/media/Image/index_01.jpg" -- the leading forward slash takes it to the root, then moves up from there.
  2. Another option is to put these images within your theme's folder. So let's say your theme is called "snowboard" and so you have a folder of files/themes/snowboard/ -- now create files/themes/snowboard/images/ and place all your images there. Now use the $macros.ThemeFile --> so your source for the same file above (now in the theme's folder) would be src="$macros.ThemeFile("images/index_01.jpg")" -- Graffiti will now know how to properly reference the file in your HTML.

(A side note: if you use $!data.Site.Copyright [notice the: !] in your footer it won't display the Chalk tag if no value is found.)

Dec 1, 2010 at 2:49 PM

Thank you Mr. Hodges, this worked like a charm! Have the most excellent day and thanks again!

Coordinator
Dec 1, 2010 at 4:23 PM

My pleasure. If you run into anything else, just let us know.