News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Next SMF (2.1+)

Started by Shane74340Plus, May 21, 2012, 07:07:57 PM

Previous topic - Next topic

Shane74340Plus

The major thing I see with WordPress is its easy-to-customize code. I'm hoping SMF adopts something like it for the next SMF. (2.1+)
All I need to do to move the menu was to move a 5 line code snippet and the menu was moved.

I think the "issue" with SMF is the way SMF outputs everything. SMF uses the echo statement like its gold while WordPress uses plain HTML and PHP.

Just a thought to throw around.

Arantor

WordPress's pages are also *much* simpler and don't have complex permissions to contend with, nor do they have to contend with the possibility of multiple themes the way SMF does. In WP, for example, you only have one basic layout as far as content goes (since pages and posts are handled through the exact same code)

You can move the menu in SMF by moving a one line snippet, though it's not always clear if it'll work (and the same is true of WP, based on the customisations I've done for people over the years!)
Holder of controversial views, all of which my own.


Shane74340Plus

Thanks for the information / explanation.

I'm gonna leave this open for discussion though.

Arantor

I would note that this has been discussed, multiple times in the last few years and the discussions always end the same way, WP is much more simplistic as a system than SMF is and it cannot cope with the complexity of layouts, or for that matter internationalisation, done that way.
Holder of controversial views, all of which my own.


Matthew K.

SMF's code is easy to customize, it uses an MVC which keeps things very well organized.

What do you mean by "plain HTML and PHP"? echo is PHP...and SMF also uses 'plain' HTML and PHP. Well, actually XHTML.

And Arantor is right, you can move the menu in one line. (template_menu();)

Arantor

A WP template is basically a HTML page. A demonstrative (but not accurate) example would be:

<html>
<head><title><?php the_title(); ?></title></head>
<body>
<?php while(in_the_loop()) { ?>
<div>
  <h3><?php post_title(); ?></h3>
  <?php post_content(); ?>
</div>
<?php ?>
</body>
</html>


This gives you great customisation but it can't cope with complex intermixes of content (like in SMF). Oh, and it's a security issue, too.
Holder of controversial views, all of which my own.


IchBin™

Escaping back and forth like that in PHP drives me bonkers. lol I think it makes the code look very ugly. Just my $.02.
IchBin™        TinyPortal

Matthew K.

Meh, not only is it ugly, but it's not as efficient to write imo.

emanuele

It depends.
With such kind of style you don't have to deal with escape single/double quotes for example, you just put the block in and that's all.

When I'm giving support and I see someone that doesn't grasp the escape concept I start suggesting this kind of coding style (well in fact I did it only a couple of times... :P).


Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

Zagdul

Quote from: IchBin™ on May 22, 2012, 09:43:34 PM
Escaping back and forth like that in PHP drives me bonkers. lol I think it makes the code look very ugly. Just my $.02.

Yeah, however SMF's current template system is far more complex than it needs to be. Part of the issue with it's development I feel is that it as a content management and forum system, it's far more clunky than other solutions out there.

Don't get me wrong, I like SMF and have been using it for years. However, it's one software I've always been afraid to update solely on the fact that it's mod system requires so many file writes that my entire site would break for 'security' improvements.

I think that whatever SMF's future is, I hope that it takes better advantage of a more modular template system that is more intuitive. This will allow for designers to not need to know/understand php and just focus on creating beautiful sites. It would make documentation simpler and more legible for the weekend coder to write plugins that interface. As it stands, a lot of simplification can be done to make Simple Machines, more... simple.

Antechinus

TBH I've never found updating to be a problem, unless you're talking about running a beta or RC (which require a full update pack, etc). If you're running one of the stable versions then 99 (or at least 95) times out of 100 an update patch wont cause any issues. If it does cause an issue, usually it's only a minor one which is easily fixed. This applies even if the site is running quite a few mods too.

live627

@Omalina: taking about theming?

Matthew K.

Sounds to me like he is indeed talking about theming. I do agree that more of the template pieces could have either their own files or functions to make theming and even modding the themes easier, although theme hooks could take care of a lot of that, too.

live627

Consolidating several templates will help TREMENDOUSLY in that regard.

Arantor

I'm not sure it will, actually. One of the biggest problems with doing that is custom themes end up replacing a lot more than they need to.

Breaking templates up into smaller pieces and having them assembled as necessary afterwards would make life a lot easier.
Holder of controversial views, all of which my own.


Antechinus

TBH I'm inclined to agree with consolidation. Having them split into more and more pieces just makes things harder to find. I'd rather see fewer templates with better commenting. 

Arantor

It's a tough call to balance. More templates in pieces means you can do extensions and so on with *far* less effort. On the other hand, it's marginally easier to restyle when you have to deal with replacing the entire template because you don't have any ability to replace a part of it and only have to replace the entire thing.

* Arantor has deal with this a little too much, and is not just talking hypothetically about having templates being split up and made more modular.
Holder of controversial views, all of which my own.


Antechinus

Oh don't worry, I've had to deal with templates too. :D

Arantor

Yes, I know you have. But I've actually worked with restructuring all the templates so that they're so much more modular and can be individually replaced or restyled without having to worry so much about the *entire* template being replaced.
Holder of controversial views, all of which my own.


Ricky.

to OP, smf is not that bad at all even in current state, yes some times modification really needs to modify a lots of things and files but thats nothing to worry about for a common user but with hooks things are changing.
WP is lot different than SMF and I need to mention here, even though WP looks easy to customize, it goes wanky on resources if you do some modification and even install few plugins as that ease of modification creates lots room for unoptimized codes being inserted.

Advertisement: