function twitter_profile_widget_help in Twitter Profile Widget 8
Same name and namespace in other branches
- 8.2 twitter_profile_widget.module \twitter_profile_widget_help()
- 6 twitter_profile_widget.module \twitter_profile_widget_help()
- 7 twitter_profile_widget.module \twitter_profile_widget_help()
- 3.x twitter_profile_widget.module \twitter_profile_widget_help()
Implements hook_help().
File
- ./
twitter_profile_widget.module, line 20 - Contains twitter_profile_widget.module.
Code
function twitter_profile_widget_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
// Main module help for the twitter_profile_widget module.
case 'help.page.twitter_profile_widget':
$output = '';
$output .= '<h3>' . t('Installation') . '</h3>';
$output .= '<p>' . t('<ol><li>Install as you would normally install a contributed drupal module. See the <a href=":docs">documentation</a> for further information.</li><li>Go to Manage > Extend, and enable the Twitter Profile Widget module (drush en twitter_profile_widget).</li></ol>', [
':docs' => 'https://www.drupal.org/documentation/install/modules-themes/modules-8',
]) . '</p>';
$output .= '<h3>' . t('Configuration') . '</h3>';
$output .= '<p>' . t('<ol><li>You first need a Twitter App. This is different from the Twitter widget ID, and allows you to connect to the Twitter API. To get a Twitter App, sign in to Twitter and go to <a href=":twitter">https://apps.twitter.com/</a>. Copy the "key" and "secret" associated with your new app.</li><li>After installing the module in Drupal, go to Configuration > Media > Twitter Widgets (<a href=":config">/admin/config/media/twitter_profile_widget</a>). Enter the Twitter App key and secret you created in step 1.</li><li>Go to Content > Twitter widgets (<a href=":widgets">/admin/content/twitter_widget</a>) and create one or more widgets. The "description" is internal, to identify different widgets.</li><li>Now that you have Twitter widgets set up, you can display them in any part of your site via either entity reference or block display (each time you create a widget, it creates a corresponding block at <a href=":blocks">/admin/structure/block/block-content</a>). For example, you could use the built-in Structure > Block Layout > Place Block interface to put the widget on one or more pages. Alternatively, you could use <a href=":context">Context</a> or <a href=":panels">Panels</a> to place the twitter widget block. Or you could create an entity reference field on a node and embed the widget that way.</li></ol>', [
':config' => '/admin/config/media/twitter_profile_widget',
':widgets' => '/admin/content/twitter_widget',
':blocks' => '/admin/structure/block/block-content',
':twitter' => 'https://apps.twitter.com/',
':context' => 'https://www.drupal.org/project/context',
':panels' => 'https://www.drupal.org/project/panels',
]) . '</p>';
$output .= '<h3>' . t('Theming') . '</h3>';
$output .= '<p>' . t("By design, the display of tweets provided by this module is minimal. Developers can copy the twitter_widget.html.twig file from the /templates directory and add it to their theme and customize as necessary. To remove the CSS provided by this module, remove the <code>{{ attach_library('twitter_profile_widget/twitter-profile-widget') }}</code> from the twig file, or point it to your own defined library.") . '</p>';
return $output;
default:
}
}