Unyson icon indicating copy to clipboard operation
Unyson copied to clipboard

Section Titles

Open sschristina opened this issue 8 years ago • 11 comments

Hello,

Please see the attached images - I have the box option where I can add the section names, but for some reason, they are not showing up? I would like to name each section if possible?

screen shot 2018-06-08 at 09 31 26 screen shot 2018-06-08 at 09 31 37

sschristina avatar Jun 08 '18 08:06 sschristina

Can anyone help with the above at all?

sschristina avatar Jun 11 '18 10:06 sschristina

I don't see your config.php from section:

<?php if ( ! defined( 'FW' ) ) {
	die( 'Forbidden' );
}

$cfg = array(
	'page_builder' => array(
		'title'          => __( 'Section', 'domain' ),
		'description'    => __( 'Add a Section', 'domain' ),
		'popup_size'     => 'medium',
		'title_template' => '{{ if (!o.section_name) { }} {{- title}} {{ } }} {{ if (o.section_name) { }} {{- o.section_name}} {{ } }}',
		'type'           => 'section' // WARNING: Do not edit this
	)
);

ViorelEremia avatar Jun 11 '18 14:06 ViorelEremia

Hello,

Please see below:

array( 'title' => __( 'Section', 'the-core' ), 'description' => __( 'Add a Section', 'the-core' ), 'popup_size' => 'medium', 'title_template' => '{{ if (!o.section_name) { }} {{- title}} {{ } }} {{ if (o.section_name) { }} {{- o.section_name}} {{ } }} {{ if (o.background_options.background == "color" && o.background_options.color.background_color.id == "fw-custom") { }} {{ } else if(o.background_options.background == "color"){ }} {{ } }}', 'type' => 'section', // WARNING: Do not edit this 'popup_header_elements' => ''.__('Go to Docs', 'the-core').'', ) );

sschristina avatar Jun 12 '18 09:06 sschristina

Do I need to change this?

sschristina avatar Jun 12 '18 15:06 sschristina

Can anyone help with the above?

sschristina avatar Jun 14 '18 10:06 sschristina

$title_template = '{{-title}}';
$title_template .= '{{ if (o.section_name) { }}';
$title_template .= ' : <strong>{{= o.section_name}}</strong>';
$title_template .= '{{ } }}';


....
'title_template' => $title_template,

danyj avatar Jun 14 '18 10:06 danyj

@sschristina I gave the working code:

$cfg = array(
	'page_builder' => array(
		'title'          => __( 'Section', 'domain' ),
		'description'    => __( 'Add a Section', 'domain' ),
		'popup_size'     => 'medium',
		'title_template' => '{{ if (!o.section_name) { }} {{- title}} {{ } }} {{ if (o.section_name) { }} {{- o.section_name}} {{ } }}',
		'type'           => 'section' // WARNING: Do not edit this
	)
);

it is working i'm sure. "section_name" should it must coincide with the setting key for the section name paste it in your section/config.phnp.

ViorelEremia avatar Jun 14 '18 10:06 ViorelEremia

Hello,

I have added:

$cfg = array( 'page_builder' => array( 'title' => __( 'Section', 'domain' ), 'description' => __( 'Add a Section', 'domain' ), 'popup_size' => 'medium', 'title_template' => '{{ if (!o.section_name) { }} {{- title}} {{ } }} {{ if (o.section_name) { }} {{- o.section_name}} {{ } }}', 'type' => 'section' // WARNING: Do not edit this ) );

but it has broken the website - please see attached screenshot.

screenshot 2018-06-18 10 44 00

sschristina avatar Jun 18 '18 09:06 sschristina

I put the above in the /section/config.php file

sschristina avatar Jun 18 '18 09:06 sschristina

did you forget php opening on top of the file?

<?php

danyj avatar Jun 18 '18 09:06 danyj

I did! Thank you so much :---)

sschristina avatar Jun 18 '18 10:06 sschristina