Search this site: [Advanced Search]
 

Messages: 1 of 1. Pages: 1
Comments/Replies (0) appear below in chronological order. Comment form is at bottom of page.
Managing Local and Remote URLs in Radio (#398)
Posted: 8/11/2002; 11:05 PM by Terry Frazier
Reply | Trackback URL | Weblog Permalink
I don't know anything about writing macros for Frontier so how would I create an ifLocal macro? For my reference mainly, as I don't fully understand the fix but I most definitely understand the problem -- it's bitten me a couple of times already.

Jon Udell is moving his weblog to new home using Radio and external FTP site. One of the gotchas he found:

"- If you hardcode your site address anywhere, you'll get burned. I did this in a few places. For example, I had:

http://radio.weblogs.com/0100887/stories/2002/03/16/storylist.html

instead of:

<%radio.weblog.getUrl()%>stories/2002/03/16/storylist.html"

Right. In fact, I use my own macro to do just that and little bit more. <%ifLocal()%> macro, which looks like this:

on ifLocal (url1="/", url2=radio.macros.weblogUrl()) {
  if radioResponder.flSameMachine {return (url1)} else {return (url2)}
}

One of the problems with Radio that I noticed is that it's not easy to produce link that works properly off- and on-line. Local links look like this: http://127.0.0.1:5335/gems/toolbox.css, and external links look like this: http://radio.weblogs.com/0106541/gems/toolbox.css. I use external stylesheets and often work offline, so it's real problem for me. ifLocal macros always generates proper link and works for images, files and pretty much everything else. Just put this as a value for href or src attribute: <%ifLocal()%>gems/toolbox.css and you're done. [toolbox]
Total Messages: 1. Pages: 1

Trackbacks

What other weblogs are saying about this topic. Trackback URL: http://www.terryfrazier.com/398/trackback

Reply to message #398...

You must logon before posting a reply

You must login to your account to post a comment. If you do not have an account you can create one here. It's a bit inconvenient but only takes a moment and helps control spam and other bad actors.