Advertisement:

Author Topic: Creating and understanding themes.  (Read 86769 times)

Offline [Unknown]

  • SMF Friend
  • SMF Master
  • *
  • Posts: 36,102
  • Gender: Male
Creating and understanding themes.
« on: November 27, 2003, 05:20:50 AM »
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]
« Last Edit: November 28, 2003, 08:18:38 PM by [Unknown] »

Offline [Unknown]

  • SMF Friend
  • SMF Master
  • *
  • Posts: 36,102
  • Gender: Male
Re: Creating and understanding themes.
« Reply #1 on: November 28, 2003, 08:53:09 PM »
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]
« Last Edit: March 13, 2004, 07:30:15 PM by [Unknown] »

Offline thekiller

  • Newbie
  • *
  • Posts: 2
Re: Creating and understanding themes.
« Reply #2 on: April 11, 2005, 07:53:49 AM »
how can i upload style from my pc to my smf

Offline [Unknown]

  • SMF Friend
  • SMF Master
  • *
  • Posts: 36,102
  • Gender: Male
Re: Creating and understanding themes.
« Reply #3 on: April 11, 2005, 10:29:48 AM »
There's a box to install from a file... but that's not really anything to do with this topic.

-[Unknown]

Offline CapriSkye

  • Full Member
  • ***
  • Posts: 574
    • Open
Re: Creating and understanding themes.
« Reply #4 on: May 02, 2005, 04:27:03 AM »
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

Offline [Unknown]

  • SMF Friend
  • SMF Master
  • *
  • Posts: 36,102
  • Gender: Male
Re: Creating and understanding themes.
« Reply #5 on: May 02, 2005, 02:23:42 PM »
Yes.

-[Unknown]

Offline smack

  • Semi-Newbie
  • *
  • Posts: 48
  • Gender: Male
    • Air Warrior Online
Re: Creating and understanding themes.
« Reply #6 on: May 25, 2005, 09:57:15 PM »
I have a question about
Code: [Select]
<div id="myid">HTML Here.</div>
Can the forum be created with only style sheet and no tables?...

Offline [Unknown]

  • SMF Friend
  • SMF Master
  • *
  • Posts: 36,102
  • Gender: Male
Re: Creating and understanding themes.
« Reply #7 on: May 25, 2005, 11:18:24 PM »
It could.  You can use whatever HTML you like.

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

-[Unknown]

Offline Logue

  • Semi-Newbie
  • *
  • Posts: 37
  • Gender: Male
    • Epilogue/LogueWiki
Re: Creating and understanding themes.
« Reply #8 on: May 30, 2005, 02:48:39 AM »
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.

Offline [Unknown]

  • SMF Friend
  • SMF Master
  • *
  • Posts: 36,102
  • Gender: Male
Re: Creating and understanding themes.
« Reply #9 on: June 03, 2005, 02:49:45 AM »
Then just do it based on $txt['lang_locale']...?

-[Unknown]

Offline Logue

  • Semi-Newbie
  • *
  • Posts: 37
  • Gender: Male
    • Epilogue/LogueWiki
Re: Creating and understanding themes.
« Reply #10 on: June 26, 2005, 05:33:07 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.

Offline spirulez

  • Semi-Newbie
  • *
  • Posts: 61
Re: Creating and understanding themes.
« Reply #11 on: July 11, 2005, 11:46:48 AM »
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

Offline [Unknown]

  • SMF Friend
  • SMF Master
  • *
  • Posts: 36,102
  • Gender: Male
Re: Creating and understanding themes.
« Reply #12 on: July 13, 2005, 03:51:49 PM »
It may be, when that version is closer to final.  That or another list will be made.

-[Unknown]

Offline Rennyn

  • Newbie
  • *
  • Posts: 2
Re: Creating and understanding themes.
« Reply #13 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?

Offline xenovanis

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 12,988
  • Gender: Female
Re: Creating and understanding themes.
« Reply #14 on: September 01, 2005, 02:09:56 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."

Offline Ivan Milanez Castellanos

  • Newbie
  • *
  • Posts: 6
  • Gender: Male
    • Mis albumes de fotos
Re: Creating and understanding themes.
« Reply #15 on: November 21, 2005, 03:20:59 PM »
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 ---   |
+--------------------------+

Offline Comm

  • Newbie
  • *
  • Posts: 8
Re: Creating and understanding themes.
« Reply #16 on: December 25, 2005, 12:10:35 AM »
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

Offline Sheepy

  • Full Member
  • ***
  • Posts: 418
  • -=~ Love ~=-
    • Sheepy's SMF Mod board
Re: Creating and understanding themes.
« Reply #17 on: April 01, 2006, 07:42:57 PM »
Perhaps this topic is better moved to the new shiny Theme board.  Coders in general are not famous for their template designing skills.

Offline jsea1680

  • Newbie
  • *
  • Posts: 4
Re: Creating and understanding themes.
« Reply #18 on: October 04, 2006, 07:03:06 PM »
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 john_seabeck@yahoo.com

Thanks!

Offline GhostWalker

  • Jr. Member
  • **
  • Posts: 162
Re: Creating and understanding themes.
« Reply #19 on: February 24, 2007, 12:13:35 AM »
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?