Mysidia Project - A new Look

Forum
Last Post
Threads / Messages
Status
Not open for further replies.
Thanks! I've also posted a couple of threads with information like this one with some questions I'd like answered and a second with stuff I'd like to be able to do with the proposed new template system.

All feedback is welcome!
 
Oh that's so cool, new template system? Actually I am considering using Smarty for Mys v1.3.3 and onward, so it may be a good starting point?
 
I see. Hows your experience with Smarty so far? Converting old template system into Smarty template system should be easy, although you may encounter some issues using smarty's Smarty::assign() method if you aint quite familiar with OOP.

Theoretically three .tpl files should be sufficient for this script, one for the main theme, one for ACP theme, and another for the install wizard theme. Of course custom themes may define their own .tpl files, so the number may vary if we include old themes such as Green and Elements in official package.
 
I figured we could set a main .tpl with different sections defined by sub .tpls. I'll take a look at other systems with a similar setup first though.

Although, this seems promising: http://www.smarty.net/inheritance

layout.tpl
PHP:
<html>
<head>
  <title>{block name=title}Default Page Title{/block}</title>
</head>
<body>
{block name=body}{/block}
</body>
</html>
mypage.tpl
PHP:
{extends file="layout.tpl"}
{block name=title}My Page Title{/block}
{block name=body}My HTML Page Body goes here{/block}
output of mypage.tpl
PHP:
<html>
<head>
  <title>My Page Title</title>
</head>
<body>
My HTML Page Body goes here
</body>
</html>

Instead of managing our page layout in several files (header.tpl, footer.tpl, etc.), we now manage it in one cohesive template (layout.tpl), and define the changeable blocks of content with {block ...} tags. Now you can simply extend the layout.tpl (which basically copies it) and then customize any of the defined block elements. You can have any number of child templates chained together, thus the concept of inheritance.
 
Last edited:
I see, this sounds like a good idea to me. This way all custom templates can extend a main .tpl file and define their own header and body with less code.
 
Yep. ;3

I'll keep researching it. ;3 After all my bug brought home an "I wasn't all that good at school" slip today. It's a boring night for her. Maths, and Words, and things like that.
 
Anyone Want to Join?
I'm looking for helpers and aspiring coders to join up. I'll even provide hosting for your mods that need external files.

You can give feedback on projects that I'm working on as well. I won't post all of them here now. ;3
 
Last edited:
I will register too, it looks really good so far. Would you please activate my account for me? Thx. XD

Perhaps we should write a brief tutorial on how to use the new template system for the public someday, since they definitely need to know how to do it once we apply Smarty in this script.
 
Oh great, I will check it out tonight. I've been quite busy recently, but it is all over now. One of my busiest classes just ended, and the other classes aint gonna keep my away. XD
 
Slowly, I got a new position at work (set schedule) and lace of interwebs have made it tough to get anything done. Right now I plan on working on it some more...
 
Status
Not open for further replies.

Similar threads

Users who are viewing this thread

  • Forum Contains New Posts
  • Forum Contains No New Posts

Forum statistics

Threads
4,277
Messages
33,119
Members
1,602
Latest member
BerrieMilk
BETA

Latest Threads

Latest Posts

Top