default userpic

MT perl modules for accessing Custom Fields info?

Vote 0 Votes

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

8 Replies

| Add a Reply
  • default userpic

    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.

  • 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

Add a Reply

If you need to share template code, replace all the "<" signs with "&lt;" or use this utility.

Forum Groups

1773 6162

Last Topic: Excluding categories from blog by kholechek on Feb 9, 2012

86 302

Last Topic: website entries by masoud on Oct 26, 2011

1429 5077

Last Topic: What apocalypse hit this community in the middle of 2011? by 75th on Feb 10, 2012

695 2910

Last Topic: Insert Image / File Fails by Russ Miller on Feb 10, 2012

84 291

Last Topic: How to have some other characters in entry basename automatically written by Afshin Haghighatnia on Dec 22, 2011

173 737

Last Topic: About the MT version stated in HTML source by Alex E. Schneider on Feb 7, 2012

190 567

Last Topic: Analytics Reporting by michael webster on Feb 5, 2012

48 210

Last Topic: An idea and also a request by Afshin Haghighatnia on Jun 29, 2011

64 246

Last Topic: jQuery in MT 5.1 still at 1.4 - why? by perlmonkey on May 25, 2011

code.sixapart.com

137 478

Last Topic: Getting a thumbnail with xpath by Peter on Mar 13, 2011

222 720

Last Topic: Custom Field for Asset Not Appearing by android on Feb 9, 2012