ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

I love snippets! What do you love about EE 2.0?

December 03, 2009 4:32pm

Subscribe [9]
  • #1 / Dec 03, 2009 4:32pm

    Bjørn Børresen

    629 posts

    Snippets! Snippets! Snippets! (said in a Steve-Ballmer-“developers-developers-developers” kinda voice).

    Never again shall I {embed}. This feature is PROFOUND!!

    Now, what do you love about EE 2.0??

  • #2 / Dec 03, 2009 4:42pm

    lebisol

    2234 posts

    Being different than embded templates how?
    I actually don’t like the separation model from ‘templates’ and like the having them all in one place. What can I say I am ‘old school’ and like my “includes” folder 😊

    What I do like is in-place filtering of content as well as Accessories…if I only knew how to make them it would be nice place to stick extra ‘how to’ docs for clients or perhaps your own/developer contact/support info and links etc.

  • #3 / Dec 03, 2009 5:07pm

    Bjørn Børresen

    629 posts

    Being different than embded templates how?

    From the docs:

    Snippets can be considered to actually be part of the template that they are used on, with their expanded contents parsed simultaneous to other tags and variables on the template. Embedded templates are separate templates, with their own preferences (caching, PHP parsing, access, etc.), and are parsed individually. Put another way, embedded templates are not included in the parent template, but rather added to them after the fact, using a separate query and full page parsing resources for each template.

    One of the annoying thing about embed templates is that you need to pass all the variables as well, and that you have to reference them with {embed:myvariable} in the embedded template .. so if you have a lot of variables you’ll end up with {embed="site/header" a_variable="{a_variable}” and_another_one=”{and_another_one}” and_lets_continue_endlessly_shall_we=”{and_lets_continue_endlessly_shall_we}” etc… 😉

    if I only knew how to make them (..)

    That’s what the example accessories are for 😊

  • #4 / Dec 03, 2009 5:45pm

    lebisol

    2234 posts

    Thanks bjornbjorn,

    That’s what the example accessories are for 😊

    Well…barely got my hands on them, all I got now is ideas 😉

  • #5 / Dec 03, 2009 6:21pm

    Gareth Davies

    491 posts

    Am I missing something or is this just the Fresh Variable module being renamed and native? Nice and easy to use though.

  • #6 / Dec 03, 2009 6:56pm

    supercollidr

    5 posts

    How much of a hit would you say snippets put on building the page? Would throwing 15 or 20 snippets in there slow things down, or not at all?

  • #7 / Dec 03, 2009 8:38pm

    grrramps

    2219 posts

    How do you get a snippet from the list into the template?

  • #8 / Dec 04, 2009 7:27am

    Bjørn Børresen

    629 posts

    Snippets can be bundled with templates and automagically imported on install. You get a snippet into the template by using it’s name like a tag - f.ex. {my_snippet} .. about the overhead, I know it’s better than embeds, but it’s likely not the same as having a static template and duplicating the code everywhere .. but the pages are cached anyway so it should be good.

    but to get back on track; what do you love about EE 2.0?

  • #9 / Dec 04, 2009 8:49am

    Nora

    41 posts

    I absolutely love the way everything is organized, the drop-down menus, the ability to use the tab button in templates, the new file field feature, the new publish page and how it all makes it easier to update. Publishing is also a lot more pleasant in EE2.0.

  • #10 / Dec 04, 2009 1:54pm

    supercollidr

    5 posts

    Yup, the organization of the control panel as well as the use of JQuery adds quite a bit to the usability of the app. Also it may be just be me, but my site seems to zip along faster.

    EE2 = win!

  • #11 / Dec 30, 2009 8:14pm

    Jeremy Lee James

    50 posts

    Snippets can be bundled with templates and automagically imported on install.

    I’ve been really curious about this ability…is there documentation on how to properly package templates and snippets and possibly even global variables to get imported on install? I noticed the Agile Records example in the site_themes folder, but how can we, as designers, make our own themes?

  • #12 / Dec 30, 2009 8:52pm

    Peter Sommerfeld

    86 posts

    Snippets are very useful in a multi language setting or another environment with lots of custom fields. I use them everywhere, {customfield-{lang_code}} and I’m done. Embeds would be much more work and probably much slower due to parameter passing, access control and extra preferences.

    Unfortunately it is not possible to include another snippet within a snippet. :(

    What I dislike is the presentation of snippets and user defined globals in the CP. There is no way to group or filter a long list. But the organization (or should I say disorganization) of the CP is another issue…

  • #13 / Dec 30, 2009 9:48pm

    russlipton

    305 posts

    I love the integration of CodeIgniter. This is the great new feature of EE 2.0, even if invisible for now to end users. Rightly understood (no hype intended), 2.0/CI is the biggest ‘feature’ release of EE ever by far: no contest.

  • #14 / Dec 31, 2009 4:39am

    Bjørn Børresen

    629 posts

    Jeremy; I don’t know about documentation, but I’m currently working with Woothemes and converting their themes to EE 2.0, and I’ve basically just followed the example (the Agile theme). There’s a folder for snippets, and a folder for global variables. And there’s a default_content.php script that contains a bunch of SQL statements you might want to run. Also, note that this only works on fresh installs (so there’s currently no way of installing a theme in an existing EE installation). Give it a try, and if you run into any problems I’ll be happy to help you out.

    Peter; that use of snippets for multi-language is a great idea, hadn’t thought about that.

    russliption: agreed. it’s now possible to develop on EE and still stay sane 😊

  • #15 / Dec 31, 2009 4:57am

    Brendon Carr

    135 posts

    What I dislike is the presentation of snippets and user defined globals in the CP. There is no way to group or filter a long list. But the organization (or should I say disorganization) of the CP is another issue…

    I disagree somewhat with the folks praising the Control Panel. The EE 2.0 Control Panel remains a significant weakness of the product. Even though it’s much improved over EE 1.x, that by no means should be interpreted to mean the Control Panel and the organization of the program’s functions is anything that could be described as “good”. It’s just “better” than what we were stuck with before.

    EllisLab would do well to hire information architects to completely overhaul the Control Panel on an urgent basis, as the Drupal project is doing with its Drupal 7 User Experience (UX) project, and WordPress has done already. The WordPress interface is excellent, and can mislead evaluators into overlooking some of the other aspects of working with WordPress. ExpressionEngine is a very powerful tool ill-served by its current Control Panel, which will be compared to the Drupal 7, WordPress, and other interfaces. Since EE users pay good money for this software, we deserve a user experience that’s on par with the power of ExpressionEngine’s peerless templating engine.

    We also still need some kind of site-import and -export packaging feature to make it possible for developers to create and sell themes which can be installed on a turn-key basis.

    Now, as for what I like: Snippets really do make multi-language development significantly easier. It was a good thing to bring this feature into EE 2.0 and I’m sure that we’re going to discover many benefits.

    For Rick Ellis: I swear that I have not been drinking prior to posting this. However, as it is New Year’s Eve here in Korea, I am about to start.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases