Help understanding SMF and building a completely new look for a website

Started by Kiori, August 13, 2016, 02:24:03 PM

Previous topic - Next topic

Kiori

I'm using smf 2.0.11 and currently running a modified version of the free exodus theme, but I wanna create my own theme.

I wanted to make a website where every page will have the same header and that Header will cover the entire page width, the first page will contain a few 'articles', announcements, and some links to news and other important things.
Beyond other pages, the 'Forum' section of the website is where the index boards will be shown.

Now I'm aware that the templates system in smf allows for me to do that just fine.
I've read many of the docs, but i still have problems figuring out what all of the $variables do, and what they offer, where are they?
Where does smf store global variables? what about the [txt] array, I'm not sure i've fully understood how these things are structured.
So far i've been able to make minor modifications, and i even got an action added through integration hooks. But the catch is that the action doesn't appear in the navegation as an entry, like: forum_name >> action_name.
Don't know why, or how.
also, are actions the only way to add different pages?
How can i basically get out of the board index, so i have a completely independent, in terms of looks, but still connected, in terms of accounts, page.
I noticed that in this website, the main page is in the root directory, and the forum is under the community folder.

I need more info to implement all of that. So in short, how does the templating system fully work?(considering the mentioned points), and where can i learn about the internal(like the many variables), where they are and how to use them?

Any help is greatly appreciated!

glennmckenna

just use the ssi.php

it's a great file that will allow you to link certain things from the forum to your "outside" pages

http://wiki.simplemachines.org/smf/Category:SSI

Kindred

actually, it almost sounds like he would benefit from a portal mod...  or additonal pages.

look at http://www.askawitchcommunity.org - this uses EZPortal and has pages, other features, but uses the SMF theme framework.

or look at http://www.fx-sabers.com/forum - this has additional pages and features but no portal
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Antes

Template system is not that hard. If you want to create your theme from ground, I suggest using default theme as base. There you can learn all elements what controls what. All you need is template files.

Quote from: Kindred on August 13, 2016, 05:45:41 PM
actually, it almost sounds like he would benefit from a portal mod...  or additonal pages.

look at http://www.askawitchcommunity.org - this uses EZPortal and has pages, other features, but uses the SMF theme framework.

or look at http://www.fx-sabers.com/forum - this has additional pages and features but no portal


Update your responsive_curve mod. :P

Kiori

Thanks guys I think slowly i'm figuring out how to do what i want, however i'm still puzzled:
for instance : $context['user']['is_guest'], where do i find more about these variables?
Like is there a $context['user']['has_left_the_building']?  ;D
These global variables and their arrays have to be somewhere. I cant find them to know what is there and how to use them. It's like the subs, containing all the menu buttons... would have never guessed.

Antes

Those are the source part of the software, you need to visit Source folder to locate those variables.

Kindred

Well, you can see two of the big arrays by creating  file like this...


<?php
include('SSI.php');
echo 
'<hr />';
echo 
'<h2>$USER_INFO</h2>';
echo 
'<pre>'print_r($user_info); echo '</pre>';
echo 
'<hr />';
echo 
'<h2>$CONTEXT</h2>';
echo 
'<pre>'print_r($context); echo '</pre>';
?>




context is a tricky array though... because bits of context are available only on certain pages (the bits are added when needed for the content)  ---   you can always add the above print_r within a template as well -- although it will break the template layout, it will let you know when some new variables within the array have been defined

AFAIK, there is no single location that defines all variables used in SMF, across all templates.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Advertisement: