Me again
So that UTF-8 thing worked out, but I'm stuck with the Smarty code. Here's my current config.inc.php:
Code: Select all
<?php
// Be nice to the frontend users. They don't need the additional constants
// and file lookups. Only load them when in Admin mode.
if ($serendipity['GET']['adminModule'] == 'templates' || $serendipity['POST']['adminModule'] != 'templates') {
// Probe for a language include with constants. Still include defines
// later on, if some constants were missing
$probelang = dirname(__FILE__) . '/' . $serendipity['charset'] . 'lang_' . $serendipity['lang'] . '.inc.php';
if (file_exists($probelang)) {
include $probelang;
}
include dirname(__FILE__) . '/lang_en.inc.php';
}
$template_config = array(
array(
'var' => 'cocommentactive',
'name' => COCOMMENT_ACTIVE,
'description' => COCOMMENT_ACTIVE_DESC,
'type' => 'select',
'default' => 'inactive',
'select_values' => array('active' => USE_COCOMMENT,
'inactive' => NO_COCOMMENT)
),
array(
'var' => 'amount',
'name' => 'Number of navlinks',
'description' => 'Enter the number of navlinks you want to use in the navbar.',
'type' => 'string',
'default' => '5',
)
);
$vars = serendipity_loadThemeOptions($template_config);
for ($i = 0; $i < $vars['amount']; $i++) {
$template_config[] = array(
'var' => 'navlink' . $i . 'text',
'name' => NAV_LINK_TEXT . ' #' . $i,
'description' => NAV_LINK_DESC . ' #' .$i,
'type' => 'string',
'default' => constant('NAV_DEFAULT_' . $i),
);
$template_config[] = array(
'var' => 'navlink' . $i . 'url',
'name' => NAV_LINK_URL . ' #' . $i,
'description' => NAV_LINK_URL_DESC . ' #' . $i,
'type' => 'string',
'default' => '#',
);
}
and here's the Smarty code for the index.tpl I have so far:
Code: Select all
{section name=buildnav start=0 loop=$template_option.amount step=1}
<li><a href="#" title="foo">bar</a></li>
{/section}
But how do I get the relevant '$navlink . $i . url' here? I can't use the dot concatenation here, right? Something like:
Code: Select all
<li><a href="#" title="foo">{$template_option.navlink|cat: $smarty.section.buildnav.index|cat: "text"}</a></li>
produces an error ...
Help!
YL