Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • wcms/uw_cfg_common
1 result
Show changes
Commits on Source (3)
langcode: en
status: true
dependencies: { }
id: uw_lbb_service_teaser
block_id: uw_cbl_service_teaser
category: uw_bc_teasers
label: 'Service teaser'
weight: -100
image_path: images/layout_builder_browser/serviceteaser.svg
image_path_base: 'theme:uw_fdsu_theme_resp'
image_alt: 'Service teaser'
langcode: en
status: true
dependencies: { }
id: uw_lbb_services_list
block_id: 'inline_block:uw_cbl_services_list'
category: uw_bc_listings
label: 'Services list'
weight: 0
image_path: images/layout_builder_browser/servicelist.svg
image_path_base: 'theme:uw_fdsu_theme_resp'
image_alt: 'Services listing'
langcode: en
status: true
dependencies: { }
id: uw_lbb_services_search
block_id: uw_cbl_services_search
category: uw_bc_searches
label: 'Services search'
weight: 0
image_path: images/layout_builder_browser/servicesearch.svg
image_path_base: 'theme:uw_fdsu_theme_resp'
image_alt: 'Services search'
......@@ -139,7 +139,9 @@ class UwNodeContent {
$node_flags['get_hero'] = TRUE;
}
elseif ($view_mode == 'teaser') {
$node_flags['get_footer'] = FALSE;
if ($node->getType() !== 'uw_ct_contact') {
$node_flags['get_footer'] = FALSE;
}
$node_flags['get_listing_image'] = TRUE;
$node_flags['get_title'] = TRUE;
}
......@@ -453,7 +455,7 @@ class UwNodeContent {
// Setup the actual content.
if ($node_flags['get_content']) {
$content_data['content'] = $this->addToContentData('content', 'field_uw_news_summary');
$content_data['content'] = $this->addToContentData('content', NULL);
}
// Get the footer data.
......
......@@ -180,25 +180,29 @@ class UwNodeFieldValue {
*
* @param \Drupal\node\Entity\Node $node
* The node.
* @param string $field_name
* @param string|null $field_name
* The name of the field to get.
*
* @return array
* Render array for formatted text.
*/
public function getFormattedText(Node $node, string $field_name): array {
// Get the value of the field.
$value = $node->$field_name->value;
// If the value is not null, then return the
// formatted text render array.
if ($value !== NULL) {
return [
'#type' => 'processed_text',
'#text' => $value,
'#format' => $node->$field_name->format,
];
public function getFormattedText(Node $node, string $field_name = NULL): array {
// Ensure that we have a field to check.
if ($field_name !== NULL) {
// Get the value of the field.
$value = $node->$field_name->value;
// If the value is not null, then return the
// formatted text render array.
if ($value !== NULL) {
return [
'#type' => 'processed_text',
'#text' => $value,
'#format' => $node->$field_name->format,
];
}
}
// If we get here there is no value, so
......@@ -371,13 +375,13 @@ class UwNodeFieldValue {
* The node.
* @param string $view_mode
* The view mode.
* @param string $field_name
* @param string|null $field_name
* The field name.
*
* @return array|null
* Array of field value or NULL.
*/
public function getContentField(Node $node, string $view_mode, string $field_name) {
public function getContentField(Node $node, string $view_mode, string $field_name = NULL): ?array {
// If on the teaser, return the summary field values.
if ($view_mode == 'teaser') {
......