SimplePortal

Customization => Themes and Graphics => Topic started by: sikkens1997 on March 06, 2011, 09:50:43 AM

Title: SimplePortal 2.3.3 || SMF 1.1.13 || Can I add a picture in the navigation bar?
Post by: sikkens1997 on March 06, 2011, 09:50:43 AM
I want to add a picture in the vavigation bar, like this:

[PIC]Home [PIC]Forums etc..

Is this possible, yes? How?

Thanks in advance
Title: Re: SimplePortal 2.3.3 || SMF 1.1.13 || Can I add a picture in the navigation bar?
Post by: Old Fossil on March 06, 2011, 05:54:52 PM
You would be better to ask at sm.org rather than here.

Even better still is the search function.
Title: Re: SimplePortal 2.3.3 || SMF 1.1.13 || Can I add a picture in the navigation bar?
Post by: AngelinaBelle on March 07, 2011, 11:13:17 AM
Brack is correct that you might get more and better advice on this at SimpleMachines.org.
He is also correct that you might turn up a lot of good ideas with a search at SimpleMachines.org.
 
The short answer is yes -- you can do that. In SMF 1.1.X, you do this by customizing your theme.
It's all done in index.template.php. Search for [home]. That's where all the buttons are defined.
Title: Re: SimplePortal 2.3.3 || SMF 1.1.13 || Can I add a picture in the navigation bar?
Post by: sikkens1997 on March 07, 2011, 12:07:22 PM
Could you tell me how to do it?
Title: Re: SimplePortal 2.3.3 || SMF 1.1.13 || Can I add a picture in the navigation bar?
Post by: AngelinaBelle on March 07, 2011, 12:18:41 PM
Sure. I don't know which theme you are using, or what images you want to put in. But I can give you general instructions you can apply to putting any image in any button for most SMF 1.1.x themes.
1) Find where the text of the button appears. In most themes, this is done with a $txt string.
2) Before that $txt string, put in the HTML for the image you want to appear.
 
To learn more about the HTML needed to show an image on a webpage, please read http://w3schools.com/html/html_images.asp (http://w3schools.com/html/html_images.asp) or any other tutorial on HTML images.  To do this, you don't need to know much about php.  Just keep the HTML inside the single-quote delimited string. For more on string literals in php, please see http://w3schools.com/php/php_string.asp (http://w3schools.com/php/php_string.asp).
 
Good Luck!
 
I'm moving this topic to themes and graphics.
Title: Re: SimplePortal 2.3.3 || SMF 1.1.13 || Can I add a picture in the navigation bar?
Post by: Old Fossil on March 07, 2011, 12:27:26 PM
Unfortunately the mod linked here is for the 2.0 version.

It is unknown if there is a 1.1.x version.

http://custom.simplemachines.org/mods/index.php?mod=2857
Title: Re: SimplePortal 2.3.3 || SMF 1.1.13 || Can I add a picture in the navigation bar?
Post by: AngelinaBelle on March 07, 2011, 01:39:04 PM
Oh! That's a nice one.
 
sikkens1997 -- if I were in your shoes, I think I might just wait until the right time to come up to 2.0 (Final should be out quite soon) and then just install that mod.
 
 
Title: Re: SimplePortal 2.3.3 || SMF 1.1.13 || Can I add a picture in the navigation bar?
Post by: sikkens1997 on March 08, 2011, 10:13:00 AM
Thanks, but I really need it for 1.1.13.  :dead:
Title: Re: SimplePortal 2.3.3 || SMF 1.1.13 || Can I add a picture in the navigation bar?
Post by: AngelinaBelle on March 09, 2011, 09:02:40 AM
You will not die if you cannot get it right away.


On the other hand, this is not too terribly difficult to do.
Please have a look at index.template.php.  Find where all the button HTML is getting written out by looking for [help]. I chose this example because it is the simplest.


Suppose you have a help icon you want to use.
Suppose it is called "help_icon.jpg", and is in your theme's images directory.
Then you could find where the word "Help" is slapped on the button and add your icon there.


Code: [Select]
<a href="', $scripturl, '?action=help">' , $txt[119] , '</a>So what you want to do is add an image
Code: [Select]
<a href="', $scripturl, '?action=help">', $settings['images_url'], '/help_icon.jpg' , $txt[119] , '</a>

You could handle all the rest of your buttons in exactly the same way.
Title: Re: SimplePortal 2.3.3 || SMF 1.1.13 || Can I add a picture in the navigation bar?
Post by: sikkens1997 on March 09, 2011, 02:27:21 PM
You will not die if you cannot get it right away.


On the other hand, this is not too terribly difficult to do.
Please have a look at index.template.php.  Find where all the button HTML is getting written out by looking for [help]. I chose this example because it is the simplest.


