The site I am working on is having a conflict in the Category Archive View. In this view, clicking on the Author's name takes the user to the same Category Archive they are already viewing.
When viewed in Monthly archive, the Author link functions properly.
Does anyone have any idea what might be the problem?
Thanks!
Reported on Movable Type 4.25
Probably the coding is not good.
Are there any known conflicts? Are there any typical conditions where this does work?
I unfortunately didn't write the code so I'm taking it apart piece by piece trying to find which template and what area the flaw is in.
I think the problem is probably with the Entry Summary. Again I'm using code someone on the team previously built and I can see some pretty questionable party, but I'm not sure how to iron it all out.
<$mt:EntryTrackbackData$> <div id="entry-<$mt:EntryID$>" class="entry-asset asset hentry"> <div class="asset-header"> <div class="asset-title-block"> <mt:IfArchiveTypeEnabled archive_type="Category"> <mt:If tag="EntryCategories"> <div class="entry-categories"> <mt:ignore><p><mt:setVar name="catCount" value="0" /><mt:EntryCategories><mt:setvar name="catCount" op="+" value="1" /></mt:EntryCategories> Categor<mt:if var="catCount" gt="1">ies<mt:else>y</mt:if>: </p></mt:ignore> <ul> <mt:ignore><li><mt:EntryCategories glue='<span class="delimiter">,</span></li> <li class="entry-category">'><a href="<$mt:CategoryArchiveLink$>" rel="tag"><$mt:CategoryLabel$></a></mt:EntryCategories></li></mt:ignore> <li><mt:setVar name="catCount" value="0" /><mt:EntryCategories><mt:if var="catCount" eq="0"><a href="<$mt:CategoryArchiveLink$>" rel="tag"><$mt:CategoryLabel$></a></mt:if><mt:setvar name="catCount" op="+" value="1" /></mt:EntryCategories></li> </ul> </div> </mt:If> </mt:IfArchiveTypeEnabled> <h2 class="asset-name entry-title"><a href="<$mt:EntryPermalink$>" rel="bookmark"><$mt:EntryTitle$></a></h2> </div> <div class="asset-meta"> <div class="asset-meta-info"> <span class="byline"> <mt:If tag="EntryAuthorDisplayName"> <mt:ignore><mt:Unless name="hide_counts" eq="1"></mt:ignore> Posted by<br /><span class="vcard author"><$mt:EntryAuthorLink type="archive" show_hcard="1"$></span><br /> <mt:ignore></mt:unless></mt:ignore> <abbr class="published" title="<$mt:EntryDate format_name="iso8601"$>"><$mt:EntryDate format="%m/%e/%y"$></abbr> <mt:Else> <mt:ignore><mt:Unless name="hide_counts" eq="1"> </mt:ignore> <abbr class="published" title="<$mt:EntryDate format_name="iso8601"$>"><$mt:EntryDate format="%x %X"$></abbr> <mt:ignore></mt:Unless> </mt:ignore> </mt:If> </span> </div> <mt:ignore><mt:Unless name="hide_counts" eq="1"></mt:ignore> <div class="userpic"><div class="userpicInner"><a href="<$MTBlogURL$>about.html#<$MTEntryAuthorDisplayName dirify="1"$>"><img src="<$mt:AuthorUserpicURL$>" alt="<$MTEntryAuthorDisplayName$>" title="<$MTEntryAuthorDisplayName$>" /></a></div></div> <mt:ignore></mt:Unless> </mt:ignore> </div> </div> <div class="asset-content entry-content"> <mt:If tag="EntryBody"> <div class="asset-body"> <$mt:EntryBody$> </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"><mt:Unless name="hide_counts" eq="1"> <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> <form method="post" action="<$MTCGIPath$><$MTCommentScript$>" name="comments_form"> <input type="hidden" name="static" value="1" /> <input type="hidden" name="entry_id" value="<$MTEntryID$>" /> <!-- Start Comments Box --> <textarea id="comment-text" style="overflow: auto" name="text" rows="5" cols="10" onFocus="this.value=''; this.style.color='#474747'; this.onfocus=null;">Enter your comment...</textarea> <input type="submit" accesskey="v" name="preview" value="Post Comment" class="submit"/> <span class="asset-footer-tools"><mt:IfCommentsActive><a href="<$mt:EntryPermalink$>#comments"><$mt:EntryCommentCount singular="Read Comment (1)" plural="Read Comments #" none="Be the first to Comment"$></a></mt:IfCommentsActive></span> <!-- End Comments Box --> </form> </mt:Unless> </div> </div>The issue is most-likely in the <$mt:EntryAuthorLink type="archive" show_hcard="1"$> tag. Though it looks like you are using this tag correctly.
(Documentation for the mt:EntryAuthorLink tag.)
I just tested this in MT4.32 and have been able to reproduce this issue.
Until this is fixed by either patching your MT installation with some custom code or until you upgrade to a version of MT that contains this fix you will have to use a work around.
The workaround is to create this link manually.
(You may need to adapt this example as your code may be slightly different, but it probably wont' be too different)
In your Entry Summary module replace this this MTML:
<$mt:EntryAuthorLink type="archive" show_hcard="1"$>
Which creates a link like this:
<a href="http://sweetness.local/my-first-blog/author/melody-nelson/">Melody Nelson</a>
Use the following MTML to manually construct this same link:
<a href="<$mt:BlogURL$>/author/<$mt:AuthorBasename separator="-"$>"><$mt:AuthorDisplayName$></a>
Here's links to the docs for these tags: mt:AuthorBasename, mt:AuthorDisplayName, mt:BlogURL
Sorry for any stress that this bug has caused you. I have created a bug report which should get this fixed in a future version of MT.
http://bugs.movabletype.org/default.asp?103299
I have also updated the docs for this tag to provide this same solution so that others can benefit:
http://www.movabletype.org/documentation/appendices/tags/entryauthorlink.html
Thanks. Hope this helps.
Thanks for looking into this for me.
I tried the workaround and got the error:
An error occurred publishing category '306': Publish error in template 'Category Entry Listing': Error in <mtEntries> tag: Error in <mtInclude> tag: error in module Entry Summary: Publish error in template 'Entry Summary': Error in <mtIf> tag: Error in <mtAuthorBasename> tag: You used an 'AuthorBasename' tag outside of the context of a author; perhaps you mistakenly placed it outside of an 'MTAuthors' container?
I'm looking in to getting our build of MT upgraded. I just started on the project. I'd certainly rather have the latest version, but I'm not sure who to clear that with in my group. :)
Thanks again for your help.
Yup, talked to my team and they've said we can't upgrade at this time. Big company protocol stuff. Any idea why the workaround is giving me an error?
Okay, looks like this worked:
Thanks again for all your help!
AuthorDisplayName isn't always going to be the same as AuthorBasename. This should get you there, though:
<mt:EntryAuthorID setvar="entry_author_id">
<a href="<$mt:BlogURL$>/author/<mt:Authors id="$entry_author_id"><$mt:AuthorBasename separator="-"$>"><$mt:AuthorDisplayName$></mt:Authors></a>
Well, all this did solve my problem on the test server running MT 4.261, but our live server on MT 4.25 I am still experiencing the bug when clicking the author link within a category archive. See at: http://blog.wellsfargo.com/ceomobile/services/
On some of the blogs on the same server, the Name that is returned by the code is a long list of all of the authors' names.
Any suggestions?
Also, the client has a blog running on version 4.01 that they would like to mimic the templates of the blogs running on 4.25. I've managed to downgrade all the newer templates, but I'm having trouble with the author archives. The default template tag for 4.01 returns the author name, but with no link to the archive. The code I used here returns the list of all author names I described above.
Unfortunately the 4.01 blog is on an internal-only server so I can't link to an example of the problem.
Are there any other methods for building and linking to an author archive in 4.01?
Thanks!