s l a m
WEB PUBLISHING'S FRONTIER



Subscribe to "s l a m" in Radio UserLand.

Click to see the XML version of this web page.

Click here to send an email to the editor of this weblog.

© copyright 2004
by Marc Barrot.

Permalink
Friday, April 12, 2002

Targeting the Google Box Macro

Experimental new parameter to the google box macro adds open in new window for Google links.

I guess it's my turn to engage in a few minutes of 'non-kosher' activities this morning.

When I first checked Radio's news aggregator (it's fast becoming one of my morning rituals), I noticed two interesting bits of information :

  • Dave has surreptitiously added an 8th 'align' argument to the google.box.
  • The actual macro code lives at system.verbs.apps.google.macros.box in Radio.root.
So I quickly opened the box script, and added the following:
  • In the on box declaration, I inserted
    , target="_self"
    after align="". This ensures that if no target is specified to the box, the links will open in the same window.
  • In the build htmltext bundle, in the add function call that's inside the for loop, I inserted
    + "\" target=\"" + target
    after the adr^.url variable. This adds a target attribute for each link. Be very cautious with the quotes and backslashes.
I then hit the Compile button and closed the script window. Now, back in s l a m 's #homeTemplate.txt, I modified the call to the google.box macro to look like this:

<%google.macros.box ("\"google soap api\"", 5, 191, "A0A0A0", "#FFFFFF", "http://radio.userland.com/googleApi", "track2", "", "_blank" )%>

and republished the home page... Bingo, when you click on a link in s l a m 's Google box, it now opens in a new window.

Now for a disclaimer of sorts: don't try this hack if you don't feel comfortable with it. If it doesn't work for you, you're on your own, I don't even want to hear about it (ok, may be not :-).

Besides, the macro code might be changed by UserLand any minute, and your modifications wiped.

8:46:49 AM  Permalink    Google It!  


April 2002
Sun Mon Tue Wed Thu Fri Sat
  1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30        
Mar   May

last updated: 3/20/04; 5:22:00 PM.