user-pic

Error when rebuilding after adding related entries template module

Vote 0 Votes

I’m using the new mid-century template set and Movable Type Pro. Today I tried to add related entries, first using the code from http://www.devlounge.net/code/related-entries-in-movable-type, then after an error used this code: http://wiki.movabletype.org/Related_Entries (pretty much the same code). I included a <$MTInclude module="Related"$> tag in the entry template, just above the other two includes for trackbacks and comments. When I tried to rebuilt I got the following error:

An error occurred publishing entry 'Do I Need To Go Pro?': Publish error in template 'Entry': Error in <mtInclude> tag: error in module Related: Publish error in template 'Related': Error in <mtentryiftagged> tag: Error in <mtsetvarblock> tag: Error in <mtentries> tag: You have an error in your 'tag' attribute: Movable Type OR Upgrade

After reading all about tags (http://www.movabletype.org/documentation/author/tagging-entries-and-pages.html) I went through all my tags and added quotes, rebuilt all the entries that had those two-word tags, re-added the mt include tag to the entry template, and got the same error.

I’m not sure where I went wrong, and have wasted an entire afternoon trying to get it to work. Any help would be appreciated.

Reported on Movable Type 4.2

8 Replies

| Add a Reply
  • Here's that error again for those that don't want to vide the source code:

    An error occurred publishing entry 'Do I Need To Go Pro?': 
    Publish error in template 'Entry': Error in <mtInclude> tag: 
    error in module Related: Publish error in template 'Related': 
    Error in <mtentryiftagged> tag: Error in <mtsetvarblock> tag: 
    Error in <mtentries> tag: You have an error in your 'tag' 
    attribute: Movable Type OR Upgrade
    
    
  • Can you post the code for the related template.

  • Hi Rob,
    I used this code from http://wiki.movabletype.org/Related_Entries

    
    <mt:entryiftagged>
       <mt:setvarblock name="curentry"><mt:entryid /></mt:setvarblock>
       <mt:setvarblock name="relatedtags">
          <mt:entrytags glue=" OR "><mt:tagname /></mt:entrytags>
       </mt:setvarblock>
       <mt:setvarblock name="listitems">
          <mt:entries tags="$relatedtags" unique="1">
             <mt:setvarblock name="listentry">
                <mt:entryid />
             </mt:setvarblock>
             <mt:unless name="listentry" eq="$curentry">
                <li><a href="<mt:entrypermalink />"><mt:entrytitle /></a></li>
             </mt:unless>
          </mt:entries>
       </mt:setvarblock>
       <mt:if name="listitems">
          <h3>Related Blog Entries</h3>
          <ul>
             <mt:var name="listitems">
          </ul>
       </mt:if>
    </mt:entryiftagged>
    
    

    I thought from the error that the problem had something to do with my tags.

    Glad you added the Preview button.

  • Hi Toni. Have you determined whether it's related to the tags on a single entry or a problem with the snippet of code itself? If you save/republish an entry with no tags or with one tag do you get the same error?

  • I published an entry with two one-word tags and got the following error:

    
    An error occurred publishing entry 'Post Office Plugin': 
    Publish error in template 'Entry': Error in <mtInclude> tag: 
    error in module Related: Publish error in template 'Related': 
    Error in <mtentryiftagged> tag: Error in <mtsetvarblock> tag: 
    Error in <mtentries> tag: You have an error in your 'tag' attribute: 
    Email OR Plugins
    
    

    Then I tried publishing an entry with no tags and got the following error:

    
    An error occurred publishing entry 'Add a Menu Bar to 
    MT's Default Themes': Publish error in template 'Entry': 
    Error in <mtInclude> tag: error in module Related: 
    Publish error in template 'Related': Error in 
    <mtentryiftagged> tag: Error in <mtsetvarblock> tag: 
    Error in <mtentries> tag: You have an error in your 'tag' 
    attribute: CSS OR Menu Bar OR Navigation
    
    

    I can't publish the entry template without errors either.

  • Notice the second error, with no tags? I was still working on the same entry "Post Office Plugin". MT has quoted the previous entry in my list which I was not publishing. Maybe this is a javascript error?

  • Thanks for your help guys, but I've fixed this problem.

    I remember reading on the Devlounge post that there must be no spaces in the setvarblock.

    eg. I changed the code from this:

       <mt:setvarblock name="relatedtags">
          <mt:entrytags glue=" OR "><mt:tagname /></mt:entrytags>
       </mt:setvarblock>
    

    to this:

       <mt:setvarblock name="relatedtags"><mt:entrytags glue=" OR "><mt:tagname/></mt:entrytags></mt:setvarblock>
    
    and now it works perfectly. 
    
  • Thanks for sharing the answer Toni, I googled it and found it.

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

1428 5076

Last Topic: Stupid Question? How to make a static homepage by Jeremy on Feb 3, 2012

694 2908

Last Topic: Blogspot to Movable Type by sdude on Feb 8, 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 565

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 717

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