default userpic

How to keep the format in excerpt that generated automatically

Vote 0 Votes

I just want to show the excerpt on my main page, I tried the ways addressed in this post, but it just doesn't work? Is there any of you building your blog with MT and only show excerpts on your main page? How did you do that? Could you share the tips with us?

Reported on Movable Type 4.3

13 Replies

| Add a Reply
  • Excerpt is just an unformatted text field. If that's not what you mean by "excerpt," roll your own.

    To show only the beginning of a post, use

    <$mt:EntryBody words="50"$>...

    or whatever value you like.

    The Movable Type Template Tags can be strung together in logical ways to display what you want.

  • Hi Baiyan,

    I've read that you've tried the solution I've provided at:

    http://forums.movabletype.org/2009/04/how-do-a-format-excerpts.html

    With the words parameter!

    Can you please provide me a direct link to your blog to study what's wrong in there?

    Maybe you don't have any specific formatting...

    Cheers,
    Mihai

  • Mihai, here is the URL: http://www.debuggingnow.com/blog/

    Thanks for your help!

  • Hi Baiyan,

    As your project is in Chinese I was unable to understand something or get an idea about what's wrong.

    You may like to further explain what you're tying to get...

    If you will use the "words" parameter what formatting should be included and it is not (can you list some tags)?

    Cheers,
    Mihai

  • Thanks Baiyan, I followed your instruction and even my problem which was somewhat similar was solved!!

    Thanks again :D

  • You're welcome John ;)

  • Mihai, this is the code that related:


    <mt:If tag="EntryBody">
    <div class="asset-body">

    <$mt:EntryBody words="40"$>
    <br /><br />
    <div class="asset-more-link">

    <a href="<$mt:EntryPermalink$>#more" rel="bookmark">阅读全文>></a>.

    </div>
    </div>
    </mt:If>

    And following is the code of the entire Entry Summary

    <$mt:EntryTrackbackData$>
    <div id="entry-<$mt:EntryID$>" class="entry-asset asset hentry">
        <div class="asset-header">
            <h2 class="asset-name entry-title">
                <a href="<$mt:EntryPermalink$>" rel="bookmark"><$mt:EntryTitle$></a>
                
                <mt:Unless name="hide_counts" eq="1">
                    <mt:IfCommentsActive><a href="<$mt:EntryPermalink$>#comments" class="comment-summary"><span class="comment-count"><$mt:EntryCommentCount$></span><span class="comment-label">comments</span></a></mt:IfCommentsActive>
                </mt:Unless>
            </h2>
            <div class="asset-meta">
                <span class="byline">
        <mt:If tag="EntryAuthorDisplayName">
                    By <span class="vcard author"><a href="" target="_blank"><$mt:EntryAuthorLink show_hcard="1"$></a></span> on <abbr class="published" title="<$mt:EntryDate format_name="iso8601"$>"><$mt:EntryDate format="%x %X"$></abbr>
        <mt:Else>
                    <abbr class="published" title="<$mt:EntryDate format_name="iso8601"$>"><$mt:EntryDate format="%x %X"$></abbr>
        </mt:If>
                </span>
    <mt:Unless name="hide_counts" eq="1">
                <mt:IfCommentsActive><span class="separator">|</span> <a href="<$mt:EntryPermalink$>#comments"><$mt:EntryCommentCount singular="1 Comment" plural="# Comments" none="No Comments"$></a></mt:IfCommentsActive>
                <mt:IfPingsActive><span class="separator">|</span> <a href="<$mt:EntryPermalink$>#trackbacks"><$mt:EntryTrackbackCount singular="1 TrackBack" plural="# TrackBacks" none="No TrackBacks"$></a></mt:IfPingsActive>
    </mt:Unless>
            </div>
        </div>
        <div class="asset-content entry-content">
    <mt:If tag="EntryBody">
            <div class="asset-body">
                
                <$mt:EntryBody words="40"$>        
                <br /><br />
                <div class="asset-more-link">
    
    

    <a href="<$mt:EntryPermalink$>#more" rel="bookmark">阅读全文>></a>.

    </div>
    </div>
    </mt:If>
    <mt:If name="entry_archive">
    <mt:EntryIfTagged>
    <div class="entry-tags">
    <h4>Tags<span class="delimiter">:</span></h4>
    <ul>
    <li><mt:EntryTags glue='<span class="delimiter">,</span></li> <li>'><a href="javascript:void(0)" onclick="location.href='<$mt:TagSearchLink encode_js="1"$>';return false;" rel="tag"><$mt:TagName$></a></mt:EntryTags></li>
    </ul>
    </div>
    </mt:EntryIfTagged>
    </mt:If>
    <mt:If tag="EntryMore" convert_breaks="0">
    <div class="asset-more-link">
    Continue reading <a href="<$mt:EntryPermalink$>#more" rel="bookmark"><$mt:EntryTitle$></a>.
    </div>
    </mt:If>
    </div>
    <div class="asset-footer"></div>
    </div>


  • Mihai, this is the code that related:


    <mt:If tag="EntryBody">
    <div class="asset-body">

    <$mt:EntryBody words="40"$>
    <br /><br />
    <div class="asset-more-link">

    <a href="<$mt:EntryPermalink$>#more" rel="bookmark">阅读全文>></a>.

    </div>
    </div>
    </mt:If>

    And following is the code of the entire Entry Summary

    <$mt:EntryTrackbackData$>
    <div id="entry-<$mt:EntryID$>" class="entry-asset asset hentry">
        <div class="asset-header">
            <h2 class="asset-name entry-title">
                <a href="<$mt:EntryPermalink$>" rel="bookmark"><$mt:EntryTitle$></a>
                
                <mt:Unless name="hide_counts" eq="1">
                    <mt:IfCommentsActive><a href="<$mt:EntryPermalink$>#comments" class="comment-summary"><span class="comment-count"><$mt:EntryCommentCount$></span><span class="comment-label">comments</span></a></mt:IfCommentsActive>
                </mt:Unless>
            </h2>
            <div class="asset-meta">
                <span class="byline">
        <mt:If tag="EntryAuthorDisplayName">
                    By <span class="vcard author"><a href="" target="_blank"><$mt:EntryAuthorLink show_hcard="1"$></a></span> on <abbr class="published" title="<$mt:EntryDate format_name="iso8601"$>"><$mt:EntryDate format="%x %X"$></abbr>
        <mt:Else>
                    <abbr class="published" title="<$mt:EntryDate format_name="iso8601"$>"><$mt:EntryDate format="%x %X"$></abbr>
        </mt:If>
                </span>
    <mt:Unless name="hide_counts" eq="1">
                <mt:IfCommentsActive><span class="separator">|</span> <a href="<$mt:EntryPermalink$>#comments"><$mt:EntryCommentCount singular="1 Comment" plural="# Comments" none="No Comments"$></a></mt:IfCommentsActive>
                <mt:IfPingsActive><span class="separator">|</span> <a href="<$mt:EntryPermalink$>#trackbacks"><$mt:EntryTrackbackCount singular="1 TrackBack" plural="# TrackBacks" none="No TrackBacks"$></a></mt:IfPingsActive>
    </mt:Unless>
            </div>
        </div>
        <div class="asset-content entry-content">
    <mt:If tag="EntryBody">
            <div class="asset-body">
                
                <$mt:EntryBody words="40"$>        
                <br /><br />
                <div class="asset-more-link">
    
    

    <a href="<$mt:EntryPermalink$>#more" rel="bookmark">阅读全文>></a>.

    </div>
    </div>
    </mt:If>
    <mt:If name="entry_archive">
    <mt:EntryIfTagged>
    <div class="entry-tags">
    <h4>Tags<span class="delimiter">:</span></h4>
    <ul>
    <li><mt:EntryTags glue='<span class="delimiter">,</span></li> <li>'><a href="javascript:void(0)" onclick="location.href='<$mt:TagSearchLink encode_js="1"$>';return false;" rel="tag"><$mt:TagName$></a></mt:EntryTags></li>
    </ul>
    </div>
    </mt:EntryIfTagged>
    </mt:If>
    <mt:If tag="EntryMore" convert_breaks="0">
    <div class="asset-more-link">
    Continue reading <a href="<$mt:EntryPermalink$>#more" rel="bookmark"><$mt:EntryTitle$></a>.
    </div>
    </mt:If>
    </div>
    <div class="asset-footer"></div>
    </div>


  • Mihai, this is the code that related:


    <mt:If tag="EntryBody">
    <div class="asset-body">

    <$mt:EntryBody words="40"$>
    <br /><br />
    <div class="asset-more-link">

    <a href="<$mt:EntryPermalink$>#more" rel="bookmark">阅读全文>></a>.

    </div>
    </div>
    </mt:If>

    And following is the code of the entire Entry Summary

    <$mt:EntryTrackbackData$>
    <div id="entry-<$mt:EntryID$>" class="entry-asset asset hentry">
        <div class="asset-header">
            <h2 class="asset-name entry-title">
                <a href="<$mt:EntryPermalink$>" rel="bookmark"><$mt:EntryTitle$></a>
                
                <mt:Unless name="hide_counts" eq="1">
                    <mt:IfCommentsActive><a href="<$mt:EntryPermalink$>#comments" class="comment-summary"><span class="comment-count"><$mt:EntryCommentCount$></span><span class="comment-label">comments</span></a></mt:IfCommentsActive>
                </mt:Unless>
            </h2>
            <div class="asset-meta">
                <span class="byline">
        <mt:If tag="EntryAuthorDisplayName">
                    By <span class="vcard author"><a href="" target="_blank"><$mt:EntryAuthorLink show_hcard="1"$></a></span> on <abbr class="published" title="<$mt:EntryDate format_name="iso8601"$>"><$mt:EntryDate format="%x %X"$></abbr>
        <mt:Else>
                    <abbr class="published" title="<$mt:EntryDate format_name="iso8601"$>"><$mt:EntryDate format="%x %X"$></abbr>
        </mt:If>
                </span>
    <mt:Unless name="hide_counts" eq="1">
                <mt:IfCommentsActive><span class="separator">|</span> <a href="<$mt:EntryPermalink$>#comments"><$mt:EntryCommentCount singular="1 Comment" plural="# Comments" none="No Comments"$></a></mt:IfCommentsActive>
                <mt:IfPingsActive><span class="separator">|</span> <a href="<$mt:EntryPermalink$>#trackbacks"><$mt:EntryTrackbackCount singular="1 TrackBack" plural="# TrackBacks" none="No TrackBacks"$></a></mt:IfPingsActive>
    </mt:Unless>
            </div>
        </div>
        <div class="asset-content entry-content">
    <mt:If tag="EntryBody">
            <div class="asset-body">
                
                <$mt:EntryBody words="40"$>        
                <br /><br />
                <div class="asset-more-link">
    
    

    <a href="<$mt:EntryPermalink$>#more" rel="bookmark">阅读全文>></a>.

    </div>
    </div>
    </mt:If>
    <mt:If name="entry_archive">
    <mt:EntryIfTagged>
    <div class="entry-tags">
    <h4>Tags<span class="delimiter">:</span></h4>
    <ul>
    <li><mt:EntryTags glue='<span class="delimiter">,</span></li> <li>'><a href="javascript:void(0)" onclick="location.href='<$mt:TagSearchLink encode_js="1"$>';return false;" rel="tag"><$mt:TagName$></a></mt:EntryTags></li>
    </ul>
    </div>
    </mt:EntryIfTagged>
    </mt:If>
    <mt:If tag="EntryMore" convert_breaks="0">
    <div class="asset-more-link">
    Continue reading <a href="<$mt:EntryPermalink$>#more" rel="bookmark"><$mt:EntryTitle$></a>.
    </div>
    </mt:If>
    </div>
    <div class="asset-footer"></div>
    </div>


  • Hi Baiyan,

    That coding you've pasted here is good!

    What is the result that you are expecting?

    Are there specific tags that you wanted to be included, but are not? Which ones?

    Cheers,
    Mihai

  • Hi Baiyan,

    That coding you've pasted here is good!

    What is the result that you are expecting?

    Are there specific tags that you wanted to be included, but are not? Which ones?

    Cheers,
    Mihai

  • Hi Baiyan,

    That coding you've pasted here is good!

    What is the result that you are expecting?

    Are there specific tags that you wanted to be included, but are not? Which ones?

    Cheers,
    Mihai

  • Mihai,

    I expect to show excerpt(part of the post) for each post on my main page, with format! Use the code you suggested:

     <$mt:EntryBody words="40"$> 

    But the result is there are no format of the excerpt, just plain text group together on the main page.

    What do you mean by specific tags? I am not intended to add other tags, I just hope it could work to show excerpt with format.

    If the code is good? is there any other places that might impact?

    Thanks for you continous help!

    -Baiyan

Add a Reply

If you need to share template code, replace all the "<" signs with "&lt;" or use this utility.

Forum Groups

1773 6162

Last Topic: Excluding categories from blog by kholechek on Feb 9, 2012

86 302

Last Topic: website entries by masoud on Oct 26, 2011

1429 5077

Last Topic: What apocalypse hit this community in the middle of 2011? by 75th on Feb 10, 2012

695 2910

Last Topic: Insert Image / File Fails by Russ Miller on Feb 10, 2012

84 291

Last Topic: How to have some other characters in entry basename automatically written by Afshin Haghighatnia on Dec 22, 2011

173 737

Last Topic: About the MT version stated in HTML source by Alex E. Schneider on Feb 7, 2012

190 567

Last Topic: Analytics Reporting by michael webster on Feb 5, 2012

48 210

Last Topic: An idea and also a request by Afshin Haghighatnia on Jun 29, 2011

64 246

Last Topic: jQuery in MT 5.1 still at 1.4 - why? by perlmonkey on May 25, 2011

code.sixapart.com

137 478

Last Topic: Getting a thumbnail with xpath by Peter on Mar 13, 2011

222 720

Last Topic: Custom Field for Asset Not Appearing by android on Feb 9, 2012