Replace the graphics in the navbar with plain text Replace the graphics in the navbar with plain text
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

Replace the graphics in the navbar with plain text

Started by joachimjohansson, May 11, 2006, 11:52:40 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

joachimjohansson

I want to replace the graphics in the navigation bar with plain text. Preferrably with a translateable option. In other words, I want it to read "suite" in french, "nästa" in swedish, "next" in english".

I have still to find a theme that does that, and after two days of trial and error I've come to the conclusion that, as far as I can tell, there's no way of doing that in CPG 1.4.5.

Is there a way to do that? Or should I make a feature request for a future version?

/ Joachim Johansson

My test site: http://joachim.se/cpg/index.php?theme=jockes

Paver

I'm not exactly sure what navigation bar you mean.  I'm guessing you mean the arrows to move forward and backward in an album since you mention "next".  The tooltips or floating text for these arrows is already language compatible (as I just tested on your site), so you basically want to replace the arrows with "next" and "previous" I assume?

The arrows are a display feature that can be customized in your theme.  The sample theme has all the variables & functions you can customize.  Look at sample/theme.php for what you want to customize, copy it to your theme (which should not be a core theme but rather a copy if you are currently using a core theme), then modify as desired.

In this case, searching for "next.gif" (which is the arrow image seen on the webpage), shows you that $template_img_navbar is the variable to modify.  If you search for $template_img_navbar, you'll see that the function that processes this template variable is theme_html_img_nav_menu().  Looking in this function, you can see that there are tags for the previous and next text but they are hardcoded as the English words 'prev' and 'next':
'{PREV_IMAGE}' => ($lang_text_dir=='ltr') ? 'prev' : 'next',
'{NEXT_IMAGE}' => ($lang_text_dir=='ltr') ? 'next' : 'prev',

If you look at the other tags around it, you see that the language-compatible array $lang_img_nav_bar is used for the other tags.

So, there's your task.  Replace the <img> tags in $template_img_navbar with {PREV_IMAGE} and {NEXT_IMAGE}, then modify the processing in theme_html_img_nav_menu() to use the language-compatible array $lang_img_nav_bar, creating new entries named something like 'prev_image' and 'next_image'.  Then add into each of the language files you want to support the entries and the appropriate language-specific text.

In the end, you have customized your theme and the only core files you have modified are language files whose modifications are easy to track since they only contain a list of variable assignments.  It's highly recommended that you add comments into your modified language files with your initials or some other unique text (not used elsewhere in the file) so you can easily find those mods when you upgrade to future Coppermine versions (and when you have to re-apply those mods).

We (the devs) might consider moving those hardcoded English tags into the language files, but for now, that's how I would do it.

dwo

Insert "/ HTML template for the image navigation bar" into your theme.php and edit this part:

// HTML template for the image navigation bar

                <td align="center" valign="middle" class="navmenu" width="48">
                        <a href="{PREV_TGT}">&lt;</a>
                </td>
                <td align="center" valign="middle" class="navmenu" width="100%">
                        {PIC_POS}
                </td>
                <td align="center" valign="middle" class="navmenu" width="48">
                        <a href="{NEXT_TGT}">&gt;</a>
                </td>
        </tr>  </table>

EOT;
}  //{THEMES}



This shows you   < 1/20 >  , if you edit the variable 'pic_pos' in the language file accordingly.


And for style, edit in style.css .navmenu a and .navmenu a hover

reagrds, dietmar