Help - Search - Members - Calendar
Full Version: Can I add an MT entry into a table?
Movable Type Community Forum > Additional Resources > Tips and Tricks
mmconti
I am trying to add an image to the first column of a table, and a MT entry for catagories to the second column but get an error on rebuilding.

See code below:

CODE
<table width="50%" cellspacing="0" cellpadding="0">
 <tr>
   <td><img src=".../log/images/doctorsusan2.jpg" width="99" height="131"></td>
   <td><a href="<$MTCategoryArchiveLink$>"><$MTCategoryLabel$></a><br>
     <mtentries> <$MTEntryTitle$>  </mtentries> <br />
   </td>
 </tr>
</table>


Thanks!  
mc   huh.gif
maddy
You've got mtentries and /mtentries instead of MTEntries and /MTEntries around the MTEntryTitle  - which would definitely give you an error!

If you fix that, does it work how you want it? Post back if not, ok? smile.gif I'm not quite sure I follow what you are trying to do. huh.gif
mmconti
Here is the error I get when rebuilding the the above mentioned code into the Index when adding table. I don't understand what it means by "outside of the proper context."

Build error in template 'Main Index': Error in tag: You used <$MTCategoryArchiveLink$> outside of the proper context.  sad.gif

mc

PS, the lack of caps for mt came from Dreamweaver when I copied the code, it is okay in the Index file.
kadyellebee
I'm guessing (but not sure) that you want a link to the category that the entry is in?  If so, modify your code like this:
CODE
<table width="50%" cellspacing="0" cellpadding="0">
<tr>
  <td><img src=".../log/images/doctorsusan2.jpg" width="99" height="131"></td>
  <td>
<MTEntries>
<MTEntryCategories>
<a href="<$MTCategoryArchiveLink$>"><$MTCategoryLabel$></a>
</MTEntryCategories>
<br>
<$MTEntryTitle$>  
</MTEntries> <br />
  </td>
</tr>
</table>


That might work better for you,
Kristine
mmconti
Ah, adding an
CODE
<a href=<$MT...>
did the trick, thanks.
mc biggrin.gif
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.