You are here

function fb_instant_articles_help in Facebook Instant Articles 3.x

Same name and namespace in other branches
  1. 8.2 fb_instant_articles.module \fb_instant_articles_help()
  2. 8 fb_instant_articles.module \fb_instant_articles_help()
  3. 7.2 fb_instant_articles.module \fb_instant_articles_help()
  4. 7 fb_instant_articles.module \fb_instant_articles_help()

Implements hook_help().

File

./fb_instant_articles.module, line 16
Contains fb_instant_articles.module..

Code

function fb_instant_articles_help($route_name, RouteMatchInterface $route_match) {
  switch ($route_name) {

    // Main module help for the fb_instant_articles module.
    case 'help.page.fb_instant_articles':
      $output = '';
      $output .= '<h3>' . t('About') . '</h3>';
      $output .= '<p>' . t('Base module for Facebook Instant Articles.') . '</p>';
      return $output;
    case 'fb_instant_articles.base_settings_form':
      $page_id = \Drupal::config('fb_instant_articles.settings')
        ->get('page_id');
      $output = '';
      $output .= '<h2>' . t('Setup') . '</h2>';
      $output .= '<p>' . t("Once you've activated this Drupal module, set up your Instant Articles and submit them to Facebook for a one-time review. The review is required before you can begin publishing. Follow these steps to get started:") . '</p>';
      $output .= '<ol>';
      $output .= '  <li>' . t('<a href="@sign_up_url" target="_blank">Sign up</a> for Instant Articles, if you haven\'t already, and enabled the same Facebook Page you have selected.', [
        '@sign_up_url' => 'https://www.facebook.com/instant_articles/signup',
      ]) . '</li>';
      $output .= '  <li>' . t('Claim the URL you will use to publish articles.</b> Right now, we think the URL for this page is: %url.', [
        '%url' => $_SERVER['HTTP_HOST'],
      ]);
      if ($page_id != '') {
        $claim_url = 'https://www.facebook.com/' . $page_id . '/settings/?tab=instant_articles#URL';
        $output .= t('<a href="@claim_url" target="_blank">Claim your URL here.</a>', [
          '@claim_url' => $claim_url,
        ]);
      }
      $output .= '</li>';
      $output .= '  <li>' . t('Install the Pages Manager App to preview your articles and styles on <a href="@ios_url" target="_blank">iOS</a> or <a href="@android_url" target="_blank">Android</a>.', [
        '@ios_url' => 'http://itunes.apple.com/app/facebook-pages-manager/id514643583?ls=1&mt=8&ign-mscache=1',
        '@android_url' => 'https://play.google.com/store/apps/details?id=com.facebook.pages.app',
      ]) . '</li>';
      $output .= '  <li>' . t('Create a style template for your articles using the <a href="@style_url" target="_blank">Style Editor</a>. Be sure to provide the name of the template you want to use in the Module Configuration settings below.', [
        '@style_url' => 'https://developers.facebook.com/docs/instant-articles/guides/design#style',
      ]) . '</li>';
      $output .= '  <li>' . t('[Optional] Enable Audience Network, if you choose. Learn more about <a href="@audience_url" target="_blank">Audience Network</a> for Instant Articles and <a href="@sign_up_url" target="_blank">sign up here</a>.', [
        '@audience_url' => 'https://fbinstantarticles.files.wordpress.com/2016/03/audience-network_wp_instant-articles-2-2-web_self-serve.pdf',
        '@sign_up_url' => '',
      ]) . '</li>';
      $output .= '  <li>' . t('[Optional] Set up your ads and analytics, including Audience Network, in the Configuration area, below.') . '</li>';
      if ($page_id != '') {
        $article_review_url = 'https://www.facebook.com/' . $page_id . '/settings/?tab=instant_articles#Setup-Step2';
        $output .= '  <li>' . t('<a href="@article_review_url" target="_blank">Submit your articles</a> for review.', [
          '@article_review_url' => $article_review_url,
        ]) . '</li>';
      }
      else {
        $output .= '  <li>' . t('Submit your articles for review.') . '</li>';
      }
      $output .= '</ol>';
      $output .= '<p>' . t('Other Resources:') . '</p>';
      $output .= '<ol>';
      $output .= '  <li>' . t('Read the <a href="@docs_url" target="_blank">documentation</a> to answer additional questions you might have about Instant Articles.', [
        '@docs_url' => 'https://developers.facebook.com/docs/instant-articles',
      ]) . '</li>';
      $output .= '  <li>' . t('Check out the <a href="@blog_url" target="_blank">Instant Articles blog</a> and sign up to receive notifications of important updates.', [
        '@blog_url' => 'https://developers.facebook.com/ia/blog/',
      ]) . '</li>';
      if ($page_id != '') {
        $tools_url = 'https://www.facebook.com/' . $page_id . '/settings/?tab=instant_articles';
        $roles_url = 'https://www.facebook.com/' . $page_id . '/settings/?tab=admin_roles';
        $output .= '  <li>' . t('To give other members of your team access to the <a href="@tools_url" target="_blank">Instant Articles tools</a>, assign them <a href="@roles_url" target="_blank">page roles here</a>.', [
          '@tools_url' => $tools_url,
          '@roles_url' => $roles_url,
        ]) . '</li>';
      }
      else {
        $output .= '  <li>' . t('To give other members of your team access to the Instant Articles tools, assign them page roles.') . '</li>';
      }
      $output .= '</ol>';
      return $output;
  }
}