started second cartel of audio player
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
* Functions to support theming in the edlp theme.
|
||||
*/
|
||||
|
||||
|
||||
use Drupal\Core\Url;
|
||||
use Drupal\Core\Form\FormStateInterface;
|
||||
use Drupal\Core\Template\Attribute;
|
||||
|
||||
@@ -17,7 +17,7 @@ use Drupal\Core\Template\Attribute;
|
||||
function edlptheme_preprocess_node(&$vars){
|
||||
$node = $vars['elements']['#node'];
|
||||
$options = ['absolute' => TRUE];
|
||||
$url = \Drupal\Core\Url::fromRoute('entity.node.canonical', ['node' => $node->id()], $options);
|
||||
$url = Url::fromRoute('entity.node.canonical', ['node' => $node->id()], $options);
|
||||
$system_path = $url->getInternalPath();
|
||||
$vars['link_attributes'] = new Attribute(array(
|
||||
'data-drupal-link-system-path' => $system_path=='' ? '<front>' : $system_path
|
||||
@@ -53,3 +53,47 @@ function edlptheme_preprocess_edlp_productions(&$vars){
|
||||
}
|
||||
// dpm($vars);
|
||||
}
|
||||
|
||||
function edlptheme_preprocess_node__player_cartel(&$vars){
|
||||
// dpm($vars);
|
||||
// if transcript not empty
|
||||
$url = Url::fromRoute('entity.node.canonical', ['node'=>$vars['node']->id()], array(
|
||||
'attributes' => array(
|
||||
'class' => ['link-transcript', 'ajax-link'],
|
||||
'viewmode'=>'transcript'
|
||||
)
|
||||
));
|
||||
$vars['link_transcript'] = array(
|
||||
'#title' => t("Lire le text."),
|
||||
'#type' => 'link',
|
||||
'#url' => $url,
|
||||
'#options'=>array(
|
||||
'attributes' => array(
|
||||
'data-drupal-link-system-path' => $url->getInternalPath()
|
||||
)
|
||||
)
|
||||
);
|
||||
// if article not empty
|
||||
$url = Url::fromRoute('entity.node.canonical', ['node'=>$vars['node']->id()], array(
|
||||
'attributes' => array(
|
||||
'class' => ['link-article', 'ajax-link'],
|
||||
'viewmode'=>'article'
|
||||
)
|
||||
));
|
||||
$vars['link_article'] = array(
|
||||
'#title' => t("Lire l'article."),
|
||||
'#type' => 'link',
|
||||
'#url' => $url,
|
||||
'#options' => array(
|
||||
'attributes'=>array(
|
||||
'data-drupal-link-system-path' => $url->getInternalPath()
|
||||
)
|
||||
)
|
||||
);
|
||||
// if article or transcript
|
||||
$vars['col_left'] = true;
|
||||
|
||||
// if
|
||||
$vars['col_right'] = true;
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user