Help - Search - Members - Calendar
Full Version: Question about MTEntriesExcerpt
Movable Type Community Forum > Additional Resources > Tips and Tricks
freshyill
I'm starting a new site, and on the main page, I don't want the entire story, just excerpts.  There will be a "featured article area" and then areas for other articles, and an entry might start out as a feature, and then move to one of the other spots, meaning it would need different layouts because they're different sizes...and then when you actually go to the story, it will have yet another layout.

Now, my question is this: what's the best way to handle this?  I was planning on using the entry body, the excerpt, and extended entry for these three different things.  is this possible?  it seems like it is, based on the documentation, but i figured i'd ask someone wiser in these matters.

I think this project might be a little ambitious, but I'm sure I can figure it out eventually.  You can take a look at what I've got so far at http://www.theblankeffect.com/test.shtml.  That will probably help explain it a little better.  Keep in mind that the only parts that actually "work" are the search and the feature article area.
Deane
This is the default setup of the main index template.  It shows the body of the entry, and the extended body is what you find when you click "Continue reading...".

You probably don't have to use the excerpt at all.  I haven't, and it's used mainly for over-riding the default excerpt on the RSS feed.

Now, the archive index pages will print the entire entry on the main page, including the extended body if the entry has one.  I didn't like this, so in those templates (date- and category-based), I just copied the tags from the main index so it would operate the same.

Basically, if an entry is "extended," I don't want all of it appearing on any page except its individual page.  The practices I've written about here will address this.

Deane

P.S. -- Your link was 404.
girlie
His link has been fixed.
freshyill
girlie:  thanks for the fix

Dean:  i see how that would be perfect if there was only one type of "preview" of the article, and i've changed it as you suggested, with MTEntryBody on the main page for the feature.  What would you suggest though, if i might want to format an "excerpt" for both the feature area and the other article areas?

http://www.theblankeffect.com/test.shtml
Deane
Oh, I see.  I don't really have an answer for that.  Each entry has one body and that's it.  You could use an MT-Meta or KeyValues plugin to provide different body values for other categories and archives, but that would get really tedious really quick.

What you're asking for is for a column on the mt_placement table where a placement-specific preview could be held.  I've done this in other systems, but I don't think it's possible in MT.

Deane
freshyill
Well I was thinking the category would determine placement.  If it appears in the feature area, it would get a secondary category of "feature," in addition to whatever the primary category would be.  the six areas below would each be for a different category, and have the offset be 1, so that something wouldn't appear as a feature and below at the same time.

hmmm...anybody?

http://www.theblankeffect.com/test.shtml
girlie
Unless I'm completely misunderstanding what you're trying to do, why not just initially assign the feature to a "Features" category and then the other articles to an "Articles" category?

You can then use <MTEntries category="Features" lastn="1"> to display the most recent featured entry at the top. Then do something similar to show entries from the Articles category below.

Then you can format each section accordingly, displaying only those parts you wish to display.

When a feature is no longer a Feature, change its category to Articles.
girlie
I guess I was writing at the same time you were.  ;)
freshyill
Yeah, we pretty much said the same thing there.  Here's a question that's probably dumb...MTEntriesExcerpt doesn't have to be an excerpt actually, does it?  Like, suppose I wanted an image where I have one now...I could just stick MTEntriesExcerpt there, and instead of an actual excerpt, the excerpt would just be an image?  right?
almuhajabah
Yes, you could stick the URL for an image there and then in your template have:

CODE
<MTEntries>
... other stuff here...
<img src="<$MTEntryExcerpt$>">
</MTEntries>


The MTEntryExcerpt does strip out HTML when it displays so you can't put the img tag itself in there, but you can store the URL no problem.

You can really use the fields to hold whatever data you want and then use a template to configure how that data will be displayed.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.