Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9141479
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T09:39:01+00:00 2026-06-17T09:39:01+00:00

I´m trying to print the value Viviana wich is somewhere inside the profile node,

  • 0

I´m trying to print the value “Viviana” wich is somewhere inside the profile node, in a Drupal 7 installation. What I want is to print the field content that outputs the user name.

I´ve tried this option, but I´ve got errors: print $field_nombrecompleto1['und'][0]['value'];

The error was Notice: Undefined variable: field_nombrecompleto1 in /home/liga/public_html/sites/all/themes/liga/templates/user-profile.tpl.php on line 7

I´m posting the output (a little shortened) after using print_r().

Thanks for your help!

Array
(
    [template_file] => sites/all/themes/liga/templates/user-profile.tpl.php
    [variables] => Array
        (
            [elements] => Array
                (
                    [#pre_render] => Array
                        (
                            [0] => _field_extra_fields_pre_render
                            [1] => field_group_build_pre_render
                        )

                    [#entity_type] => user
                    [#bundle] => user
                    [#groups] => Array
                        (
                        )

                    [#fieldgroups] => Array
                        (
                        )

                    [#group_children] => Array
                        (
                        )

                    [#theme] => user_profile
                    [#account] => stdClass Object
                        (
                            [uid] => 78
                            [name] => milne
                            [pass] => U$S$9B.hwxhcWeayArrP8Y/qsNXj9SNMh6z5FaCjAebOq1UrYbQJ/uIR
                            [mail] => example@yahoo.com.ar
                            [theme] => 
                            [signature] => 
                            [signature_format] => 3
                            [created] => 1157654988
                            [access] => 1185380339
                            [login] => 1185380321
                            [status] => 1
                            [timezone] => 
                            [language] => es
                            [picture] => 
                            [init] => example@yahoo.com.ar
                                ...
                                ...
                                ...
                    [#view_mode] => full
                    [#language] => es
                    [#block] => stdClass Object
                        (
                            [module] => system
                            [delta] => main
                            [theme] => liga
                            [status] => 1
                            [weight] => -53
                            [region] => content
                            [custom] => 0
                            [visibility] => 0
                            [pages] => 
                            [title] => 
                            [bid] => 2154
                            [cache] => -1
                            [subject] => 
                        )

                    [#weight] => -53
                    [#theme_wrappers] => Array
                        (
                            [0] => block
                        )   
                        ...
                        ...
                        ...


                    [profile_alumnos] => Array
                        (
                            [#type] => user_profile_category
                            [#title] => Perfil Alumnos
                            [#prefix] => 
                            [view] => Array
                                (
                                    [profile2] => Array
                                        (
                                            [5] => Array
                                                (
                                                    [field_nombrecompleto1] => Array
                                                        (
                                                            [#theme] => field
                                                            [#weight] => 0
                                                            [#title] => nombrecompleto1
                                                            [#access] => 1
                                                            [#label_display] => hidden
                                                            [#view_mode] => account
                                                            [#language] => und
                                                            [#field_name] => field_nombrecompleto1
                                                            [#field_type] => text
                                                            [#field_translatable] => 0
                                                            [#entity_type] => profile2
                                                            [#bundle] => alumnos
                                                            [#object] => Profile Object
                                                                (
                                                                    [pid] => 5
                                                                    [type] => alumnos
                                                                    [label] => Perfil Alumnos
                                                                    [uid] => 78
                                                                    [created] => 1358457398
                                                                    [changed] => 1358457398
                                                                    [entityType:protected] => profile2
                                                                    [entityInfo:protected] => Array
                                                                        (
                                                                            [label] => Profile
                                                                            [plural label] => Profiles
                                                                            [description] => Profile2 user profiles.
                                                                            [entity class] => Profile
                                                                            [controller class] => EntityAPIController
                                                                            [base table] => profile
                                                                            [fieldable] => 1
                                                                            ...
                                                                            ...
                                                                            ...

                                                                    [field_nombrecompleto1] => Array
                                                                        (
                                                                            [und] => Array
                                                                                (
                                                                                    [0] => Array
                                                                                        (
                                                                                            [value] => Viviana
                                                                                            [format] => 
                                                                                            [safe_value] => Viviana
                                                                                        )

                                                                                )

                                                                        )

                                                                    [field_cursobasico1] => Array
                                                                        (
                                                                        )

                                                                    [field_telefonos1] => Array
                                                                        (
                                                                        )

                                                                    [field_zona1] => Array
                                                                        (
                                                                        )

                                                                    [entity_view_prepared] => 1
                                                                )

                                                            [#items] => Array
                                                                (
                                                                    [0] => Array
                                                                        (
                                                                            [value] => Viviana
                                                                            [format] => 
                                                                            [safe_value] => Viviana
                                                                        )

                                                                )
                                                                ...
                                                                ...
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T09:39:01+00:00Added an answer on June 17, 2026 at 9:39 am

    Looking at your output, you should try:

    print $your_var['variables']['elements']['profile_alumnos']['view']['profile2'][5]['field_nombrecompleto1']['#object']->field_nombrecompleto1['und'][0]['value'];
    

    Where $your_var is the variable you used for the print_r.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to print the value of the TextViews which are inside TableRows, using
I'm trying to print out value of the variable passed to the twig template.
I am trying to print a value of an array element as cout <<
I am trying to print a double value. It is printing in matissa and
I am trying to print value of a function variable in JSP Page. The
I am trying to print a value of type timeval. Actually I am able
I'm trying to print the value returned by the following code: Agent** Grid::GetAgent(int x,
I am trying to print a selected value, is this possible? Example: PRINT SELECT
Hello I am trying to print a specific value from an array of objects.
I'm trying to figure out how to print a value using switch-case base off

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.