logo

Extra Block Types (EBT) - New Layout Builder experience❗

Extra Block Types (EBT) - styled, customizable block types: Slideshows, Tabs, Cards, Accordions and many others. Built-in settings for background, DOM Box, javascript plugins. Experience the future of layout building today.

Demo EBT modules Download EBT modules

❗Extra Paragraph Types (EPT) - New Paragraphs experience

Extra Paragraph Types (EPT) - analogical paragraph based set of modules.

Demo EPT modules Download EPT modules

Scroll

Different header color

22/02/2025, by Anonymous (not verified)
Forums

You need to insert the hex color code found in the field field_color into the appropriate piece of HTML code.

 

I prepared the following in the site template:

<?php print render($title_prefix); ?>
                <?php if ($title): ?>
                    <h1 style="color: #<?php echo $Set_color; ?>;" id="page-title"><?php print $title; ?></h1>
                <?php endif; ?>
                <?php print render($title_suffix); ?>

 

In general, I can't figure out how to insert the content of the $Set_color variable with the value from the field_color field and then naturally pass it into the pre-prepared  <h1 style="color: #<?php echo $Set_color; ?>;" id="page-title"><?php print $title; ?></h1>.

 

I started with this code

  // Loading the node
  $node = node_load($nid);
  // Getting the field values
  $Set_color = $node->field_color[$node->language]['0']['value'];

 

But nothing is being outputted.

 

How can I display the value?