Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor fireproofsocks

    (@fireproofsocks)

    Tags, categories, all other taxonomies apply to the *post* level, not to the tag level. I suspect that if you’re thinking of tagging fields, then your data model probably needs to be revised. If you want to show/hide fields based on the tag/category of the post containing those fields, that would best be handled by modifications in your theme file.

    Thread Starter webbrewers

    (@webbrewers)

    Thanks for the response. I was hoping to be able to maintain one set of custom fields but hide unneeded ones depending on the category/tag.
    I modified the “formatted list” template code a little so it completely hides empty fields – maybe that will suffice in this case.

    <?php print_custom_field('sandwiches:formatted_list', array('<li>[+value+]</li>','<strong>Sandwiches</strong><ul>[+content+]</ul>') ); ?><br />

    Plugin Contributor fireproofsocks

    (@fireproofsocks)

    There’s the wrapper and default output filters that help hide empty values. One reason this gets hairy is you end up putting a ton of logic into your view layer.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Possible to filter custom fields displayed based on "tags"?’ is closed to new replies.