Topic on Project:Support desk

Getting the page tools and personal tools for a skin

3
ArrakisMiner (talkcontribs)

I'm trying to create a skin in PHP for my wiki, and I'm having issues with getting the page tools (edit, view, history etc) and the user tools (login, watch, talk, contribs etc) to display properly. I've taken a look at some of the skins around, and it seems that the best way, and recommended way, to do this is via this snipped:

$personalTools = $this->getPersonalTools();
foreach ( $personalTools as $key => $item ) {
echo $this->makeListItem( $key, $item );
}

And for the namespace tools:

$pageNav = $this->data['content_navigation'];
foreach ( $pageNav['namespaces'] as $key => $tab ) {
echo $this->makeListItem( $key, $tab );
}

This is causing me issues, however, and both variants of the code, for either the page tools or the user tools, display in the top left of the screen and at the top of the skin code (when viewed in Inspect Element) irregardless of where they're placed in the code — how do I get them to respect the div they're placed into and not go to the top left of the page?

TheDJ (talkcontribs)

echo outputs wherever the output position currently is. Perhaps you need to concatenate to a previously generated string variable ? It really depends. Its issues like these which are why we are switching to a mustache template based architecture for skins btw.

ArrakisMiner (talkcontribs)

Hmm, maybe, I'm following the code here and here respectively, so I'm not entirely sure what I'm doing differently?

Reply to "Getting the page tools and personal tools for a skin"