Basically I tried this:
(my $page) = MT::Page->load({field.field_name => "somevalue"});
As I already suspected, this did not work. After some searching with Google I came accross this little forum posting, which held the key. This code works:
my $mt = MT->instance();
(my $page) = MT::Page->search_by_meta('field.field_name', 'somevalue');
Shame the documentation for this incredibly useful method is hidden in an obscure part of the documentation that is not easily findable through Google.
Tweet
Leave a comment