Show
Ignore:
Timestamp:
09/25/08 17:54:17 (14 months ago)
Author:
bsmith
Message:

adding example to docs

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/lib/MT/Template/ContextHandlers.pm

    r3054 r3062  
    632632 
    633633Processes the input string for any MT template tags and returns the output. 
     634 
     635B<Example:> 
     636 
     6371. Add the `mteval` attribute to the <mt:PageBody> and <mt:PageMore> tags  
     638in your Page archive template so these tags... 
     639 
     640    <$mt:PageBody$> 
     641    <$mt:PageMore$> 
     642 
     643...become: 
     644 
     645    <$mt:PageBody mteval="1"$> 
     646    <$mt:PageMore mteval="1"$> 
     647 
     6482. Create a page and place the following code within the body of the page.  
     649Yes, you read that correctly, put MT tags into the body of a new page. 
     650 
     651    <p>Latest 3 entries are...</p> 
     652    <ul> 
     653        <mt:Entries lastn="3"> 
     654            <li><$mt:EntryTitle$></li> 
     655        </mt:Entries> 
     656    </ul> 
     657 
     6583. Publish the page and view the result! 
     659 
     660B<Note:> When a new entry is created MT will not know to republish this page,  
     661so this is kind of a bad example... but it shows how the feature works. It's  
     662also bad practice because you should separate the code and the content of the  
     663site otherwise some user will eventually tinker with it and break it... but  
     664then they'll call you and PayPal you butloads of cash to fix it... so I guess  
     665it's not that bad. 
    634666 
    635667=cut