{"id":155,"date":"2008-04-02T16:12:42","date_gmt":"2008-04-02T16:12:42","guid":{"rendered":"http:\/\/beta.robertprice.co.uk\/robblog\/2008\/04\/using_extrafields_in_movable_type-shtml\/"},"modified":"2008-04-02T16:12:42","modified_gmt":"2008-04-02T16:12:42","slug":"using_extrafields_in_movable_type-shtml","status":"publish","type":"post","link":"http:\/\/www.robertprice.co.uk\/robblog\/using_extrafields_in_movable_type-shtml\/","title":{"rendered":"Using ExtraFields In Movable Type"},"content":{"rendered":"<p>\nI&#8217;ve been doing some work with <a href=\"http:\/\/www.movabletype.com\/\">Movable Type<\/a> using the <a href=\"http:\/\/www.staggernation.com\/mtplugins\/ExtraFieldsReadMe.html\">ExtraFields plugin<\/a> recently.\n<\/p>\n<p>\nOne problem I had was offering an alternative if an extra field hadn&#8217;t been set. It turns out that it&#8217;s possible to nest an <a href=\"http:\/\/www.sixapart.com\/movabletype\/docs\/3.3\/a_template_tag_reference\/utility\/mtelse.html\">&lt;MTElse&gt;<\/a> in the <a href=\"http:\/\/www.staggernation.com\/mtplugins\/ExtraFieldsReadMe.html#MTIfExtraField\">&lt;MTIfExtraField&gt;<\/a> tag.\n<\/p>\n<p>\nHere&#8217;s an example. I have an extrafield called <var>externalurl<\/var> on an entry, if it exists I want to use that for the link, if not I want to use the entry&#8217;s permalink.\n<\/p>\n<div class=\"code\"><code>&lt;MTIfExtraField field=\"externalurl\"&gt;<br \/>\n&lt;$MTExtraFieldValue field=\"externalurl\"$&gt;<br \/>\n&lt;MTElse&gt;<br \/>\n&lt;$MTEntryPermalink$&gt;<br \/>\n&lt;\/MTElse&gt;<br \/>\n&lt;\/MTIfExtraField&gt;<br \/>\n<\/code><\/div>\n<p>\nThis basically gives us the functionality of a &lt;MTElseExtraField&gt; tag.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;ve been doing some work with Movable Type using the ExtraFields plugin recently. One problem I had was offering an alternative if an extra field hadn&#8217;t been set. It turns out that it&#8217;s possible to nest an &lt;MTElse&gt; in the &lt;MTIfExtraField&gt; tag. Here&#8217;s an example. I have an extrafield called externalurl on an entry, if &hellip; <a href=\"http:\/\/www.robertprice.co.uk\/robblog\/using_extrafields_in_movable_type-shtml\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Using ExtraFields In Movable Type&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"footnotes":""},"categories":[2],"tags":[75],"class_list":["post-155","post","type-post","status-publish","format-standard","hentry","category-dev","tag-web-development"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Using ExtraFields In Movable Type - Robert Price<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"http:\/\/www.robertprice.co.uk\/robblog\/using_extrafields_in_movable_type-shtml\/\" \/>\n<meta property=\"og:locale\" content=\"en_GB\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Using ExtraFields In Movable Type - Robert Price\" \/>\n<meta property=\"og:description\" content=\"I&#8217;ve been doing some work with Movable Type using the ExtraFields plugin recently. One problem I had was offering an alternative if an extra field hadn&#8217;t been set. It turns out that it&#8217;s possible to nest an &lt;MTElse&gt; in the &lt;MTIfExtraField&gt; tag. Here&#8217;s an example. I have an extrafield called externalurl on an entry, if &hellip; Continue reading &quot;Using ExtraFields In Movable Type&quot;\" \/>\n<meta property=\"og:url\" content=\"http:\/\/www.robertprice.co.uk\/robblog\/using_extrafields_in_movable_type-shtml\/\" \/>\n<meta property=\"og:site_name\" content=\"Robert Price\" \/>\n<meta property=\"article:published_time\" content=\"2008-04-02T16:12:42+00:00\" \/>\n<meta name=\"author\" content=\"rob\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"rob\" \/>\n\t<meta name=\"twitter:label2\" content=\"Estimated reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"http:\/\/www.robertprice.co.uk\/robblog\/using_extrafields_in_movable_type-shtml\/#article\",\"isPartOf\":{\"@id\":\"http:\/\/www.robertprice.co.uk\/robblog\/using_extrafields_in_movable_type-shtml\/\"},\"author\":{\"name\":\"rob\",\"@id\":\"http:\/\/www.robertprice.co.uk\/robblog\/#\/schema\/person\/fac6d5b076e0e14e1fb13e15b542a6c5\"},\"headline\":\"Using ExtraFields In Movable Type\",\"datePublished\":\"2008-04-02T16:12:42+00:00\",\"mainEntityOfPage\":{\"@id\":\"http:\/\/www.robertprice.co.uk\/robblog\/using_extrafields_in_movable_type-shtml\/\"},\"wordCount\":100,\"keywords\":[\"Web Development\"],\"articleSection\":[\"Dev\"],\"inLanguage\":\"en-GB\"},{\"@type\":\"WebPage\",\"@id\":\"http:\/\/www.robertprice.co.uk\/robblog\/using_extrafields_in_movable_type-shtml\/\",\"url\":\"http:\/\/www.robertprice.co.uk\/robblog\/using_extrafields_in_movable_type-shtml\/\",\"name\":\"Using ExtraFields In Movable Type - Robert Price\",\"isPartOf\":{\"@id\":\"http:\/\/www.robertprice.co.uk\/robblog\/#website\"},\"datePublished\":\"2008-04-02T16:12:42+00:00\",\"author\":{\"@id\":\"http:\/\/www.robertprice.co.uk\/robblog\/#\/schema\/person\/fac6d5b076e0e14e1fb13e15b542a6c5\"},\"breadcrumb\":{\"@id\":\"http:\/\/www.robertprice.co.uk\/robblog\/using_extrafields_in_movable_type-shtml\/#breadcrumb\"},\"inLanguage\":\"en-GB\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"http:\/\/www.robertprice.co.uk\/robblog\/using_extrafields_in_movable_type-shtml\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"http:\/\/www.robertprice.co.uk\/robblog\/using_extrafields_in_movable_type-shtml\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"http:\/\/www.robertprice.co.uk\/robblog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Using ExtraFields In Movable Type\"}]},{\"@type\":\"WebSite\",\"@id\":\"http:\/\/www.robertprice.co.uk\/robblog\/#website\",\"url\":\"http:\/\/www.robertprice.co.uk\/robblog\/\",\"name\":\"Robert Price\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"http:\/\/www.robertprice.co.uk\/robblog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-GB\"},{\"@type\":\"Person\",\"@id\":\"http:\/\/www.robertprice.co.uk\/robblog\/#\/schema\/person\/fac6d5b076e0e14e1fb13e15b542a6c5\",\"name\":\"rob\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"http:\/\/www.robertprice.co.uk\/robblog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/6f0eb511179100a4e968abc70403e33686e6ab3e992e392bedd2ccac01da666c?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/6f0eb511179100a4e968abc70403e33686e6ab3e992e392bedd2ccac01da666c?s=96&d=mm&r=g\",\"caption\":\"rob\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Using ExtraFields In Movable Type - Robert Price","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"http:\/\/www.robertprice.co.uk\/robblog\/using_extrafields_in_movable_type-shtml\/","og_locale":"en_GB","og_type":"article","og_title":"Using ExtraFields In Movable Type - Robert Price","og_description":"I&#8217;ve been doing some work with Movable Type using the ExtraFields plugin recently. One problem I had was offering an alternative if an extra field hadn&#8217;t been set. It turns out that it&#8217;s possible to nest an &lt;MTElse&gt; in the &lt;MTIfExtraField&gt; tag. Here&#8217;s an example. I have an extrafield called externalurl on an entry, if &hellip; Continue reading \"Using ExtraFields In Movable Type\"","og_url":"http:\/\/www.robertprice.co.uk\/robblog\/using_extrafields_in_movable_type-shtml\/","og_site_name":"Robert Price","article_published_time":"2008-04-02T16:12:42+00:00","author":"rob","twitter_card":"summary_large_image","twitter_misc":{"Written by":"rob","Estimated reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"http:\/\/www.robertprice.co.uk\/robblog\/using_extrafields_in_movable_type-shtml\/#article","isPartOf":{"@id":"http:\/\/www.robertprice.co.uk\/robblog\/using_extrafields_in_movable_type-shtml\/"},"author":{"name":"rob","@id":"http:\/\/www.robertprice.co.uk\/robblog\/#\/schema\/person\/fac6d5b076e0e14e1fb13e15b542a6c5"},"headline":"Using ExtraFields In Movable Type","datePublished":"2008-04-02T16:12:42+00:00","mainEntityOfPage":{"@id":"http:\/\/www.robertprice.co.uk\/robblog\/using_extrafields_in_movable_type-shtml\/"},"wordCount":100,"keywords":["Web Development"],"articleSection":["Dev"],"inLanguage":"en-GB"},{"@type":"WebPage","@id":"http:\/\/www.robertprice.co.uk\/robblog\/using_extrafields_in_movable_type-shtml\/","url":"http:\/\/www.robertprice.co.uk\/robblog\/using_extrafields_in_movable_type-shtml\/","name":"Using ExtraFields In Movable Type - Robert Price","isPartOf":{"@id":"http:\/\/www.robertprice.co.uk\/robblog\/#website"},"datePublished":"2008-04-02T16:12:42+00:00","author":{"@id":"http:\/\/www.robertprice.co.uk\/robblog\/#\/schema\/person\/fac6d5b076e0e14e1fb13e15b542a6c5"},"breadcrumb":{"@id":"http:\/\/www.robertprice.co.uk\/robblog\/using_extrafields_in_movable_type-shtml\/#breadcrumb"},"inLanguage":"en-GB","potentialAction":[{"@type":"ReadAction","target":["http:\/\/www.robertprice.co.uk\/robblog\/using_extrafields_in_movable_type-shtml\/"]}]},{"@type":"BreadcrumbList","@id":"http:\/\/www.robertprice.co.uk\/robblog\/using_extrafields_in_movable_type-shtml\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"http:\/\/www.robertprice.co.uk\/robblog\/"},{"@type":"ListItem","position":2,"name":"Using ExtraFields In Movable Type"}]},{"@type":"WebSite","@id":"http:\/\/www.robertprice.co.uk\/robblog\/#website","url":"http:\/\/www.robertprice.co.uk\/robblog\/","name":"Robert Price","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"http:\/\/www.robertprice.co.uk\/robblog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-GB"},{"@type":"Person","@id":"http:\/\/www.robertprice.co.uk\/robblog\/#\/schema\/person\/fac6d5b076e0e14e1fb13e15b542a6c5","name":"rob","image":{"@type":"ImageObject","inLanguage":"en-GB","@id":"http:\/\/www.robertprice.co.uk\/robblog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/6f0eb511179100a4e968abc70403e33686e6ab3e992e392bedd2ccac01da666c?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/6f0eb511179100a4e968abc70403e33686e6ab3e992e392bedd2ccac01da666c?s=96&d=mm&r=g","caption":"rob"}}]}},"_links":{"self":[{"href":"http:\/\/www.robertprice.co.uk\/robblog\/wp-json\/wp\/v2\/posts\/155","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.robertprice.co.uk\/robblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.robertprice.co.uk\/robblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.robertprice.co.uk\/robblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.robertprice.co.uk\/robblog\/wp-json\/wp\/v2\/comments?post=155"}],"version-history":[{"count":0,"href":"http:\/\/www.robertprice.co.uk\/robblog\/wp-json\/wp\/v2\/posts\/155\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.robertprice.co.uk\/robblog\/wp-json\/wp\/v2\/media?parent=155"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.robertprice.co.uk\/robblog\/wp-json\/wp\/v2\/categories?post=155"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.robertprice.co.uk\/robblog\/wp-json\/wp\/v2\/tags?post=155"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}