News:

Wondering if this will always be free?  See why free is better.

Main Menu

Creating and understanding themes.

Started by [Unknown], November 27, 2003, 05:20:50 AM

Previous topic - Next topic

[Unknown]

What is a theme?
»  A theme is the look and feel of the forum.  Themes can be switched between by users, and usually have their own html, css, javascript, and images.  Themes control virtually every visual aspect of SMF, allowing for easier customization.

What is the default theme?  What is it there for?
»  The "Default" theme is, actually, not the "default theme."  while SMF starts out with it as the theme, the "Default" theme is only a collection of the default templates.  That is, these templates are "fallbacks" incase the current theme does not have the template.

This is similar to URLs - if you don't specify a domain name, (ie. /style.css) it uses the default. (making it www.simplemachines.org/style.css)  In this case, it's a bit different, but the concept is the same.

I don't like or want the default theme - can't I just change it?
»  Well, you can do whatever you want but this isn't recommended for two reasons.  First off, some other theme might expect the old default template - and second, leaving the default templates alone makes upgrading easier.

Don't worry - you *can* make the default theme unselectable.

What's with all this template business?
»  A template is a collection of related sub templates.  Templates can be left out of a theme, as they will come from the default theme - but sub templates cannot.  The real question is, what is a sub template?

Okay, I'll bite.... what's a sub template?
»  I'm glad you asked.  A sub template is what actually has the html in it.  You can change, for example, the admin_login sub template to make the administrative password prompt look different.  You could change the error sub template to change what is displayed upon an error.

It's important to note that sub templates are grouped within templates.  The error sub template can be found in the Errors template, just as another example.

So where do I get to these templates and sub templates? *might change*
»  All the themes, by default, are stored in the Themes folder inside your forum installation directory.  Inside this should be a few directories, each corresponding to a different theme.  Inside one of these folders is a list of templates - for example, Errors.php.  If you open this file up, you should see that it has the sub templates inside it.

How can I change how things look? Which sub templates are which?
»  There should be a list below, but for most things you'll want to change the main layerLayers are groups of two sub templates that go above and below the next layer or the content.

By default, there's only one layer - the main layer.  It's two sub templates are main_above and main_below.

-[Unknown]

[Unknown]

#1
This is confusing.... I just want to change something simple!
»  Most of the sub templates are just HTML.  The only notable thing is that if you want to use an apostrophe, you must put a \ before it.  So, instead of putting "it's" in there, but "it\'s".

It's really not that hard, though.  Great pain has been taken to make the sub templates simple - and they just use PHP code.  You only need a basic understanding of PHP to understand them.
For a good tutorial on PHP, please see Parham's PHP Tutorials.

Well, I might be able to do some... but there's just so many files!! *might change*
»  You only need to modify the index.template.php template to affect most of the layout of your forum.  You can do this by going into the administration center and selecting "Theme and Layout Settings".  In there, click "Create New" in the upper right corner - then, click the "New Theme" you just created.  You should now see options to rename it, and the like - next, you'll want to click "Modify the index.php template".

Is there a list of templates? *has changed, needs rewriting*

  • BoardIndex - this is the board index.  That's the main page of the forum.
       Sub templates: main
  • Calendar - the calendar, and related sub templates.
       Sub templates: main, post, edit, link
  • Display - topic display - the posts themselves.
       Sub templates: main
  • Errors - error messages..
       Sub templates: error
  • Help - the help screen. (you know, the help button.)
       Sub templates: help_above, help_below, main
  • index - this is the stuff around the main content that goes on every page.
       Sub templates: main_above, main_below, menu, init
  • InstantMessage - instant message display, sending, etc.
       Sub templates: folder, send, ask_delete
  • Login - basic login, as well as maintenance login and admin verification.
       Sub templates: login, kick_guest, maintenance, admin_login
  • Memberlist - the memberlist, which can be viewed and searched.
       Sub templates: main, search
  • MessageIndex - the message index, or in other words boards.
       Sub templates: main
  • MoveTopic - moving a topic?
       Sub templates: main
  • Notify - confirmations for turning on/off notifications.  Seldom seen except via email.
       Sub templates: main, notify_board
  • Poll - poll editing...
       Sub templates: main
  • Post - posting a new topic, a reply, or something?
       Sub templates: main, spellcheck
  • Printpage - printing a topic.
       Sub templates: print_above, print_below, main
  • Profile - the profile, editing and viewing alike.
       Sub templates: profile_above, profile_below, summary, showPosts, trackUser, trackIP, account, personal, forumProfile, theme, notification, imprefs, deleteAccount, profile_save
  • Recent - recent posts, unread topics, and unread replies.
       Sub templates: main, unread, replies
  • Register - registration... before and after.
       Sub templates: before, after
  • Reminder - forgot your password?
       Sub templates: main, sent, set_password, ask
  • ReportToModerator - someone abusing the forum?
       Sub templates: main
  • Search - this is the main search screen and results.
       Sub templates: main, results
  • SendTopic - who're you going to send it to?
       Sub templates: main
  • Settings - theme settings and options.
       Sub templates: settings, options
  • SplitTopics - splitting and merging topics.
       Sub templates: ask, main, select, merge, merge_done, merge_extra_options
  • Stats - statistics about your forum.
       Sub templates: main
  • Who - who is online, and what're they doing?
       Sub templates: main
  • Wireless - wireless access via WAP, WAP 2, or i-mode.
       Sub templates: wml_above, wml_below, wml_boardindex, wml_messageindex, wml_display, wml_error, imode_above, imode_below, imode_boardindex, imode_messageindex, imode_display, imode_error, imode_post, imode_login, wap2_above, wap2_below, wap2_boardindex, wap2_messageindex, wap2_display, wap2_error, wap2_post, wap2_login

