ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Quick Question ... Thanks in advance.

September 25, 2008 4:10pm

Subscribe [2]
  • #1 / Sep 25, 2008 4:10pm

    gmg_admin

    14 posts

    Hi I was wondering if it’s possible to display the custom field names in my template.

    For example I know how to display content from a weblog entry using tags like {title} etc, but i don’t know if it’s possible to display the custom field title.

    Hope that makes sense. Thanks for lookin.

  • #2 / Sep 25, 2008 5:13pm

    gmg_admin

    14 posts

    Ok just to clarify

    I’m trying to display the custom field label and not just the content from the custom field.

    This would save me quite some time, as i’m thinking I have to make a custom field just for the title of the section, and that seems redundant to me.

  • #3 / Sep 25, 2008 5:15pm

    Ingmar

    29245 posts

    You can certainly pull the label out of the database directly, but there are no direct EE tags for that I am aware of.

  • #4 / Sep 25, 2008 5:28pm

    gmg_admin

    14 posts

    Yeah that seems like it would be difficult since i’m not a programmer. Thank you for the affirmative answer though. That saves me some time.

  • #5 / Sep 25, 2008 5:36pm

    Ingmar

    29245 posts

    Not difficult at all, I should think:

    {exp:query sql="SELECT field_label AS my_label FROM exp_weblog_fields 
    WHERE field_name = "body" AND group_id = "1" AND site_id = "1""}
    {my_label}
    {/exp:query}

    Something like that, anyway. Replace “body” and “group_id” as appropriate.

  • #6 / Sep 25, 2008 9:33pm

    gmg_admin

    14 posts

    ah that doesn’t look too bad. I’ll try it out. Thank you so much.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases