I'm just starting on SMF, TP and PHP in general. And I'm loving every minute of it! I feel that I should have devoted my time in learning the scripting language instead of wasting five years of my life programming in ASP.
Anyway, I now understand that theming in TP is accomplished not only thru CSS but thru code (.php files on theme folders) as well. Pls. correct me if I'm wrong.
I've managed to set-up the front page layout I prefer and chose to display only articles by using this setting:
TinyPortal / Settings / Front Page / What to show on front page: Only articles
Got some questions though:
1. I'm trying to style the article titles and noticed that though there is a <div> tag, no id is specified. I want to put an id tag on it so I could style it in the CSS. I thought of editing the source code so I could put the id tag. What .php file should I edit? index.template.php? What line pls?
2. Same goes on the Article display page... I also want to style the article title. What .php file should I edit?
My last question is more SMF-related and should be asked in the SMF support boards but it's a quick question though and I thought that someone here might know the answer.
3. After replying to a topic, a user is taken to the topic list. If I want the user to be taken to the topic page after posting a reply, what parameter should I set?
TIA
Theming is done almost completely with CSS. Some coding is responsible for the look and feel, but if you want to change the way that it looks, you are going to have to edit the CSS.
If you want to make your own, make a copy of another theme (Default is probably best) in the Admin Panel.
You can then edit it so that it looks that way you want.
To change the way that the articles are styled, click "Source" up at the top.
This will bring you to the HTML source for the article, which is entirely editable by you.
The last option is set in the Settings section of the Control panel. I believe it is under Posting and Topics, but I'm too lazy to double check right now. :P
Quote from: adrktemplar on May 04, 2007, 05:55:37 PM
1. I'm trying to style the article titles and noticed that though there is a <div> tag, no id is specified. I want to put an id tag on it so I could style it in the CSS. I thought of editing the source code so I could put the id tag. What .php file should I edit? index.template.php? What line pls?
2. Same goes on the Article display page... I also want to style the article title. What .php file should I edit?
Article code is (mostly) found in TPortal.template.php, that should point you to the css style to edit.
Quote from: ïÃ'â€Ã'•Ã'â€"dÃ'â€Ã¸Ã'‚ Ã,,¢Ã'â€Ã'â€Ã,,·â„¢ on May 04, 2007, 06:28:52 PM
Theming is done almost completely with CSS. Some coding is responsible for the look and feel, but if you want to change the way that it looks, you are going to have to edit the CSS.
I agree. However, I noticed some <div> tags don't have class or id elements so can't do anything to style it unless I edit the code and put class elements on said <div>s and style it in the CSS file. I even noticed some <div>s with fixed style element, e.g., <div style="padding: 0px 6px 0px 6px;">, making it un-styleable (if that's a word? :)).
Quote from: nokonium on May 04, 2007, 06:32:15 PM
Article code is (mostly) found in TPortal.template.php, that should point you to the css style to edit.
Thanks for leading me to the right direction. Didn't know I should look in those files. :o Thought I just need to look at the theme folder.
Now I'm able style the article title and body. 8) I edited lines 165 and 188. I even used the strip_tags() function to remove the bold tags that wrap the article title.
Just curious... I've noticed there are several div tags with no id or class elements and got fixed style elements. Will these "unclassed" divs get love on the next release?
They inherit the style of whatever they are part of. You only set a <div> new style if you want to change it.