Suppose you have a help icon you want to use.
Suppose it is called "help_icon.jpg", and is in your theme's images directory.
Then you could find where the word "Help" is slapped on the button and add your icon there.


Code: [Select]
<a href="', $scripturl, '?action=help">' , $txt[119] , '</a>So what you want to do is add an image
Code: [Select]
<a href="', $scripturl, '?action=help">', $settings['images_url'], '/help_icon.jpg' , $txt[119] , '</a>

You could handle all the rest of your buttons in exactly the same way.

There was a problem loading the /Themes/BlackRainV2_11112/index.template.php template or language file. Please check the syntax and try again - remember, single quotes (') often have to be escaped with a slash (\). To see more specific error information from PHP, try accessing the file directly.
Title: Re: SimplePortal 2.3.3 || SMF 1.1.13 || Can I add a picture in the navigation bar?
Post by: AngelinaBelle on March 09, 2011, 02:50:52 PM
This means that, somewhere in there, you have made a syntax error.
Maybe I even included a syntax error in my example.


When you fix that, it will work.
If  you like, you may attach your index.template.php


You are doing this on a test forum, or at least a test theme, right?


Title: Re: SimplePortal 2.3.3 || SMF 1.1.13 || Can I add a picture in the navigation bar?
Post by: sikkens1997 on March 10, 2011, 10:54:54 AM
No. This is my 100% seriously setup site.
I will try again, since I know the error was not because of that. I'll make a copy first now  :-[
Title: Re: SimplePortal 2.3.3 || SMF 1.1.13 || Can I add a picture in the navigation bar?
Post by: sikkens1997 on March 10, 2011, 11:05:04 AM
Still getting that stupid error.

Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ',' or ';' in .../Themes/BlackRainV2_11112/index.template.php on line 485

That's the line of the Help button i edited.
Title: Re: SimplePortal 2.3.3 || SMF 1.1.13 || Can I add a picture in the navigation bar?
Post by: AngelinaBelle on March 10, 2011, 02:26:53 PM
Please attach  the file.
Title: Re: SimplePortal 2.3.3 || SMF 1.1.13 || Can I add a picture in the navigation bar?
Post by: sikkens1997 on March 11, 2011, 10:24:01 AM
Here is it.
I want to add this picture before 'Home' button:  home.png
Title: Re: SimplePortal 2.3.3 || SMF 1.1.13 || Can I add a picture in the navigation bar?
Post by: sikkens1997 on March 14, 2011, 11:33:50 AM
HELP!!
Title: Re: SimplePortal 2.3.3 || SMF 1.1.13 || Can I add a picture in the navigation bar?
Post by: AngelinaBelle on March 14, 2011, 02:59:47 PM
Please attach the file you have attempted to change. the file you attached, line 485 is the "donate" button.


Whereas the home button, on line 482 is
Code: [Select]
echo '<ul><li', $current_action == 'home' ? ' id="active"' : '', '><a href="', $scripturl, '"><span>'.$txt[103].'</span></a></li>';


This does not look like you have added any code about an image.
Title: Re: SimplePortal 2.3.3 || SMF 1.1.13 || Can I add a picture in the navigation bar?
Post by: sikkens1997 on March 14, 2011, 03:29:06 PM
Can you please do it in the [home] button for me? It has a other code.
Title: Re: SimplePortal 2.3.3 || SMF 1.1.13 || Can I add a picture in the navigation bar?
Post by: AngelinaBelle on March 15, 2011, 08:08:58 AM
You said that you tried this, but had an error. Can you please attach the file that has an error?


Thanks
Title: Re: SimplePortal 2.3.3 || SMF 1.1.13 || Can I add a picture in the navigation bar?
Post by: sikkens1997 on March 15, 2011, 10:07:53 AM
I don't have the file anymore. I removed it, and I don't have a [help] button anymore aswell,
so you you please demonstrate for me in the attached file.
Title: Re: SimplePortal 2.3.3 || SMF 1.1.13 || Can I add a picture in the navigation bar?
Post by: AngelinaBelle on March 18, 2011, 07:27:29 AM
Do you want the [help] button to be gone?
Title: Re: SimplePortal 2.3.3 || SMF 1.1.13 || Can I add a picture in the navigation bar?
Post by: sikkens1997 on March 18, 2011, 02:12:58 PM
Solved at SMF site.
Title: Re: SimplePortal 2.3.3 || SMF 1.1.13 || Can I add a picture in the navigation bar?
Post by: AngelinaBelle on March 18, 2011, 02:37:30 PM
They are great over there, aren't they?
SimplePortal 2.3.8 © 2008-2024, SimplePortal