Modify Buttons / Links - top of Page - part 3 Modify Buttons / Links - top of Page - part 3
 

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

Modify Buttons / Links - top of Page - part 3

Started by CrestoneCreations, July 28, 2010, 02:52:08 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

CrestoneCreations

Gallery:
http://seawolfadventures.net/photoscpg/index.php

As following from
http://forum.coppermine-gallery.net/index.php/topic,66279.0.html

Wondering how to change the URL of "Contact" to point to http://seawolfadventures.net/contact/index.html
instead of towards   contact.php
I have found the line of code   
       
Code:
'{CONTACT_TGT}' => "contact.php?referer=$REFERER",
in themes/sample/themes.php
and I suppose I need to change that to
       
Code:
'{CONTACT_TGT}' => "http://seawolfadventures.net/contact/index.html?referer=$REFERER",
somehow putting that into my themes/rainy_day/themes.php

but my attempts have rendered my board inoperative ... backup file inserted back and all is fine again ...

Thanks again.  Much appreciated

Joe Carver

To change a function/action/output from your theme you would be well advised to start reading your document package.

If there is one line that you want to add/change then you need to copy the complete function or template.

For example:
** Section <<<theme_main_menu>>> - START
has menu button designations.
Copy the complete function into your custom theme's theme.php. Then make your change.

CrestoneCreations

Thank you Joe.  Yes, if you read the threads I reference you may be able to tell that I have indeed spent several days reading documentation and only AFTER reading that documentation and trying and failing did I seek help here on the forum.  As I mention in the referenced threads, the backend is not my strength, but I am happy to learn, and so I thank you for your help and appreciate the suggestions for those of us less code savvy who are interested in using Coppermine and making it work for us  :)

Thank you for pointing me in the right direction.  I have tried it and it worked.
There were many sections that all look the same to me, but now with your support I have had success.
Have a nice day.


CrestoneCreations

For the benefit of those like myself who need it spelled out in basic terms ...
- what is being referenced above is copy of a bit of code from
yourgallery/themes/sample/theme.php
to your custom theme.

So, further spelled out, the steps I have taken for success are as follows:

1. Custom Theme ==> create one by duplicating the theme files (for me that is the rainy_day theme which I copied with the name rainy_day_01)

2. Get Code ==> from yourgallery/themes/sample/theme.php 
copy the bit of code that begins with


/******************************************************************************
** Section <<<theme_main_menu>>> - START
******************************************************************************/


and ends with

/******************************************************************************
** Section <<<theme_main_menu>>> - END
******************************************************************************/


and paste that into your custom theme.
for me that is:

yourgallery/themes/rainy_day_01/theme.php

I pasted just before the

?>

at the end of the file.


3. for my case, to modify the target URL of the "Contact" button:

in yourgallery/themes/rainy_day_01/theme.php I modified the line

        '{CONTACT_TGT}' => "contact.php",

with the target URL I needed
http://seawolfadventures.net/contact/index.html
instead of "contact.php"

        '{CONTACT_TGT}' => "http://seawolfadventures.net/contact/index.html",



4. Activate the theme ==> Logged in as admin I selected the rainy_day_01 theme.

Done.

If things go wrong then of course you can replace the clean copy of
rainy_day/theme.php
with
rainy_day_01/theme.php

Hope this helps and hopefully I have represented all my steps correctly.  I'm happy to clarify for others if asked.
Now that I see this example it makes sense in the documentation, so please don't take this as a criticism of the documentation but rather just an example implementation of it.

I thank all on the forum who helped me learn this.




phill104

Thanks for your input. I am sure many will find this usefull.
It is a mistake to think you can solve any major problems just with potatoes.

CrestoneCreations

My pleasure.  Maybe as I learn more I will have a future on the team providing "support for beginners"   ;D