Search

Phrase

Display

 

Category

   

Order

 

Pagesize

Results

55 hits123

1. Automated Smarty Pagination

Don't Back Down, Tutorials, 16 KB, 1142 words

As mentioned previously, using Smarty for pagination isn't difficult. Of course, the simple example already given doesn't really do much - your users would still need to know about it, and manually construct the URL. That wouldn't be much fun. Using Smarty, we can do the work for them!

You'll need to start with a "total" count. I use MTCategoryCount, as I'm doing this on category archives. If you wanted to do a complete blog archive, you may want to use MTBlogEntryCount or something similar. You could also perform a similar process for comments with MTEntryCommentCount, trackbacks with MTEntryTrackbackCount, etc. {{capture...

continue reading ...

2. Smarty. MT. Dynamic

Movalog, Tutorials, 28 KB, 1017 words

Smarty Docs

Now that Smarty is built into MT, you've got a whole load of new features that you can use. Just have a look at the documentation everything discussed in those docs are available to MT users, the only difference is instead of single braces you need to use double, for example where in the Smarty docs it gives you a line like this {include file="sidebar.php"}

when you implement that into MT it will need to become {{include file="sidebar.php"}}

This was chosen over the single braces because the single braces can cause problems when you start writing Javascript. None-the-less if you really wish to use single braces, find in your mtview.php template the following line (thanks...

continue reading ...

3. Troubleshooting Smarty Errors

Learning Movable Type, Tutorials, 27 KB, 1605 words

This tutorial is written by LMT guest author Arvind Satyanarayan of Movalog. Tutorial cross posted on Movalog and Learning Movable Type

If you move from static publishing to dynamic publishing in Movable Type, you may encounter a variety of confusing error messages in Smarty, the system MT uses to create its dynamic pages. This tutorial will explore several of the errors you may experience, explain what they mean, and show you how to solve them. This is by no means a complete guide to every error you may experience; I will continue to add to this tutorial as I come by more of them.

The Basics

Many of the error messages you may see will take the format: Smarty Error: [in mt:##...

continue reading ...

4. Troubleshooting Smarty Errors

Movalog, Tutorials, 32 KB, 1577 words

Tutorial cross posted on Movalog and Learning Movable Type

If you move from static publishing to dynamic publishing in Movable Type, you may encounter a variety of confusing error messages in Smarty, the system MT uses to create its dynamic pages. This tutorial will explore several of the errors you may experience, explain what they mean, and show you how to solve them. This is by no means a complete guide to every error you may experience; I will continue to add to this tutorial as I come by more of them.

The Basics

Many of the error messages you may see will take the format: Smarty Error: [in mt:## line:##]

This error message provides useful information that can help you...

continue reading ...

5. Pagination Using Smarty

Don't Back Down, Tutorials, 8 KB, 348 words

As I mentioned yesterday, I'm now using Smarty to provide pagination in my category archives. The code is inserted directly into the template, and (apparently) when it rebuilds the template it parses that code prior to rendering the page. It's actually quite impressive. Thanks again to Brad, not only for giving me some sample code with which to play, but for showing me it is possible in the first place - I had no idea!

The first thing you need to do is set a Smarty variable with a value, and then you can use that value when creating the MTEntries container, using that variable to build the entries you need: {{assign var="offset" value="12"}} <MTEntries lastn="12"...

continue reading ...

6. True Smarty Pagination

Don't Back Down, Tutorials, 15 KB, 989 words

While my earlier example illustrated the concept of automating pagination with Smarty in your Movable Type archives, I had a couple of problems with it.

First and foremost was that if someone "hacked" the URL, to submit their own value for a start range, then the links wouldn't work right. They might start on entry number 2 instead of entry 1, and while the previous link would say 1-1 (itself a bit ugly), it would actually render entries starting with 1, but the page would biuld through the default limit or the end of the category, whichever came first.

So I played with adding a user-specified limit (with a maximum size). But it had the same problem, in that if someone specified a...

continue reading ...

7. Even More fun with Smarty

Don't Back Down, Tutorials, 10 KB, 393 words

One of the things that bothered me about the switch to dynamic archives is that I had to stop using the Compare plugin, since it doesn't support dynamic publishing (or didn't, at any rate). With the use of Smarty, you can very easily reproduce this functionality, and though I haven't done any benchmarks or anything, I suspect that the performance gains are dramatic.

For instance, I used to use something like this in my template to conditionally show text around comments: <MTIfEqual a="[MTEntryCommentCount]" b="0" numeric="1"> No comments yet! </MTIfEqual> <MTIfEqual a="[MTEntryCommentCount]" b="1" numeric="1"> 1 comment!...

continue reading ...

8. Smarty Crash Course

Six Apart ProNet Weblog, News, 13 KB, 80 words

Movable Type 3.1's new option for dynamic PHP pages makes use of the extremely popular Smarty template engine. If you're not familiar with Smarty yet, you might want to check out the Smarty crash course, which will help familiarize you with some of the basic concepts behidn the template system.

Trackbacks:

Previous Entry: MT Tabs, a quick reference for tags

Next Entry: Posting from Windows applications

continue reading ...

9. Alternating Comment Styles with Smarty

geekmum {movable cafe}, Tutorials, 19 KB, 513 words

So you want to create alternating background colors for your (dynamically published) comments? I just came across a sweet little *gem in Hacking Movable Type about Smarty's "cycle" function... worth the price of the book, IMO. But, I digress. :-)

If you are using dynamic publishing for your individual entry archives, you can very simply edit your template to create alternating comment background colors (or any alternating style) with Smarty's "cycle" function.

The "cycle" funtion will, as the name implies, cycle through a list of values each time it is used within a loop. This is a perfect little solution for the task at hand. An added bonus is that it can cycle through more than two...

continue reading ...

10. Smarty Category Filtering

Don't Back Down, Tutorials, 9 KB, 522 words

Until recently, I depended solely on the most excellent FilterCategories plugin to, well, filter my category list. For instance, on the archive page and on the software page, I present a subset of my entire category list. The latest hurdle in my static-to-dynamic conversion is dealing with the problem that this plugin doesn't work in a dynamic publishing environment.

I started with the software page. Incidentally, this page is now being published dynamically. It just took me a bit to get there.

To start my journey, I took an in-depth look at the MTCategories container within the PHP code. It turns out that this accepts a "label" parameter, designed to allow you to select one...

continue reading ...

11. Smarty Error On Dynamic Pages

Six Apart Knowledgebase, Manuals, 28 KB, 602 words

Question

When trying to view a page I have chosen to publish dynamically, I get a Smarty error.

Answer

Error message: plugin function smarty_function_MTSomeTag() not found in /path/to/mt/php/lib/function.MTSomeTag.php, where SomeTag is the name of a standard Movable Type Template Tag

Make sure the file (i.e., function.MTSomeTag.php) was uploaded to your server in ASCII mode, and that it is located in the php/lib/ folder in your Movable Type installation directory.

Error message: unrecognized tag MTSomeTag, where SomeTag is the name of a Plugin...

continue reading ...

12. Dynamic Publishing with Smarty

Don't Back Down, Tutorials, 7 KB, 286 words

Long day today. I've been trying to get dynamic publishing working, specifically with the category archives. Well, I think I'm finally there. Thanks to some of Brad's amazing Smarty-fu, a whole lot of testing and a fair number of insults hurled in the way of the server, my category templates are now dynamic.

Perhaps more importantly, they are now paginated as well. Visit any category page with more than 12 entries and you'll see what I mean. No more having the entire category archive on one page. Now you get to see a svelte 12 entries at a time, in their entirety (no more excerpts here).

Frankly, I'm very impressed. Not only because it works, but because that navigation piece was...

continue reading ...

13. PHP Dynamic Publishing: Developing Plugins

Six Apart Pronet Articles, Tutorials, 36 KB, 2180 words

Note: This tutorial was first published on October 29th for members of the Professional Network. If you'd like to get access to the benefits of membership in the network, sign up now.

Our last tutorial covering dynamic publishing provided a high-level technical overview of its implementation. In this tutorial, we will examine the way you create plugins for the PHP dynamic publishing model. It varies a bit from the Perl model, since we have built the template processing on top of Smarty, a popular and powerful templating engine for PHP.

Use the Source, Luke!

To get you started, there are a whole host of MT tags that have been ported from Perl to PHP. These would be the core...

continue reading ...

14. Dynamic Publishing: PHP Architecture Overview

Six Apart Pronet Articles, Tutorials, 30 KB, 2385 words

This is the first in a series of tutorials regarding the API for developing Movable Type plugins for the new PHP dynamic rendering engine.

This tutorial applies to the current release of MT, which is version 3.11. Subsequent 3.x releases should also be compatible (and releases beyond that, but I cannot say for sure).

PHP Dynamic Publishing Architecture

The first thing we should cover is the architecture behind it all. In terms of PHP scripts, the following shows the order of invocation from request to response. • HTTP request • .htaccess rule / error document • mtview.php • MT Class (MT.php) • MTViewer Class, aka Smarty (MTViewer.php) • PHP • HTTP response with output

Let's examine each stage of...

continue reading ...

15. Smart templating with Movable Type

Brad Choate, Tutorials, 75 KB, 2581 words

A little while ago I converted my site to use the Smarty for dynamic templating. I'm still using Movable Type for the content management though. Click the 'more' link for an overview of how it all works together...

Smart Templates

The Smarty template engine for PHP is pretty sweet. There's a lot of power in dynamic template rendering. The most important for me is that I can change the shape of my...

continue reading ...

16. PHP Dynamic Publishing: Architecture Overview

Six Apart ProNet Weblog, News, 38 KB, 2484 words

This is the first in a series of tutorials regarding the API for developing Movable Type plugins for the new PHP dynamic rendering engine.

This tutorial applies to the current release of MT, which is version 3.11. Subsequent 3.x releases should also be compatible (and releases beyond that, but I cannot say for sure).

PHP Dynamic Publishing Architecture

The first thing we should cover is the architecture behind it all. In terms of PHP scripts, the following shows the order of invocation from request to response. • HTTP request • .htaccess rule / error document • mtview.php • MT Class (MT.php) • MTViewer Class, aka Smarty (MTViewer.php) • PHP • HTTP response with output

Let's examine each stage of...

continue reading ...

17. Dynamic Publishing - Pros and Cons

Learning Movable Type, Tutorials, 27 KB, 1693 words

Discussion cross posted on Movalog and Learning Movable Type

One of the key features that Six Apart promotes about Movable Type is MT's ability to publish dynamically. What is dynamic publishing? And what are the benefits (and downsides) to dynamic publishing over static publishing?

Elise Bauer, editor of Learning Movable Type, and Arvind Satyanarayan, author of Movalog, discuss some of the pros and cons of dynamic publishing. Non-techie luddite-wannabe Elise shies away from anything that seems like it might not be worth the effort and so far hasn't even tried dynamic publishing. Plugin creator and MT hack-master Arvind has embraced dynamic publishing with his usual boundless...

continue reading ...

18. Dynamic Publishing - Pros and Cons

Movalog, Tutorials, 33 KB, 1633 words

Discussion cross posted on Movalog and Learning Movable Type

One of the key features that Six Apart promotes about Movable Type is MT's ability to publish dynamically. What is dynamic publishing? And what are the benefits (and downsides) to dynamic publishing over static publishing?

Elise Bauer, editor of Learning Movable Type and Arvind Satyanarayan, author of Movalog, discuss some of the pros and cons of dynamic publishing. Non-techie luddite-wannabe Elise shies away from anything that seems like it might not be worth the effort and so far hasn't even tried dynamic publishing. Plugin creator and MT hack-master Arvind has embraced dynamic publishing with his usual boundless...

continue reading ...

19. Movable Type 3.1

Movalog, News, 28 KB, 1222 words

After talking to Brad about the new version of MT, I felt it deserves a whole blog post about it just to talk about how amazing it is and get rid of all this excitement building up in me

First of, David's Subcats being built into the application. Well I knew it ! In #mt-plugins, David told me and a few others that he would not be entering his plugin into the contest - on further questioning he said that there was another party involved. Well once he said that it wasn't too hard to guess the right answer and we were helped by the fact that when he guessed it he either changed the topic or kept quiet ! Never-the-less I am very excited about this because Sub Categories are vital for many...

continue reading ...

20. How to Speed Up Publishing in Movable Type

Six Apart Pronet Articles, Tutorials, 22 KB, 2467 words

For those who aren't using the dynamic publishing feature of Movable Type (see below), experiencing slow rebuild times is not an infrequent complaint especially as the size or complexity of the blog and its templates grows. While there are very good reasons to rebuild, there are no good reasons for it to be painfully slow.

In this essay, we will detail a number of reasons why your rebuild times might be slow and steps you can take to drastically reduce or completely eliminate the time you spend waiting for Movable Type to finish its work.

Upgrade to Movable Type 3

Has anything significant happened to you in the 16 months? Probably so. Well, the same can be said for Movable...

continue reading ...

Comments

You want to post some comment? Please use the announcement post on the Movable Type Weblog.

If you want to give some feedback concerning a specific query, please use the feedback button that is shown after a search has completed.

mgs | September 27th 2005