Add title in iframe

15 views
Skip to first unread message

Davem

unread,
Nov 4, 2009, 1:39:02 PM11/4/09
to Google AJAX APIs
I have used the NewsShow Wizard to add a news show to the website of
the Virginia Institute of Marine Science:
http://www.vims.edu/newsandevents/vimsinthenews/google_vims_feed.php

I'd like to change the title to "VIMS" rather than the current title,
which appears to be taken from the first query term, which is
"Virginia Institute of Marine Science."

I have figured out how to do this in the Ajax Code Playground, but
can't figure out how to translate this functionality into the iframe
on my website.\

/*
 * The Google NewsShow embeds a news slideshow on your page, letting
your users see headlines
 * and previews of Google News Search results, based on queries that
you've selected.
 *
 * This sample will show how to specify queries for the News Show.
 * http://code.google.com/apis/ajaxsearch/documentation/newsshow.html
*/

google.load("elements", "1", {packages : ["newsshow"]});

function onLoad() {
  // Set the queries to USC Football and NHL
  var options = {
    "queryList" : [
      {
        "title" : "VIMS",
        "q" : "Virginia Institute of Marine Science"
      },
      {
        "title" : "VIMS",
        "q" : "Virginia Institute of Marine Sciences"
      },
      {
        "title" : "VIMS",
        "q" : "Virginia Institute for Marine Science"
      },
      {
        "title" : "VIMS",
        "q" : "Virginia Institute for Marine Sciences"
      }
    ]
  }
  var content = document.getElementById('content');
  var newsShow = new google.elements.NewsShow(content, options);
}

google.setOnLoadCallback(onLoad);

Adam Feldman

unread,
Nov 5, 2009, 5:57:12 AM11/5/09
to Google AJAX APIs
Hi Davem,

Setting the title to be different from the search query is not
available through the iframe. But you can accomplish what you're
looking for by copying the entire code from the playground (which you
pasted below) into your website and loading the NewsShow that way. If
you have any trouble with that, just let us know.

Cheers!

Adam

On Nov 5, 5:39 am, Davem <da...@vims.edu> wrote:
> I have used the NewsShow Wizard to add a news show to the website of
> the Virginia Institute of Marine Science:http://www.vims.edu/newsandevents/vimsinthenews/google_vims_feed.php
>
> I'd like to change the title to "VIMS" rather than the current title,
> which appears to be taken from the first query term, which is
> "Virginia Institute of Marine Science."
>
> I have figured out how to do this in the Ajax Code Playground, but
> can't figure out how to translate this functionality into the iframe
> on my website.\
>
> /*
>  * The Google NewsShow embeds a news slideshow on your page, letting
> your users see headlines
>  * and previews of Google News Search results, based on queries that
> you've selected.
>  *
>  * This sample will show how to specify queries for the News Show.
>  *http://code.google.com/apis/ajaxsearch/documentation/newsshow.html
Reply all
Reply to author
Forward
0 new messages