We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Custom member fileds value

Development and Programming

hbsinternet's avatar
hbsinternet
24 posts
9 years ago
hbsinternet's avatar hbsinternet

Hi Support

We have created custom filed “business_type” using option “Members->Members fields” in c panel.

We are trying to achieve this fileds value using code in template file :

{exp:member:custom_profile_data}
{business_type}
{/exp:member:custom_profile_data}

But it’s not returning any value it’s just displaying as a string “{business_type}” in front end.

Note: We have installed MSM(multiple site manager) in our site

Please check and advise

Thanks

       
Ingmar Greil's avatar
Ingmar Greil
29,243 posts
9 years ago
Ingmar Greil's avatar Ingmar Greil

Is that the only tag in your template? Try a reduction test with just that snippet of code.

       
hbsinternet's avatar
hbsinternet
24 posts
9 years ago
hbsinternet's avatar hbsinternet

Thanks Ingmar

Yes, the above tag is in my template. I have also tried it with using snippet but it’s returning same result.

Please check and advise

       
hbsinternet's avatar
hbsinternet
24 posts
9 years ago
hbsinternet's avatar hbsinternet

We have solved this issue using snippet, created a snippet name “b_type” and added the code below:

{exp:member:custom_profile_data}
{exp:query sql="SELECT md.m_field_id_1 AS business_type FROM exp_member_data AS md WHERE md.member_id = '{member_id}'" }{business_type}{/exp:query}
{/exp:member:custom_profile_data}

We have call this snippet in template file and get the value 😊

       
Ingmar Greil's avatar
Ingmar Greil
29,243 posts
9 years ago
Ingmar Greil's avatar Ingmar Greil
Yes, the above tag is in my template.

My suggestion was to put only this tag in your template, even though it seems that you’ve solved the issue already.

       
hbsinternet's avatar
hbsinternet
24 posts
9 years ago
hbsinternet's avatar hbsinternet

I am not getting it properly. Yor are saying about this tag {business_type} ?

       
Ingmar Greil's avatar
Ingmar Greil
29,243 posts
9 years ago
Ingmar Greil's avatar Ingmar Greil

I am saying that you should create a new template for testing, and put nothing but (=only) this in it:

{exp:member:custom_profile_data member_id="1"}
{business_type}
{/exp:member:custom_profile_data}

But, whatever works for you.

       
hbsinternet's avatar
hbsinternet
24 posts
9 years ago
hbsinternet's avatar hbsinternet

I had already done this but in front end it was same result.

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.