Thanks for the explanation Fel. I see is not practical to get the block title before the linktree is created. The formed linktree is a great solution, only problem is that doesn't support multi-language...
Since I need multi-language support on the site I'm working on but don't plan to create new pages very often, I will use this solution:
I have added these text strings to index.language.php
// PortaMx Pages
$txt['pmxpage_advertising'] = 'Advertising';
$txt['pmxpage_contact'] = 'Contact';
$txt['pmxpage_legal'] = 'Legal';
and in PortaMx.php I have replaced this:
else
$context['linktree'] = array_merge(array($pmxhome), array($pmxforum), $context['linktree']);
by this:
else
{
if (isset($txt['pmxpage_'.$pmxforum['name']]))
$pmxforum['name'] = $txt['pmxpage_'.$pmxforum['name']];
$context['linktree'] = array_merge(array($pmxhome), array($pmxforum), $context['linktree']);
}
Not very practical if you need to add pages constantly but it works for me. In the worst case it will still show the page name.