Not signed in (Sign In)

Categories

Vanilla 1.1.5 is a product of Lussumo. More Information: Documentation, Community Support.

Help keep Vanilla free:
Welcome Guest!
Want to take part in these discussions? If you have an account, sign in now.
If you don't have an account, apply for one now.
    • CommentAuthorJotango
    • CommentTimeMar 1st 2007 edited
     # 1
    Hello,

    we would like to integrate Vanilla with our site. One thing we discovered during our analysis is that Vanilla doesn't separate between style and content. The template files contain php and html code, some functions return html code as well. This makes skinning Vanilla very difficult.

    We, as a company, would like to transform Vanilla to use a templating engine, e.g. Smarty (http://smarty.php.net). We would like our changes to be merged back in to the code, so everyone profits fro our work. We would completely rebuild the default templates to use Smarty, separating code, content and style (we won't change the style). In a second step we would build a new skin for us, which we might also provide to the community.

    Does this sound interesting for the project as a whole, or are we better off doing an internal fork?

    Thanks

    Jan
  1.  # 2
    I think Mark has certain issues with smarty templating (due to speed, from what I can remember), but I've a feeling lack of time on his behalf is also a bit of an issue. There are certainly community members who would be quite pleased to see smarty implemented though, so I'm wondering if it'd be possible to run both side by side. In any case I'd say Mark was the main guy to talk to about this especially if you wanted it properly merging into the core package. Might be worth dropping him an email incase he doesnt get time to swing by here himself...
    •  
      CommentAuthorDinoboff
    • CommentTimeMar 1st 2007
     # 3
    Could this just be a new them for vanilla?
    Maybe there would be some problems with the delegations.
    • CommentAuthoriternity
    • CommentTimeMar 1st 2007
     # 4
    Thats a great idea.
    • CommentAuthoriternity
    • CommentTimeMar 1st 2007
     # 5
    I hope mark gives this idea a chance. The smarty engine is really great and as mark would not have to do all the work it sounds really good.
    •  
      CommentAuthor[-Stash-]
    • CommentTimeMar 1st 2007
     # 6
    I'd like to hear Marks comments on this, but if someone else is doing all the work and it doesn't impact on him much, I don't see a reason not to do this. After all, Vanilla is GPL licensed is it not?
  2.  # 7
    Oh sure they could release their copy but that wouldnt be much use unless they kept it updated along side Marks. And i'm sure he'd still atleast be interested to know how the project goes etc...
    •  
      CommentAuthorVincent
    • CommentTimeMar 1st 2007 edited
     # 8
    This project was started long ago by Jazzman, so i would see what he was up to in making his own type of theming machine.

    Other than the speed issues with this project, i would also worry about this becoming so popular that people are going to want it to be ported to the core like many other software packages have. I don't know about Mark, but this would be a great loss to Vanilla because it would slow it right down. My advice is that you would insert a single include() function for a replacement file in each of the theme file and then base the theming engine/files in a different directory. With that way used, you could use it as an extension that doesn't even touch the core of Vanilla, and all that the license would cover in the global vanilla theme that you would alter.
    •  
      CommentAuthorMax_B
    • CommentTimeMar 1st 2007
     # 9
    As Jotango stated in his opening comment, the problem cannot be solved by extension/theming paradigm. There are more than few places where the core generate part of the markup, and sometimes element (i.e. form) are split between core and theme.
    I had some bad time figuring this out myself. And when I made my own theme the split markup broke my own markup generation framework (my dynamics pages themes are built from php objects, not by <?php echo ' ?>' ).
    Mark, if you read, don't take it harsh, if you ever read my own code you'd find some flaws for sure…

    PHP inside theme doesn't sound too bad to me as it is often the more efficient way do deal with, if this php deal with rendering, but markup in the core does, indeed.

    I know nothing about smarty and performance cost it would implies. But a true markup separation is definitely a step ahead.
    •  
      CommentAuthorMark
    • CommentTimeMar 1st 2007
     # 10
    I'm totally open to this. I say do it and we'll see about getting it into subversion either as a branch or into the core.

    As for keeping it in the core release, it all depends on how the integration is done. If the core functionality/extensibility isn't harmed or damaged, and the naming conventions are followed (consistency is key), I'm all for it.

    This is good timing as I'll be releasing Vanilla 1.1 right away and they can feel free to get their hands dirty.
    • CommentAuthorLooZ^
    • CommentTimeMar 9th 2007
     # 11
    How it's going?
    • CommentAuthorLooZ^
    • CommentTimeMar 20th 2007
     # 12
    Still nothing? ;(
    • CommentAuthorfrooyo
    • CommentTimeOct 7th 2007
     # 13
    Any word on how converting Vanilla over to using Smarty templates is coming along?
    •  
      CommentAuthorwaynem80
    • CommentTimeOct 7th 2007 edited
     # 14
    I think this would be great, since i'm having to chop up vanilla to fit certain templates of my own. Because of what you had mentioned.

    wayne
    • CommentAuthorfrooyo
    • CommentTimeOct 7th 2007
     # 15
    I would also love to see Vanilla migrated over to some type of templating system (Smarty etc.) to remove the mixture of application logic (PHP) and presentation (HTML).
    •  
      CommentAuthorDinoboff
    • CommentTimeOct 7th 2007 edited
     # 16
    With smarty that would be still a mixture of smarty syntax and HTML.

    The php part should be more readable though.
    • CommentAuthorfrooyo
    • CommentTimeOct 7th 2007
     # 17
    @Dinoboff

    >> "With smarty that would be still a mixture of smarty syntax and HTML."

    That's true, though it would start separating out much more the logic from presentation.

    Also, it would make Vanilla *much* easier to customize from the interface perspective. Right now, if you want to customize the interface you have to dig through PHP files looking for HTML being "echo" out. :(
    •  
      CommentAuthorDinoboff
    • CommentTimeOct 11th 2007 edited
     # 18
    Would it be better like that (e.g. people_apply_form_nopostback:<?php
    // Note: This file is included from the library/People/People.Control.ApplyForm.php class.
    $TermsOfServiceUrl = $this->Context->Configuration['WEB_ROOT'] . 'termsofservice.php';
    ?>
    <div class="About">
    <?php echo $this->Context->GetDefinition('AboutMembership'); ?>
    <p><a href="<?php echo GetUrl($this->Context->Configuration, $this->Context->SelfUrl); ?>"><?php echo $this->Context->GetDefinition('BackToSignInForm'); ?></a></p>
    </div>
    <div id="Form" class="ApplyForm">
    <fieldset>
    <legend><?php echo $this->Context->GetDefinition('MembershipApplicationForm'); ?></legend>
    <p><?php echo $this->Context->GetDefinition('AllFieldsRequired'); ?></p>

    <?php
    $this->CallDelegate('PreWarningsRender');
    $this->Render_Warnings();
    $this->Render_PostBackForm($this->FormName);
    ?>

    <ul>
    <?php $this->CallDelegate('PreInputsRender'); ?>
    <li>
    <label for="txtEmail"><?php echo $this->Context->GetDefinition('EmailAddress'); ?></label>
    <input id="txtEmail" type="text" name="Email" value="<?php echo $this->Applicant->Email; ?>" class="Input" maxlength="160" />
    </li>
    <li>
    <label for="txtUsername"><?php echo $this->Context->GetDefinition('Username'); ?></label>
    <input id="txtUsername" type="text" name="Name" value="<?php echo $this->Applicant->Name; ?>" class="Input" maxlength="20" />
    </li>
    <li>
    <label for="txtNewPassword"><?php echo $this->Context->GetDefinition('Password'); ?></label>
    <input id="txtNewPassword" type="password" name="NewPassword" value="<?php echo $this->Applicant->NewPassword; ?>" class="Input" />
    </li>
    <li>
    <label for="txtConfirmPassword"><?php echo $this->Context->GetDefinition('PasswordAgain'); ?></label>
    <input id="txtConfirmPassword" type="password" name="ConfirmPassword" value="<?php echo $this->Applicant->ConfirmPassword; ?>" class="Input" />
    </li><?php
    $this->CallDelegate('PostInputsRender');
    $this->CallDelegate('PreTermsCheckRender');
    ?>

    <li id="TermsOfServiceCheckBox">
    <?php echo GetBasicCheckBox('AgreeToTerms', 1, $this->Applicant->AgreeToTerms,' id="AgreeToTerms"'); ?>

    <label for="AgreeToTerms" style="display: inline; float: none; width: auto;"><?php
    echo str_replace(
    '//1',
    ' <a href="' . $TermsOfServiceUrl . '" '
    . 'onclick="PopTermsOfService(\'' . $TermsOfServiceUrl . '\'); return false;">'
    . $this->Context->GetDefinition('TermsOfService') . '</a>',
    $this->Context->GetDefinition('IHaveReadAndAgreeTo')
    );
    ?></label>
    </li>
    </ul>
    <div class="Submit">
    <input type="submit" name="btnApply" value="<?php echo $this->Context->GetDefinition('Proceed'); ?>" class="Button" />
    </div>
    </form>
    </fieldset>
    </div>
    •  
      CommentAuthorMark
    • CommentTimeOct 11th 2007
     # 19
    I've halted all work on Vanilla 1 while others (lussumo.com/bugs) are taking it on and moving it forward.

    I'm still at the drawing board for Vanilla 2, and smarty is definitely something I'm considering. The only reason I might not use it is because I want to keep Vanilla2 small, and smarty has a lot of stuff that I don't think I'll need. So I may end up making my own version of smarty and using that.
  3.  # 20
    perhaps u can look at phptemplate. used in drupal
    http://drupal.org/node/11810

    will u be using ur own framework or are u considering Zend Framework.

    one thing is for sure. you use smart people will complain how slow and bloated it is, and php developers now have to learn another syntax.
    you don't use smarty people will complain you didn't use smarty cause its so simple

    either way be prepared to be flamed. :)

    OH make it Php 5.2 and Mysql 4 as minimum
    http://www.gophp5.org/
    •  
      CommentAuthorMax_B
    • CommentTimeOct 12th 2007
     # 21
    Mark, please, have a closer look at my HoP library.
    It's small and more powerful than smarty. I'd love to have it used in Vanilla2.
    At first glance it's not obvious to see all the benefits of the concept, but it's truly there.
    •  
      CommentAuthorMark
    • CommentTimeOct 12th 2007
     # 22
    I've looked at the zend framework, and it is definitely awesome. It does just about everything that I want to be able to do in Vanilla2. But it is absolutely massive and I don't believe that it was created with a product like Vanilla in mind. More likely it was created to ease development of projects that most people never see the source for (ie. a single website that is not distributed). One of the things about Vanilla2 is that I want it to be small (smaller than Vanilla 1), and that won't happen with zend. Less is most definitely more - with Vanilla.

    Max - I will certainly take a look at HoP when I get into development :)
    •  
      CommentAuthorMax_B
    • CommentTimeOct 12th 2007 edited
     # 23
    About Zend: I'm using it in my own web designs and one useful thing to know is: you does NOT need to include all the framework. If you want to use only parts of it, say caching, session handling and translation, you can only include those parts in you distribution.

    BTW (off topic), translation scheme in Zend gives the best of gettext, without the hassle (server dependency). It's also compatible with php arrays.
  4.  # 24
    I always thought vanilla is vanilla cause it doesn't have bloat in terms of feature. cause if size is what matters than punbb (120k) is vanilla

    just looked at the folder sizes of zend framework
    excluding Locale, Gdata, PDF, Service and Measure stuff, rest of the stuff compressed to 792kb

    to compress it further than 792kb
    Take out Oracle and DB2 support from the DB Component
    Components like Feed,MIME, json and XMLRPC can be via addons so u can exclude them from core as well.
    If you go through, i'm sure you can remove lot of other stuff we don't need and get it real small

    plus point is free promotion of vanilla by Zend, who knows you might even be called to give a speech at PHP conferences, all expense paid by zend avcourse :)
    • CommentAuthorfrooyo
    • CommentTimeOct 14th 2007
     # 25
    Any timeframe (e.g. weeks, months, half a year) as to when Vanilla 2.0 with Smarty support will be released?
  5.  # 26
    Couple of years I'd guess.
    •  
      CommentAuthoradrian.
    • CommentTimeOct 17th 2007
     # 27
    I'm gonna have a crack at this next week.

    has anyone else made any progress?
    • CommentAuthorfrooyo
    • CommentTimeOct 30th 2007
     # 28
    @adrian

    How's porting Vanilla over to Smarty coming along?
    • CommentAuthorfrooyo
    • CommentTimeNov 9th 2007
     # 29
    (bump)
  6.  # 30
    I'm gonna step in and say boo to using Smarty.

    Vanilla has already separated presentation logic from core functionality; all a developer has to do is edit the themes/* files. And what's more: a developer only needs to copy files that are changed from the default theme. This method is ideal because it keeps the filesystem clean and makes theme maintenance even easier. It's this same streamlined templating system that originally drew me to Vanilla. By adding another layer in between the core and the presentation logic is going to cause completely unnecessary overhead on every new page request.

    Smarty is great for static pages (ie: blogs) because of its caching abilities, but there's no place for it in an application as dynamic as a forum.</rant>

    Whatever solution is used, I believe it should remain small, both in terms of files on the system, and overall file size; and it needs to be fast.
    • CommentAuthorfrooyo
    • CommentTimeJan 3rd 2008
     # 31
    @sirlancelot

    >> "Vanilla has already separated presentation logic from core functionality; all a developer has to do is edit the themes/* "

    You're kidding right. Have you ever looked at the source code? Because if you have, you'll see statements like this:

    $var1 = func(1,2,3);
    echo "<div class='xyz'>$variable
    ...

    All over the place
    • CommentAuthorfrooyo
    • CommentTimeJan 3rd 2008
     # 32
    Using "echo" to in middle of code to output HTML/CSS is NOT the way to "separate" code from presentation.

    What you're talking about to modifying the css theme, and nothing more.
    •  
      CommentAuthorklip
    • CommentTimeJan 4th 2008
     # 33
    also Smarty's caching system produces php files, not html files
    Cache is made of smarty code interpreted into php code.
    It is not Smarty code cached to html.
    The cache is there to reduce the time frame used by the template engine only.

    I just think that Vanilla should allow to add template engines by add-ons. So everybody can choose which one is best for him. Also it might be nice if you can have different themes using different engines for different users. So if some design theme requires Smarty, it uses Smarty add-on, if some design theme requires some other engine, it would use that one. And you can have two users at the same time using different theme and engine. If somebody want to have small install, he can just not use template engine add-ons.
  7.  # 34
    @frooyo,

    Like I said, all the presentation logic is nicely tucked in the themes/ folder. A quick search for 'echo' in the library/ yields that only a few 'echo' statements are left, most of them for error messages. The only file that uses echo heavily is library/Framework/Framework.Class.AsyncUploader.php which isn't even used in the default installation of Vanilla. Give me one example of where an 'echo' (or any presentational function) statement is used in non-presentational code (not in the themes/ folder). If not all of the presentational elements have been cleaned out of the Vanilla library, they are probably in the pipeline for refactoring.

    All Smarty will do is simply replace the PHP logic in the themes/* files with Smarty logic, requiring those files to go through another interpreter (Smarty parser) to convert it to PHP, only after that is it then processed by the PHP parser and then sent to the browser. Pretty convoluted if you ask me.

    For those that argue Smarty is good for caching, I don't see much benefit when applied to a dynamic application like Vanilla. Ideally, in Vanilla, the only way to really speed it up is to cache database result sets (query results), and introduce a cache manager that deletes cache files when they become outdated.
    • CommentAuthorfrooyo
    • CommentTimeJan 13th 2008 edited
     # 35
    Forums are NOT dynamic.

    They are static. The only time when they are "dynamic" is when someone adds a new post. For effective caching - all that needs to be done is write the entire site out to HTML and only on new/updated comments, rewrite those pages.

    That's how caching *should* be done since then you have the web server serving up static .html pages, which it's crazy fast at doing.
Add your comments
    Username Password
  • Format comments as