Help - Search - Members - Calendar
Full Version: MTKeyValues hardcoding problem...
Movable Type Community Forum > Additional Resources > Tips and Tricks
crackerboy
ok, i'm working on building a new site and had the idea of creating an editor database for review tracking (i.e. who we sent cds to to review, when they're due back etc.). when i found the MTKeyValues plug in, i knew i could use the MTEntryMore field to store the data i wanted. my next step was to create 3 pages with dynamic content for use by the editors for review tracking (with categories for each); To Be Reviewed, Being Reviewed, and To be Edited. here's the code i'm use on these pages for the tables.

CODE
<div class="side">
<table width="100%" border="0" cellspacing="10" cellpadding="2">
 <tr><div class="sidetitle">
   <td>ARTIST</td>
   <td>ALBUM</td>
   <td>LABEL</td>
   <td>RECEIVED</td>
   <td>REVIEWER</td>
   <td>SENT</td>
   <td>DUE</td>
   <td>RELEASE DATE</td>

 </tr></div>


<MTEntries sort_by="title" sort_order="ascend" category="Reviews: 1 - To Be Reviewed">
<MTKeyValues source="[MTEntryMore]">
<tr>
   <td bgcolor="#FFFFFF"><MTKeyValue key="artist"></td>
   <td bgcolor="#FFFFFF"><MTKeyValue key="album"></td>
   <td bgcolor="#FFFFFF"><MTKeyValue key="label"></td>
   <td bgcolor="#FFFFFF"><MTKeyValue key="received"></td>
   <td bgcolor="#FFFFFF"><MTKeyValue key="reviewer"></td>
   <td bgcolor="#FFFFFF"><MTKeyValue key="sent"></td>
   <td bgcolor="#FFFFFF"><MTKeyValue key="due"></td>
   <td bgcolor="#FFFFFF"><MTKeyValue key="releasedate"></td>
</tr>

</MTKeyValues>
</MTEntries>

</table></div>


this seemed to be working great, but i just noticed it is writing the hard code into the php files instead of keeping it dynamic and leaving the above table code in tack.

does anyone know why is this?
kadyellebee
I'm not quite sure exactly what you are trying to do, so I'll just write out some basics about plugins...

Are you seeing MTKeyValue tags in your source, or just the actual Key/Value information in your MTEntryMore field?

Movable Type plugin tags create static pages, just like the other MT tags.

If you use a Category Archive template with this code in it, then you'll have a page that has each category's info in it.

Post back with more info if this didn't help at all!

Kristine
crackerboy
so that code cannot work on a dynamic level? it is indeed creating a static page and inputing the information that query is calling for into the page (and removing the code).

i guess i don't understand why that is?

i'm putting additional info in my Extended entry fields to be accessed by MTKeyValue. i was assuming i could create a page to access and display it (with that code). which worked, but when i went back to look at the source code for that page, all the information it pulled it actually inserted into that page code. does this make sense?
crackerboy
i may have come up with a solution for this. it seems when i don't "Link this template to a file" the contents of that code don't get hardcoded. i guess this still doesn;t make sense to me though...

why would any contents from MT Tags get hard coded?
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.