Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Facebook Sign In with Google Sign In with OpenID Sign In with Twitter
Support for Vanilla Forums Cloud product

In this Discussion

Follow Us


Creating a relative link in defaultmaster.tpl

whu606whu606 I'm not a SuperHero; I just like wearing tights... Moderator
edited December 2011 in Questions

I have a swf banner I want to use on my theme.

The swf file is in my theme's views folder.

If I make an absolute reference the swf file loads fine, but I can't work out how to make it relative.

I've tried snow.swf, views/snow.swf and /views/snow.swf

Can someone point me in the right direction please?

Thanks.

Best Answers

  • ToddTodd Chief Product Officer Vanilla Staff
    Answer ✓

    You want to do this:

    {link path="/themes/mytheme/design/snow.swf" notag="1"}
    

    The link function is meant for actual anchors so it's not optimal for theme assets if you don't have friendly urls. We'll have to add a nicer template function for you later.

  • 422422 Developer MVP
    Answer ✓

    Ive always set base href , in other projects. Not hadany luck with this in vanilla, would be a cleaner solution... wouldnt it?

    422 Real Estate Australia , now open Check it out

    Toddwhu606jspautsch
  • ToddTodd Chief Product Officer Vanilla Staff
    Answer ✓

    Holy eff @422 I've never heard of the base tag! I think that's a feature that may have to go into core.

    422

Answers

  • sahotataransahotataran Developer, Bay Area - CA ✭✭✭

    Relative swfs are hard to load. I remember in one of my projects In some other framework I tried to load swf by relative path but I was not successful - I had to either put swf in individual directory or I had to put and absolute path to swf

    Theme Charcha for great desktop and mobile experience! - drop me a message :)

  • whu606whu606 I'm not a SuperHero; I just like wearing tights... Moderator
    edited December 2011

    Todd

    Thanks for that. It's working now. I'm actually just using the html code

    <object width="800" height="120">
    <param name="movie" value="themes/whu/views/snow.swf">
    <embed src="themes/whu/views/snow.swf" width="800" height="120">
    </embed>
    </object>

    but I'm guessing from you answer I could do it another way?

    Actually, if you could tell me how that would help.

    I've just seen that using that short code doesn't load the movie in the discussion pages, only on the front page.

  • whu606whu606 I'm not a SuperHero; I just like wearing tights... Moderator

    Thanks (again!) for that, 422.

    I didn't know about the base href tag.

    That seems to be delivering my swf on each page now.

    jspautsch422UnderDog
  • 422422 Developer MVP

    @Todd My son is a top php programmer with a worldwide travel company. He has always used the base href method, as it localises all url routes.

    He has some very neat tricks for custom headers to, using a title tagging system, we use on our main site. Its very clean. I had tried utilising it within vanilla before, but had url collisions.

    Hope it can be used, as themeing then will become a breeze

    422 Real Estate Australia , now open Check it out

  • Put the full URL http://mywebsite.tld/themes/whu/views/snow.swf that way you know it will work.

Sign In or Register to comment.