Jalokim
Manager
This is the first part of a series of quick beginner walkthroughs in the lovely world of template editing. Get a comfy pillow and prepare to learn. | Before we begin, I'll try to make this walkthrough as simple as possible and use some easy to understand examples. BUT ... all this information will be useless if you do not know anything about HTML or CSS. HTML and CSS is easy to learn and understand... and as webmasters on your forumotion boards its vital to know a thing or two about web languages ... especially if you have a template editing active board. I promise you, if you had basic HTML skills you'd be able to create all that I've done on ego-one yourselves! If you don't know what href is and how to link an image... I think there is no sense reading on. Come back later once you got the tools of the trade. Step1 : Use what ego has already offered Variables List I prepared a basic variables list for the index_body template a long while ago. It holds some of the key elements like for example, how to hide elements from guests or members. Take a moment to check the list and see what the variables look like and what they do. Step2 : Basic understanding of templates The templates may look scary at first... with their PHP like { fancy brackets } but the fact of the matter is that the templates where made available for the public so that normal grey users can customise it. There are 2 types of codes in general the bracket codes ... for example
for example
The comment codes come in pairs ... there will always be a < --BEGIN and a < --END . If you do not close these tags properly you will experience problems. In general all you need to know is already in the codes name... for example:
take a step back and think. switch user logged in. So switch item (div) for logged in users. The above code shows things for logged in members. Anything between the < begin and the < end part will be invisible to guests lets test it out! Go to your admin panel-> display-> templates -> general -> index_box (edit the template) at the very top before:
Save and publish your template. Refresh your forum and you'll see that at the top of your page, exactly above your forum crumbs1 you'll see your message. Lets try this for guests now. Go back to your template you just edited. and before the code you pasted just now paste this one:
Save and publish your template. Now check your forum ... log out and you will see that you'll see the OMG you are logged out text ... but you wont see the Hello registered user text. AS you can see the codes are easy to decipher. Use the variables list I provide to help you. The bracket code are identical to understand. These are the working codes... they do the stuff... the comment codes activate the bracket codes. for example we have this code:
As we know from basic HTML ... a href is a link. The link has to be in quotation marks \\\\"\\\\" now U_MARK_READ is the link to \\\\"mark all forums as read\\\\". Why does it have the brackets around it? Well since there are millions of forums it be hard to manually add everyones address into each link. So this is a PHP array. it is filled automatically with your personal http link to your site and its mark its forum read link. same goes for L_MARK_FORUMS_READ ... since there is a couple language versions on forumotion its easier to create a PHP array with a set definition of languages. depending on your forum language the PHP automatically picks the correct translation of mark your forums as read. Step3 : Everything is placed according to its order on the live forum What this means is WYSIWYG (what you see is what you get) The templates are ordered exactly as they appear on the forum itself. For example:
AS we can see U_INDEX is the link to your forum LOGO - is your forum banner MAIN_SITENAME -is your title DEscriptION - is your forums description GENERATED_NAV_BAR if you look at your forum you'll see that it has its logo with a link to your forum, and your site description and title. under it the navbar. Everything is in order. whats under the navbar? the crumbs then the forum body, then the who is online , then the footer. though the templates are split they will always be in order according to WYSIWYG. This concludes part1 of understanding templates. Use the variable codes and using HTML knowledge try to create some new areas... some visible only to guests others only to members. and stay tuned for more parts coming soon. ____________________________________________ 1 - crumbs = crumbs are a quick stacking navigation. example: Ego One - Pure | Fresh | First » Official » Forum1 |