-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
25 changed files
with
116 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
63 changes: 63 additions & 0 deletions
63
modules/jumpstart_ui/src/Plugin/paragraphs/Behavior/FaqParagraphBehavior.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
<?php | ||
|
||
namespace Drupal\jumpstart_ui\Plugin\paragraphs\Behavior; | ||
|
||
use Drupal\Core\Entity\Display\EntityViewDisplayInterface; | ||
use Drupal\Core\Form\FormStateInterface; | ||
use Drupal\paragraphs\ParagraphInterface; | ||
use Drupal\paragraphs\ParagraphsBehaviorBase; | ||
use Drupal\paragraphs\ParagraphsTypeInterface; | ||
|
||
/** | ||
* Class FaqParagraphBehavior. | ||
* | ||
* @ParagraphsBehavior( | ||
* id = "faq_accordions", | ||
* label = @Translation("FAQ Accordion"), | ||
* description = @Translation("Display options for the FAQ Accordion paragraph.") | ||
* ) | ||
*/ | ||
class FaqParagraphBehavior extends ParagraphsBehaviorBase { | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
public function defaultConfiguration() { | ||
return ['heading' => 'h2']; | ||
} | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
public static function isApplicable(ParagraphsTypeInterface $paragraphs_type) { | ||
return $paragraphs_type->id() == 'stanford_faq'; | ||
} | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
public function buildBehaviorForm(ParagraphInterface $paragraph, array &$form, FormStateInterface $form_state) { | ||
$form = parent::buildBehaviorForm($paragraph, $form, $form_state); | ||
$form['heading'] = [ | ||
'#type' => 'select', | ||
'#title' => $this->t('Heading Level'), | ||
'#options' => [ | ||
'h2' => 'H2', | ||
'h3' => 'H3', | ||
'h4' => 'H4', | ||
], | ||
'#default_value' => $paragraph->getBehaviorSetting('faq_accordions', 'heading', 'h2'), | ||
]; | ||
return $form; | ||
} | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
public function view(array &$build, ParagraphInterface $paragraph, EntityViewDisplayInterface $display, $view_mode) { | ||
if (isset($build['su_faq_headline'][0]['#tag'])) { | ||
$build['su_faq_headline'][0]['#tag'] = $paragraph->getBehaviorSetting('faq_accordions', 'heading', 'h2'); | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
modules/stanford_basic_page_types/stanford_basic_page_types.info.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
modules/stanford_paragraph_card/stanford_paragraph_card.info.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
name: 'Stanford Paragraph Card' | ||
description: 'Adds helpers and modifications to the card paragraph type.' | ||
version: 9.8.6 | ||
version: 9.8.7 | ||
core_version_requirement: ^10.3 || ^11 | ||
type: module | ||
project: Stanford |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
modules/stanford_profile_styles/stanford_profile_styles.info.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
name: 'Stanford Profile Styles' | ||
description: 'A module for theming' | ||
version: 9.8.6 | ||
version: 9.8.7 | ||
core_version_requirement: ^10.3 || ^11 | ||
type: module | ||
project: Stanford |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters