Topic: Adding a facebook 'F' logo link [SOLVED]

I would like to add a link to my facebook fanpage in the form of an 'F' logo as the last menu item, for example:

HOME  ABOUT  GALLERY CONTACT 'F'

I guess that I will need to place a HTML string (a href, img etc...) which I know how to do but I would like to know which showkase file to open and where to edit.

Re: Adding a facebook 'F' logo link [SOLVED]

If you just want to add a link to your Showkase menu (without any further custom code such as an <img> tag), then this can be done within the Showkase interface by creating a new 'Navigation Link' page.
The new navigation link will appear in the menu at the top of all your Showkase pages but there will be no actual Showkase page associated with this link within your site.

If you want to manually add a link to your Showkase menu (which you would need to do if you want to add an image to the link), then you would need to edit each and every one of your Showkase pages. Showkase creates static and complete HTML pages (it does not produce a separate and individual menu file which is included via server-side scripting into all your pages). Also, please bear in mind that any manual modifications will be lost if you update the pages within the Showkase interface.

Each Showkase page has its own folder in the root Showkase directory.
For example, if your Showkase directory is named 'showkase' and you create a page named 'Page Number One', then the page on your web server that you would need to edit would be 'showkase/page-number-one/index.html'.
If you open the page in a plain text editor, search for your existing menu entries and you should find where to add a new one with your own custom code.

Re: Adding a facebook 'F' logo link [SOLVED]

Thank you for the reply. I am thinking of a possible solution.

Whenever I add a page I press the 'publish' button. I assume that this enables some sort of script which creates all the static pages and menus. Is there a possibility to hack this script and force it to add a fixed html string after the menus are created. This way I would only need to modify a single php or js file and have the logo/link created automatically on all my pages...

Sounds reasonable but I don't know where to look for it. _showkase, _smarty, admin, _data??? there are many folders which I would have to browse so it's easier to ask and maybe you will point me to the right file.

Re: Adding a facebook 'F' logo link [SOLVED]

If you want Showkase to add a custom link at the end of your menu on every page each time the 'Publish' button is clicked, you would need to to open the 'showkase/admin/classes/nav.php' file in a plain text editor, scroll down to line 177 and just before the return $navDom; line, construct the HTML you require within a <li> tag using PHP DOM techniques and append your custom DOM element(s) to the $navRoot variable.
For example, if you wanted to insert a link which displays the text 'Click Here' and directs the user's browser to the URL http://www.example.com/index.html, then you could use the following code:

$customLi = $navDom->createElement('li');
$customA = $navDom->createElement('a');
$customA->setAttribute('href', 'http://www.example.com/index.html');
$customText = $navDom->createTextNode('Click Here');
$customA->appendChild($customText);            
$customLi->appendChild($customA);
$navRoot->appendChild($customLi);

Please note that the source code of Showkase was not intended to be modified by users in such a manner and I do not know what (if any) knock-on effects this may have.
More information on using the PHP DomDocument class can be found here.
I hope this helps.

Re: Adding a facebook 'F' logo link [SOLVED]

I am aware that messing with this part of the code could cause some trouble but so far I have tried the code you provided and it works flawlessly. I am willing to take risks. But this code is only for text links, which showkase already does without hacking. How should I modify the code to insert a small jpg or gif icon instead of a text link. The DOM stuff is too complicated for me and my wife says that I must have a facebook icon. I shouldn't argue with your wife, should I?

Re: Adding a facebook 'F' logo link [SOLVED]

If you want to use an image link (instead of a text link), try something like the following. Make sure the path to your Facebook logo image is correct.

$customLi = $navDom->createElement('li');
$customA = $navDom->createElement('a');
$customA->setAttribute('href', 'http://www.example.com/index.html');
$customImg = $navDom->createElement('img');
$customImg->setAttribute('src', '/facebook.png');
$customImg->setAttribute('width', '50');
$customImg->setAttribute('height', '50');
$customImg->setAttribute('alt', 'logo');
$customA->appendChild($customImg);
$customLi->appendChild($customA);
$navRoot->appendChild($customLi);

Re: Adding a facebook 'F' logo link [SOLVED]

Thanks a lot for helping me.

I have modified the image dimensions to match the png file and it works like a charm. I have also added the following code:

$customA->setAttribute('target', '_blank');

It was written by means of deduction and it works OK, the link opens in a new window.

That's what I like about Showkase... Simple, static, not cluttered, but when you need a custom modification, there's someone to help you.

Thanks once again. Problem solved.