News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

My Brain Hurts...

Started by elkaintmoose, April 22, 2006, 10:03:13 PM

Previous topic - Next topic

elkaintmoose

Ow. I'm attempting to modify the tables that contain links to the various areas, on the user's profile page, for instance. (That's the template I'm on now, so I'll use it as an example.)

Because my web site's text area is rather narrow, I'd like to try to place them in a separate table above the main profile information, and have the cells running horizontally rather than vertically. I'll take a small usability hit by scrunching them at the top of the page, but I think it's better than having the main data smushed as much as it ends up in my current layout. On the assumption that it's easier to look at than explain, here's a quick mock-up of what I'd like to accomplish: http://www.ferrellweb.com/temp/sample.gif

To pull this off, I need to close off the 'sidebar' table before the big one starts. No problem there. But I also need to change the current order of<tr><td>HEADING</td><tr>
<tr><td>LINKS</td></tr>
etc.

to
<tr><td>HEADING1</td><td>HEADING2</td>etc.</tr>
<tr><td>LINKS1</td><td>LINKS2</td>etc.</tr>

which, I imagine, is going to call for a rewrite of the way the template code iterates through the allowed areas. Here's the revelant piece of Profile.template.php, with the table already closed off early, for reference:
// Loop through every area, displaying its name as a header.
foreach ($context['profile_areas'] as $section)
{
echo '
<tr>
<td class="catbg">', $section['title'], '</td>
</tr>
<tr class="windowbg2">
<td class="smalltext">';

// For every section of the area display it, and bold it if it's the current area.
foreach ($section['areas'] as $i => $area)
if ($i == $context['menu_item_selected'])
echo '<b>', $area, '</b><br />';
else
echo '', $area, '<br />';
echo '<br /></td></tr>';
}
echo '</table></td></tr></table>
<!--</td>
<td width="100%" valign="top">-->';


I'm not sure if this is possible; I think I'm going to need variables that aren't in the template here to call up only the headings first, followed by only the links...

Has anybody made this kind of vertical-to-horizontal mod before, and maybe have some code I could look at? Any ideas how I might accomplish it?

Thanks!
jeff.


elkaintmoose

Nevermind, I got it.  :D A night's sleep later, and I'm good, apparently.

Advertisement: