Advanced search  

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]

Pages: [1]   Go Down

Author Topic: Adding Links: Categories Link in Menu  (Read 8081 times)

0 Members and 1 Guest are viewing this topic.

TopAuto

  • Coppermine newbie
  • Offline Offline
  • Posts: 5
Adding Links: Categories Link in Menu
« on: September 28, 2007, 12:08:56 am »

Hello  :)

As mentionned in the title I want to add categories links in the menu.

I read the "Adding Links" topic, but the trick in my case is that I want to use the links of the categories.

Well at this point some might say do it like this:

In /themes/gray_satin/theme.php:
Code: [Select]
// HTML template for sub_menu
$template_sub_menu = <<<EOT
<span class="topmenu">
<!-- BEGIN custom_link -->
<a href="{CUSTOM_LNK_TGT}" title="{CUSTOM_LNK_TITLE}">{CUSTOM_LNK_LNK}</a><br /><br />
<!-- END custom_link -->

<!-- BEGIN album_list -->
<a href="{ALB_LIST_TGT}" title="{ALB_LIST_TITLE}">{ALB_LIST_LNK}</a><br /><br />
<!-- END album_list -->

<!-- BEGIN MODIFICATION HERE : album_submenu -->
<a href="./index.php?cat=2" title="Go To Category 2">Category 2</a><br /><br />
<a href="./index.php?cat=3" title="Go To Category 3">Category 3</a><br /><br />
<a href="./index.php?cat=4" title="Go To Category 4">Category 4</a><br /><br />
<a href="./index.php?cat=5" title="Go To Category 5">Category 5</a><br /><br />
<!-- END MODIFICATION HERE : album_submenu -->

<a href="{LASTUP_TGT}">{LASTUP_LNK}</a><br /><br />
<a href="{LASTCOM_TGT}">{LASTCOM_LNK}</a><br /><br />
<a href="{TOPN_TGT}">{TOPN_LNK}</a><br /><br />
<a href="{TOPRATED_TGT}">{TOPRATED_LNK}</a><br /><br />
<a href="{FAV_TGT}">{FAV_LNK}</a><br /><br />
<a href="{SEARCH_TGT}">{SEARCH_LNK}</a>
</span>
EOT;

BUT, the problem here is that the language is not taken into account  :-[

THUS, I want to use if possible these variables : {CATEGORIES_TITLE} {CATEGORIES_LNK} {CATEGORY} {CAT_TITLE}
I don't know which one to use and especially HOW..

I didn't find any answer by searching in the forum and sorry if I missed it.

Could anyone help me?  ;D

Thank you!
« Last Edit: October 02, 2007, 07:24:03 am by GauGau »
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Adding Links: Categories Link in Menu
« Reply #1 on: September 28, 2007, 06:41:07 am »

Replace your hard-coded language with variables. In your case, replace
Code: [Select]
Go To Categorywith
Code: [Select]
{$lang_main_menu['go_to_category']}Then edit your language file(s), e.g. lang/english.php, find
Code: [Select]
$lang_main_menu = array(and edit the array definition below. Scroll to the end of the array definition, find
Code: [Select]
  'faq_lnk' => 'FAQ',and add below it (into a new line)
Code: [Select]
  'go_to_category' => 'Go to Category',. Do a similar thing for all language files that your users will be using.
Logged

TopAuto

  • Coppermine newbie
  • Offline Offline
  • Posts: 5
Re: Adding Links: Categories Link in Menu
« Reply #2 on: September 29, 2007, 04:41:47 am »


I was not clear enough (my fault sorry).

In fact, the things I am more interested in is about the links.

I want to replace:
Code: [Select]
href="./index.php?cat=2"
with something like:
Code: [Select]
href="{XXX_TGT}"
and I would like this for at least 5 categories.
So that is 5 different links leading each to one specific category.
But I don't know if Coppermine can assign a value (like cat=2; cat=3 etc.) for the variable "{XXX_TGT}".

It seems to be complicated  ;D ... so maybe it is not possible  :-[


PS: in my previous post, when I was talking about the language I was meaning that when I use the code:
Code: [Select]
href="./index.php?cat=2"it is fixed,
so the language is not taken into account like:
Code: [Select]
href="./index.php?cat=2&lang=french"or
Code: [Select]
href="./index.php?cat=2&lang=english"but I read something on the forum that if we set up Coppermine to Unicode utf-8, Coppermine detects automatically the language used by the computer;
so maybe I just need the link [href="./index.php?cat=2"] because the language will still be the one of the computer and not the one selected by default on Coppermine?

I am not sure to be clear enough again so let just me end with an exemple:
Imagine the user is spanish, but language by default is english. Normally he is supposed to see the website in spanish because Coppermine is set up to "Unicode utf-8"...but this I am not sure  ???
When he clicks on the link "Category 2" [href="./index.php?cat=2"]; would he see the page of the category 2 in english or in spanish?

Sorry for all this text, I am sure you have other things to do, but if you can help me I would appreciate it  ;D

Thank you!  :)
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Adding Links: Categories Link in Menu
« Reply #3 on: October 01, 2007, 08:49:54 am »

I have no idea what you're talking about.
Logged

TopAuto

  • Coppermine newbie
  • Offline Offline
  • Posts: 5
Re: Adding Links: Categories Link in Menu
« Reply #4 on: October 01, 2007, 07:25:41 pm »

lol!

Never mind, I'll work it out by myself.

Thanks anyway  ;)
Logged

anselmej

  • Coppermine newbie
  • Offline Offline
  • Posts: 11
Re: Adding Links: Categories Link in Menu
« Reply #5 on: November 04, 2008, 03:33:45 pm »

Hi !

I also don't understand very well
in my theme.php I have added

<a href="{LINK_TGT}" title="{LINK_TITLE}">{LINK_LNK}</a>

now if I go to the  languages pages and add at the end of $lang_main_menu = array
'link_title' => 'LINK: links page',
'link_lnk' => 'LINK',

I don't get it

I also cannot find where to add {LINK_TGT}

thank you for helping
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Logged
Pages: [1]   Go Up
 

Page created in 0.031 seconds with 15 queries.