Adding images to your theme: Difference between revisions From Online Manual

Jump to: navigation, search
((<div class=\"codeheader\">(Code)?\: <a href=\"javascript\:void\(0\);\" onclick=\"return smfSelectText\(this\);\" class=\"codeoperation\">(\[Select\])?</a></div><code[\s\S]*?>[\s\S]*?)([\s\S]*?)</code)
 
(5 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{Cleanup html}}
To give your [[Theme]] a unique look, you may need to modify/add your own graphics to it. The easiest way to add/modify your own graphics is by copying the images directory from the [[SMF default theme]] to your new theme. Once done you can modify or add graphics to (in order of directories):
To give your [[Theme]] a unique look, you may need to modify/add your own graphics to it. The easiest way to add/modify your own graphics is by copying the images folder from the [[Default theme]] to your new theme. Once done you can modify or add graphics to (in order of folders):


<ul class="bbc_list"><li type="disc">bbc: bulletin boards buttons which are used mainly in [[Post]] screens.
*'''bbc''' - bulletin boards buttons which are used mainly in [[Post]] screens.
</li><li type="disc">english: buttons used in forum's menu, [[Board index]] , message ..etc.
*'''english''' - buttons used in forum's menu, [[Board index]] , message ..etc.
</li><li type="disc">icons: icons used in various part of the forum.</li><li type="disc">post: icons used for posts.</li><li type="disc">topic: topics indication images. </li></ul>
*'''icons''' - icons used in various part of the forum.
*'''post''' - icons used for posts.
*'''topic''' - topics indication images.


Also the main folder (images) contains various images used in many places in your forum, such as your [[Theme]] thumbnail, messenger indicators, stars, etc.
Also the main directory (images) contains various images used in many places in your forum, such as your Theme thumbnail, messenger indicators, stars, etc.


You can call an image from your [[Theme]] by using:
You can call an image from your Theme by using:
{{code|1=&nbsp;&lt;img src=&quot;', $settings&#91;'images_url'], '/smflogo.gif&quot; alt=&quot;&quot; /&gt; }}
{{code|1=<nowiki><img src="', $settings['images_url'], '/smflogo.gif" alt="" /></nowiki>}}
where {{code|1=&nbsp;', $settings&#91;'images_url'], '}} points to your theme's images folder.
where {{code|1=<nowiki>', $settings['images_url'], '</nowiki>}} points to your theme's images directory.


or by using:
or by using:
{{code|1=&nbsp;&lt;img src=&quot;', $settings&#91;'images_url'], '/', $context&#91;'user']&#91;'language'],  
{{code|1=<nowiki><img src="', $settings['images_url'], '/', $context['user']['language'],  
'/userinfo.gif&quot; alt=&quot;&quot; /&gt;}}
'/userinfo.gif" alt="" /></nowiki>}}
Where {{code|1=&nbsp;', $settings&#91;'images_url'], '/', $context&#91;'user']&#91;'language'], '}} points to your theme's images/english folder, if English is selected as user default language. This will give you the possibility of making another directory for a different language. So, you can have buttons for English and Dutch for example.  
Where {{code|1=<nowiki>', $settings['images_url'], '/', $context['user']['language'], '</nowiki>}} points to your theme's images/english directory, if English is selected as user default language. This will give you the possibility of making another directory for a different language. So, you can have buttons for English and Dutch for example.  


'''Next:''' [[http://docs.simplemachines.org/index.php?topic=223|" class="bbc_link">This is confusing... I just want to change something simple!]]
[[Category:Developing SMF]]
 
[[Category:Customizing SMF]]
 
[[Category:SMF Themes]]
[[Category:Staging]]

Latest revision as of 17:23, 18 January 2014

To give your Theme a unique look, you may need to modify/add your own graphics to it. The easiest way to add/modify your own graphics is by copying the images directory from the SMF default theme to your new theme. Once done you can modify or add graphics to (in order of directories):

  • bbc - bulletin boards buttons which are used mainly in Post screens.
  • english - buttons used in forum's menu, Board index , message ..etc.
  • icons - icons used in various part of the forum.
  • post - icons used for posts.
  • topic - topics indication images.

Also the main directory (images) contains various images used in many places in your forum, such as your Theme thumbnail, messenger indicators, stars, etc.

You can call an image from your Theme by using:

<img src="', $settings['images_url'], '/smflogo.gif" alt="" />

where

', $settings['images_url'], '

points to your theme's images directory.

or by using:

<img src="', $settings['images_url'], '/', $context['user']['language'], 
'/userinfo.gif" alt="" />

Where

', $settings['images_url'], '/', $context['user']['language'], '

points to your theme's images/english directory, if English is selected as user default language. This will give you the possibility of making another directory for a different language. So, you can have buttons for English and Dutch for example.



Advertisement: