Theme layout guidance

Started by gog, April 20, 2006, 10:03:26 AM

Previous topic - Next topic

gog

Hi,
speaking of usabillity I believe that the "New Topic" button/link should be on the left side just beneath the Topics title. For example, the top of this thread that you are looking at just now should look something like:

----------------------------------------------
Simple Machines Community Forum > SMF Support > Feature Requests

Theme layout guidance

New Topic
----------------------------------------------

With the "Theme layout guidance" in <h1> HTML tags for better semantics.

Note that the Topic name is not in the "breadcrumb"!

Also please have a look at http://www.simplemachines.org/community/index.php?topic=70569.msg481289#msg481289 nobody commented on this "feature" as well.

gog

Almost forgot, I think this is how the things should look like in the default theme. It will make other theme artists to do the same thing without the need to "reinvent the wheel"....

Tim

We are begining pre-production of a new user interface, so we'll definatly try a few things

Mind changing you avatar to something a little less provocative. I'm usually not bothered by something like this, but it leaves a little too less to the imagination...

gog

Great news...

p.s.
Hope my avatar is better now  :P

gog

I was doing on another website and had to play with the templates a little bit, They shure are messy and powerfull :) I made this thing work (although the code is quite scary 'cause it's done in couple of minutes :) ).

How to move topic title from breadcrumb to <h1>

In index.template.php replace the theme_linktree() function with this one.

function theme_linktree()
{
global $context, $settings, $options;
   
//print_r($context);
echo '<div class="nav" style="font-size: smaller; margin-bottom: 2ex; margin-top: 2ex;">';

// Each tree item has a URL and name. Some may have extra_before and extra_after.
foreach ($context['linktree'] as $link_num => $tree)
{
// Show something before the link?
if (isset($tree['extra_before']))
echo $tree['extra_before'];

// Show the link, including a URL if it should have one.
if (!is_int($context['current_topic']))
 {
     echo '<b>', $settings['linktree_link'] && isset($tree['url']) ? '<a href="' . $tree['url'] . '" class="nav">' . $tree['name'] . '</a>' : $tree['name'], '</b>';
 }
else
 {
 if ($link_num != count($context['linktree']) - 1) {
                   echo
'<b>', $settings['linktree_link'] && isset($tree['url']) ? '<a href="' . $tree['url'] . '" class="nav">' . $tree['name'] . '</a>' : $tree['name'], '</b>';
     } else {
         echo "</div>\n<h1>" . $tree['name'] . "</h1>\n";
     }
 }

// Show something after the link...?
if (isset($tree['extra_after']))
echo $tree['extra_after'];

// Don't show a separator for the last one.
if (!is_int($context['current_topic'])) {
 if ($link_num != count($context['linktree']) - 1) echo '&nbsp;&raquo;&nbsp;';
} else {
           if ((
$link_num != count($context['linktree']) - 1) && ($link_num != count($context['linktree']) - 2)) echo '&nbsp;&raquo;&nbsp;';
}

}
   if (!
is_int($context['current_topic'])) echo '</div>';
}


This works on SMF 1.1 RC3 - CVS 20060727 for shure, but I believe it works on other version as well.

Advertisement: