News:

Follow us on Bluesky!

Main Menu

$txt variable

Started by MelfromBoD, May 28, 2009, 02:01:37 PM

Previous topic - Next topic

MelfromBoD

hello all, I want to add another link to the nav bar at the top of the directory besides "Home" but before "Help" I found where it is and duplicated home but I don't know where the $txt varible is defined to add the "Directory" variable.

code line 519 of index.template.php of default theme:

   
Quote// Show the [home] button.
   echo ($current_action=='home' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
            <td valign="top" class="maintab_' , $current_action == 'home' ? 'active_back' : 'back' , '">
               <a href="', $scripturl, '">' , $txt[103] , '</a>
            </td>' , $current_action == 'home' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';

i duplicated this:

               
Quote// Show the [directory] button.
   echo ($current_action=='directory' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
            <td valign="top" class="maintab_' , $current_action == 'directory' ? 'active_back' : 'back' , '">
               <a href="http://www.blogodirectory.com [nofollow]">' , $txt[103] , '</a>
            </td>' , $current_action == 'directory' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';

but I dont know where to change the $txt[103] at? I have two "Home" buttons the link works but it displays "Home"

thanks


Marcus Forsberg

Open ./Themes/default/languages/index.english.php and add this right before ?>:

$txt['directory'] = 'Directory';

Then fidn the code you posted above, and replace

<a href="http://www.blogodirectory.com">' , $txt[103] , '</a>
with
<a href="http://www.blogodirectory.com">' , $txt['directory'] , '</a>

MelfromBoD

didnt see your post...so i tried this and it worked:

   // Show the [directory] button.
   echo '<a href="http://www.blogodirectory.com [nofollow]">Directory</a>';

Marcus Forsberg

Yes, that works ofcourse. But the "correct" way would be to add it to a textstring as shown above.
Topic marked as solved anyway. :)

Advertisement: