I’ve been digging through the documentation and can’t seem to find what I need. Would anyone mind giving me a nudge toward figuring out how to access the info in the mtentrymeta table using perl?
Reported on Movable Type 4.2
I’ve been digging through the documentation and can’t seem to find what I need. Would anyone mind giving me a nudge toward figuring out how to access the info in the mtentrymeta table using perl?
Reported on Movable Type 4.2
Most of the entry data can be accessed using the Entry tags
http://www.movabletype.org/documentation/appendices/tags/#E
If it's a column in the database that you can't directly access, you can try the really useful MT SQL plugin to query the database from a template
http://plugins.movabletype.org/sql/
Thanks for your reply. I'm well versed in using both of those methods to access what I need when I'm writing a template.
Now I'm studying writing plugins and I need to write a condition that refers to a custom field. Maybe I'm making things too complicated thinking I need some special perl object to refer to that info.
If anyone can provide and guidance or examples of a plugin that looks at a custom field I'd really appreciate it.
Some helpful hints, since I didn't see any documentation that really goes into this:
1) Look at MT::Meta in your lib directory.
2) Look at the way that asset objects handle metadata. There is a method that ends up getting overloaded by child objects, called metadata in MT::Asset.
After working at this for a couple days I have to give in a ask for a little more help.
Here's what I'm trying to to:
I have a plugin installed that does X when an entry is saved. I need to tell it to do X only if entrydatamenu_item (my custom field) is 'None'.
I just can't figure out how to use perl to get the value of entrydatamenu_item.
Why don't you join the MTOS developer mailing list and post your question there? The only answers I can give you off the top of my head involve greps :)
That's perfect Mike. This is exactly what I needed.
Thanks!
Hi VeryMystery,
I am trying to write a Plugin to do similar task
Do X if is checked.
Please share how you achieved this
I'm sure there are problems with this method but ended up following this tutorial for querying the mysql database using perl.
http://www.tizag.com/perlT/perlmysqlquery.php
There's got to be a much more efficient way to do this from a plugin but I couldn't find much help and my task didn't warrant enough of my time to delve far enough into perl at this point.