default userpic

How to load an entry based on the meta data field of that entry

Vote 0 Votes

I have successfully saved the custom field value with
$entry->meta('field.splid',$sid);
$entry->save;

Now I would like to fetch the entry id or entry object in some other page using $sid.
Can anyone help me with this asap.
Thanks in advance.

Reported on Movable Type 4.0x

2 Replies

| Add a Reply
  • We'd need to know what $sid contains before offering any feedback. That said, if you've already got an entry object in $entry, you can get the id by simply using $entry->id.

  • Hello.
    I'm running 4.34 version

    Once that the export module does not support the custom fields, I'm trying to hack the lib/mt/ImportExport.pm module.

    basically, I want to export (and then import) two custom fields that store their values in in entry_meta_vchar_idx and the other on entry_meta_vclob from the table mt_entry_meta.

    So, in the Export sub routine, I changet the template to include my two custom entry fields:

    ENTRYDATARESUMO_ARTIGO:
    <mt:entrydataresumo_artigo>
    -----
    ENTRYDATAIMAGEMDESTAQUE640X350:
    <mt:entrydataimagemdestaque640x350>
    -----

    Then, in the Import Sub routine, I added the following content after the ALLOW PINGS test:


    } elsif ($key eq 'ENTRYDATARESUMO_ARTIGO') {
    $entry->meta("field.resumo_artigo", $val);
    } elsif ($key eq 'ENTRYDATAIMAGEMDESTAQUE640X350') {
    $entry->meta("field.imagem_destaque_640x350", $val);

    unfortunately I have no success importing the custom fields above in the new database.

    Any ideas?
    thanks for any help

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