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 Google It!
|
|