What is context?
»  Context is basically, well, the context of this page view.  In other words, it's what makes one view different from the next or last.  Maybe there are more or less boards... maybe someone posted a new topic... these are all things the template context can tell you.
The same context information isn't available everywhere.  For example, the list of boards you can move a topic to isn't there when you are editing your profile because that's illogical.

What is the difference between settings and options?
»  Settings are global for all users, while options are only for the current member.

These settings and options are also affected by the "default affect" - if there is a setting in the "default theme," it is used as the "fallback" for all other themes.

*more to come, please don't reply but instead start a new topic if you want to comment.*

-[Unknown]

thekiller

how can i upload style from my pc to my smf

[Unknown]

There's a box to install from a file... but that's not really anything to do with this topic.

-[Unknown]

CapriSkye

i have a question about BoardIndex and index templates
is stuff in index will show on every page the only difference? and BoardIndex is really the forum main page? thanks

[Unknown]


smack

I have a question about <div id="myid">HTML Here.</div>

Can the forum be created with only style sheet and no tables?...

[Unknown]

It could.  You can use whatever HTML you like.

Clearly, some things ARE tabular data, and SHOULD be in tables.

-[Unknown]

Logue

I'd like to specify an separate stylesheet with a displayd language.
like "style.english.css"

For example, Ariel set to the default is satisfactory when writing the alphabet etc., but since fonts, such as Japanese and Chinese etc, are not included, appearance will worsen.

[Unknown]

Then just do it based on $txt['lang_locale']...?

-[Unknown]

Logue

Quote from: [Unknown] on June 03, 2005, 02:49:45 AM
Then just do it based on $txt['lang_locale']...?

-[Unknown]
Yes,
In Macintosh version IE, priority was given to the font setting of the style sheet and Japanese was garbled.

spirulez

Quote from: [Unknown] on November 28, 2003, 08:53:09 PM
Is there a list of templates? *has changed, needs rewriting*
Hi

Will this list be rewritten for the new branch 1.1?
Do you undestrand something about SMF's variables? | Vous comprenez quelque chose aux variables sous SMF ?
Some help please? | Un peu d'aide svp ?
Thanks a lot | Merci beaucoup

[Unknown]

It may be, when that version is closer to final.  That or another list will be made.

-[Unknown]

Rennyn

I've downloaded and installed the Dark Red theme.. but now, my News Fader on the index page is wrong.. it fades in on the first news item... then switches to the next item to fade out on.. where can I fix this at, because it works fine in the 'default' template?

xenovanis

Quote from: Rennyn on September 01, 2005, 02:04:22 AM
I've downloaded and installed the Dark Red theme.. but now, my News Fader on the index page is wrong.. it fades in on the first news item... then switches to the next item to fade out on.. where can I fix this at, because it works fine in the 'default' template?

http://www.simplemachines.org/community/index.php?topic=43611.0

Please ask your questions in that thread.
"Insanity: doing the same thing over and over again and expecting different results."

Ivan Milanez Castellanos

So OK now I know what a template is so how can I add a sidebar menu to my theme I'm personalizing classic theme.

Classic Theme has side bar menu but only for administration and I want it to be there for every user although not with the same options.

Any help is much appreciated.
+--------------------------+
|La Inteligencia Artificial|
|   Jamas podrá competir   |
| con la Estupidez Natural |
|   --- Isaac Asimov ---   |
+--------------------------+

Comm

I wanted to install a Teamspeak Display page on my forum (hxxp:sourceforge.net/projects/tsdisplay/ [nonactive]) I wanted to make it look similar to looking at a calendar or the google member map page where the header and footer are still visible.

It, however, does not come with an installation guide for SMF. It comes with two PHP files, a .css file, and some images. I know that I will need to make my own source and template files but I'm not sure what to put where. I don't know if anyone else could help me integrate the display to make it look like a normal php page in the forum.

Thanks

Sheepy

Perhaps this topic is better moved to the new shiny Theme board.  Coders in general are not famous for their template designing skills.

jsea1680

GUYS, I am such a NOOB! I don't have a clue how to do this stuff! I created a website hxxp:www.unknownsoldierswow.com [nonactive] and don't know how to change themes, fonts, really anything. Is there a company or people I could pay to help me maintain website? Any help would be great. Can also be reached at [email protected]

Thanks!

GhostWalker

Did we ever get a break down on the CSS code??

I had a website before, and the help area showed step by step pictures of each area of the css file. is that available?

Advertisement: