1 (edited by Spartanicus 2006-11-18 02:15)

Topic: <h1> header content

I am not happy about the current <h1> content on pages other than the index page. Pages on a site should all have unique <h1> content.

Currently if you were to use a bot to generate a site map, pages would be indistinguisable due to all pages having the board title variable as the <h1> content.

Only the index page should have the board title as the <h1> content, the search page should use "Search", the login page "Login" etc.

I'd like to mod 1.2 to achieve this, if someone could help with modifying the pun_title section of header.php that would be great.

Re: <h1> header content

Moved to Modifications smile

Re: <h1> header content

Very easy to do actually. Just open header.php and change line 148 from:

$tpl_main = str_replace('<pun_title>', '<h1><span>'.pun_htmlspecialchars($pun_config['o_board_title']).'</span></h1>', $tpl_main);

with:

switch (basename($_SERVER['PHP_SELF'])):
    default:
    case 'index.php':
        $h1_title = pun_htmlspecialchars($pun_config['o_board_title']);
        break;
    case 'search.php':
        $h1_title = 'This is the search.php H1 content';
        break;
    case 'login.php':
        $h1_title = 'This is the login.php H1 content';
        break;
endswitch;

$tpl_main = str_replace('<pun_title>', '<h1><span>'.$h1_title.'</span></h1>', $tpl_main);

Just add a case for each of the *.php pages you want to have different H1 content smile

Re: <h1> header content

CodeXP wrote:

Very easy to do actually. Just open header.php and change line 148 from:

(code snipped)

Just add a case for each of the *.php pages you want to have different H1 content :)

Thanks again for your help CodeXP, that's a considerable improvement. But I now realise that fully fixing this issue may require a lot of work which may be beyond the scope of a reasonable mod.

Afaics what needs to happen is that on pages other than the page generated by index.php the level of each header needs to be bumped up one level. On the page generated by viewforum.php for example what is currently the <h2> content (i.e. the name of the forum) should actually be the <h1> content.

This cannot be achieved with the type of mod that you suggested.