You are here

function googlenews_tag_list in Google News sitemap 7

Provide a list of tags that are available for use in news feeds.

Tags must be in the following format: 'tag_name' => array( 'title' => t('The tag name'), 'description' => t('A full description for the tag, detailing its intended usage'), // If the tag is to be a selector instead of a text field: 'options' => array( 'opt1' => t('Option 1'), 'opt2' => t('Option 2'), 'opt3' => t('Option 3'), ), // If the selector is to allow multiple items. 'multiple' => TRUE, ),

Return value

array A nested array of available tags.

2 calls to googlenews_tag_list()
googlenews_admin_settings in ./googlenews.admin.inc
Form builder; administration settings.
googlenews_getgooglenews in ./googlenews.sitemap.inc
Generate the news feed.

File

./googlenews.module, line 52
Provides a Google News sitemap within your site using the URL.

Code

function googlenews_tag_list() {
  $tags = array(
    'access' => array(
      'title' => t('Access requirements'),
      'description' => t('Describes the accessibility of the article to Google News readers.'),
      'options' => array(
        '' => t('None (default)'),
        'Subscription' => t('Subscription required'),
        'Registration' => t('Registration required'),
      ),
    ),
    'genres' => array(
      'title' => t('Genres'),
      'description' => t("The character of the article's content. This must be accurate in order to provide a consistent experience for Google News readers. Multiple selections are allowed."),
      'options' => array(
        'PressRelease' => t('Official press release.'),
        'Satire' => t('Satire - ridicules its subject for didactic purposes.'),
        'Blog' => t('Blog - article published on a blog or in a blog format.'),
        'OpEd' => t("OpEd - opinion-based article which comes specifically from the site's Op-Ed section."),
        'Opinion' => t('Opinion - non-OpEd opinion-based article, e.g. reviews, interviews, etc.'),
        'UserGenerated' => t('User generated - newsworthy content which has already gone through a formal editorial review process.'),
      ),
      'multiple' => TRUE,
    ),
    'geo_locations' => array(
      'title' => t('Geographical locations'),
      'description' => t("This tag can help Google News identify the geographic location of the articles. Applying it may be especially useful if there are sections of the site dedicated to coverage of a specific location that differs from the site's main location. List locations from smallest entity to largest, e.g. City, State, Country, or Province, Country."),
    ),
    'keywords' => array(
      'title' => t('Keywords'),
      'description' => t('A comma-separated list of keywords describing the topic of the article. Keywords may be drawn from, but are not limited to, the <a href="@keywords-url">list of existing Google News keywords</a>.', array(
        '@keywords-url' => 'http://support.google.com/news/publisher/bin/answer.py?hl=en&answer=116037',
      )),
    ),
    'stock_tickers' => array(
      'title' => t('Stock tickers'),
      'description' => t('A comma-separated list of up to 5 stock tickers of the companies, mutual funds, or other financial entities that are the main subject of the article. Relevant primarily for business articles. Each ticker must be prefixed by the name of its stock exchange, and must match its entry in <a href="@finance-url">Google Finance</a>. For example, "NASDAQ:AMAT" (but not "NASD:AMAT"), or "BOM:500325" (but not "BOM:RIL").', array(
        '@finance-url' => 'http://finance.google.com/',
      )),
    ),
  );

  // Allow other modules to extend the list.
  drupal_alter('googlenews_tags', $tags);
  return $tags;
}