Page 1 of 1

$template_config_groups not including type="content"

Posted: Thu May 10, 2012 3:20 am
by Don Chambers
Ive just noticed that when template options are collapsed under a heading via $template_config_groups, template options defined as 'type' => 'content' are not included, and remain outside the collapsed section. Is this by design or oversight?

Re: $template_config_groups not including type="content"

Posted: Thu May 10, 2012 2:50 pm
by garvinhicking
Don Chambers wrote:Ive just noticed that when template options are collapsed under a heading via $template_config_groups, template options defined as 'type' => 'content' are not included, and remain outside the collapsed section. Is this by design or oversight?
Content-Types follow some own kind of logic, and I think there was a reason why this is handled differently. Maybe I'll remember, but for the time being I'm afraid they won't wrap then...

Re: $template_config_groups not including type="content"

Posted: Thu May 10, 2012 5:01 pm
by Don Chambers
garvinhicking wrote:Content-Types follow some own kind of logic, and I think there was a reason why this is handled differently. Maybe I'll remember, but for the time being I'm afraid they won't wrap then...
That's a shame, as they are very useful for displaying additional info and/or help messages.

Re: $template_config_groups not including type="content"

Posted: Sat May 12, 2012 10:08 am
by garvinhicking
Hi!

Seems I talked bullshit. I just tested it in the bulletproof config.inc.php, added this to the config array:

Code: Select all

   array(
        'var' => 'contenttest',
        'name' => 'Contenttest',
        'type' => 'content',
        'default' => '<b>Hello!!!</b>',
    ),
and then added it to the first group:

Code: Select all

$template_config_groups = array(
    THEME_COLORSET  => array('colorset', 'userstylesheet', 'layouttype', 'jscolumns', 'contenttest'),
    THEME_HEADER    => array('custheader', 'headerimage', 'headertype')
);
and the "Hello" output i s there in the colorset group...?!

Regards,
Garvin

Re: $template_config_groups not including type="content"

Posted: Sat May 12, 2012 4:05 pm
by Timbalu
Well that way this is working well, because it is static, we know it. You can even go via 'custom'.
But we need (see other thread) the vars of $template_loaded_config passed to $template_config_groups. In there or on its way 'content' items gets lost somehow, as not added to the collapsing part and placed outside. (As I said, clone that "function or whereever it is" or even change the core to be not that strict.)

Re: $template_config_groups not including type="content"

Posted: Sat May 12, 2012 11:55 pm
by Don Chambers
Type content seems to work when it is one of the explicitly listed template options, ie: 'My Heading' => array('colorset', 'userstylesheet', etc). it does not work for content types when part of an array, such as:

Code: Select all

$navlinks = array();

for ($i = 0; $i < $template_loaded_config['amount']; $i++) {
    $navlinks[] = array(
		'navlink'=>$template_loaded_config['navlink' . $i . 'navlink_intro',
        'title' => $template_loaded_config['navlink' . $i . 'text'],
        'href'  => $template_loaded_config['navlink' . $i . 'url']
    );
    $template_config[] = array(
        'var'           => 'navlink' . $i . 'navlink_intro',
        'type'          => 'content',
        'default'       => 'Header for navlink #' . $i ,
        );	
    $template_config[] = array(
        'var'           => 'navlink' . $i . 'text',
        'name'          => NAV_LINK_TEXT . ' #' . $i,
        'type'          => 'string',
        'default'       => 'Link #' . $i,
        );
    $template_config[] = array(
        'var'           => 'navlink' . $i . 'url',
        'name'          => NAV_LINK_URL . ' #' . $i,
        'type'          => 'string',
        'default'       => '#',
    );
}
The very fact that there are multiple items in this type of template config is why content type is even more important when these items are collapsed under a common heading.

Re: $template_config_groups not including type="content"

Posted: Sun May 13, 2012 1:08 am
by garvinhicking
Hi!

Guys, I don't get any of your replies. Please send me a full example config.inc.php (or, even better, one that is reduced to the problem not working) so that I can see what you're having problems with. :)

Regards,
Garvin

Re: $template_config_groups not including type="content"

Posted: Sun May 13, 2012 1:31 am
by Don Chambers
Garvin - when using "static" template options with var type "content", everything works fine... just as you proved. They do not show in the collapsed header when the var type 'content' is part of an array, as in my example above (ie, a navlink parameter is type 'content', in addition to navlink text, url, etc.

However, I think I solved the problem to my personal satisfaction as explained here: http://board.s9y.org/viewtopic.php?f=5& ... #p10430728