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

7 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.

Add a Reply

Forum Groups

151 405

Last Topic: MT Interface Missing by Sherri on Nov 10, 2008

36 144

Last Topic: Installation can't finish by Drazend on Nov 10, 2008

34 93

Last Topic: Creating your own Plug-in by jondauz on Nov 5, 2008

10 33

Last Topic: new licensing confusion by Neil Epstein on Aug 14, 2008

code.sixapart.com

62 226

Last Topic: Callback after blog publishing. by Tomato Interactive on Oct 27, 2008

34 98

Last Topic: Ajax Rating Plugin by kiran on Oct 17, 2008