Startseite
  • » Home
  • » Handbuch & FAQ
  • » Forum
  • » Übersetzungsserver
  • » Suche
Startseite › Forum › Drupalcenter.de › Themes & Theming ›

Zugriff auf $account | $profile in user-profile.tpl.php

Eingetragen von grin@drupal.org (5)
am 13.02.2009 - 02:13 Uhr in
  • Themes & Theming
  • Drupal 6.x

Hallo erstmal!

Ich möchte das Layout der Profilseite verändern und dazu die Kategorien, bzw. Felder einzeln aufrufen.
Innerhalb von $account geht das auch recht gut, siehe

<?php print $account->signature; ?>

Ich komme aber bei den in $account enthaltenen Arrays nicht weiter. In der user-profile.tpl.php möchte ich mir z.B. das Profilefeld "Persönliche Nachricht" ausgeben lassen

<?php print check_plain($account->psm); ?>

Der Code liefert "www.gddu.net" zurück, jedoch ohne den 'Titel' des Feldes [#title] => Persönliche Nachricht .

Habe mich schon dumm und dämlich gesucht und hoffe, ihr könnt mir helfen.

Mfg
grin

Habe mir mal über <?php print check_plain(print_r($account, 1)); ?> alles ausgeben lassen:

stdClass Object
(
    [uid] => 1
    [name] => GRiNREAPER
    [pass] => ///
    [mail] => ///
    [mode] => 0
    [sort] => 0
    [threshold] => 0
    [theme] =>
    [signature] => Hihi haha hoho
    [created] => 1227736365
    [access] => 1234483674
    [login] => 1234311925
    [status] => 1
    [timezone] => 3600
    [language] => en
    [picture] => sites/default/files/pictures/user_pics/picture-1.jpg
    [init] => ///
    [data] => ///
    [guestbook_visited] => 1234127109
    [guestbook_status] => 0
    [guestbook_send_email] => 0
    [guestbook_intro] =>
    [picture_delete] => 0
    [picture_upload] =>
    [contact] => 1
    [form_build_id] => form-8a077ded34ab2fca116ef27af725bc57
    [user_title] => Administrator
    [block] => Array
        (
            [block] => Array
                (
                    [1] => 1
                )

        )

    [roles] => Array
        (
            [2] => authenticated user
        )

    [profile_details_street] => Privatstraße
    [profile_details_number] => 4
    [profile_details_residence] => Berlin
    [profile_details_plz] => 1xxxx
    [display_name] => GRiNREAPER
    [psm] => www.gddu.net
    [user_login_count] => 2
    [user_ip_address] => 127.0.0.1
    [user_post_count] => 3
    [userreference] => Array
        (
        )

    [realname] => GRiNREAPER
    [realname_save] => admin
    [content] => Array
        (
            [user_picture] => Array
                (
                    [#weight] => -10
                    [#value] => <div class="picture">
  <a href="/drupal/user/1" title="View user profile." class="active"><img src="http://localhost/drupal/sites/default/files/pictures/user_pics/picture-1.jpg" alt="GRiNREAPER&#039;s picture" title="GRiNREAPER&#039;s picture"  /></a></div>

                    [#title] =>
                    [#description] =>
                    [#printed] => 1
                )

            [user_titles] => Array
                (
                    [#required] =>
                    [#tree] =>
                    [#parents] => Array
                        (
                        )

                    [#attributes] => Array
                        (
                        )

                    [#description] =>
                    [#title] => User title
                    [title] => Array
                        (
                            [#tree] =>
                            [#parents] => Array
                                (
                                )

                            [#required] =>
                            [#attributes] => Array
                                (
                                )

                            [#value] => Administrator
                            [#description] =>
                            [#type] => user_profile_item
                            [#title] =>
                            [#printed] => 1
                        )

                    [#type] => user_profile_category
                    [#children] => <dt></dt>
<dd>Administrator</dd>

                    [#printed] => 1
                )

            [Persönliche Angaben] => Array
                (
                    [display_name] => Array
                        (
                            [#required] =>
                            [#tree] =>
                            [#parents] => Array
                                (
                                )

                            [#description] =>
                            [#attributes] => Array
                                (
                                    [class] => profile-display_name
                                )

                            [#title] => Anzeigename
                            [#value] => GRiNREAPER
                            [#weight] => -10
                            [#type] => user_profile_item
                            [#printed] => 1
                        )

                    [psm] => Array
                        (
                            [#required] =>
                            [#tree] =>
                            [#parents] => Array
                                (
                                )

                            [#description] =>
                            [#attributes] => Array
                                (
                                    [class] => profile-psm
                                )

                            [#title] => Persönliche Nachricht
                            [#value] => www.gddu.net
                            [#weight] => -5
                            [#type] => user_profile_item
                            [#printed] => 1
                        )

                    [#tree] =>
                    [#required] =>
                    [#parents] => Array
                        (
                        )

                    [#description] =>
                    [#title] => Persönliche Angaben
                    [#type] => user_profile_category
                    [#attributes] => Array
                        (
                        )

                    [#children] => <dt class="profile-display_name">Anzeigename</dt>
<dd class="profile-display_name">GRiNREAPER</dd>
<dt class="profile-psm">Persönliche Nachricht</dt>
<dd class="profile-psm">www.gddu.net</dd>

                    [#printed] => 1
                )

            [Details] => Array
                (
                    [#description] =>
                    [#attributes] => Array
                        (
                        )

                    [#required] =>
                    [#type] => user_profile_category
                    [#parents] => Array
                        (
                        )

                    [#title] => Details
                    [#tree] =>
                    [profile_details_street] => Array
                        (
                            [#required] =>
                            [#tree] =>
                            [#parents] => Array
                                (
                                )

                            [#description] =>
                            [#attributes] => Array
                                (
                                    [class] => profile-profile_details_street
                                )

                            [#title] => Strasse
                            [#value] => Privatstraße
                            [#weight] => 1
                            [#type] => user_profile_item
                            [#printed] => 1
                        )

                    [profile_details_number] => Array
                        (
                            [#required] =>
                            [#tree] =>
                            [#parents] => Array
                                (
                                )

                            [#description] =>
                            [#attributes] => Array
                                (
                                    [class] => profile-profile_details_number
                                )

                            [#title] => Hausnummer
                            [#value] => 4
                            [#weight] => 2
                            [#type] => user_profile_item
                            [#printed] => 1
                        )

                    [profile_details_plz] => Array
                        (
                            [#required] =>
                            [#tree] =>
                            [#parents] => Array
                                (
                                )

                            [#description] =>
                            [#attributes] => Array
                                (
                                    [class] => profile-profile_details_plz
                                )

                            [#title] => Postleitzahl
                            [#value] => 1xxxx
                            [#weight] => 3
                            [#type] => user_profile_item
                            [#printed] => 1
                        )

                    [profile_details_residence] => Array
                        (
                            [#required] =>
                            [#tree] =>
                            [#parents] => Array
                                (
                                )

                            [#description] =>
                            [#attributes] => Array
                                (
                                    [class] => profile-profile_details_residence
                                )

                            [#title] => Wohnort
                            [#value] => Berlin
                            [#weight] => 4
                            [#type] => user_profile_item
                            [#printed] => 1
                        )

                    [#children] => <dt class="profile-profile_details_street">Strasse</dt>
<dd class="profile-profile_details_street">Privatstraße</dd>
<dt class="profile-profile_details_number">Hausnummer</dt>
<dd class="profile-profile_details_number">4</dd>
<dt class="profile-profile_details_plz">Postleitzahl</dt>
<dd class="profile-profile_details_plz">1xxxx</dd>
<dt class="profile-profile_details_residence">Wohnort</dt>
<dd class="profile-profile_details_residence">Berlin</dd>

                    [#printed] => 1
                )

            [summary] => Array
                (
                    [#description] =>
                    [#required] =>
                    [#tree] =>
                    [#parents] => Array
                        (
                        )

                    [guestbook] => Array
                        (
                            [#required] =>
                            [#tree] =>
                            [#parents] => Array
                                (
                                )

                            [#description] =>
                            [#attributes] => Array
                                (
                                    [class] => guestbook
                                )

                            [#title] => Guestbook
                            [#value] => <a href="/drupal/user/1/guestbook" title="Read GRiNREAPER&#039;s guestbook.">View recent guestbook entries</a>
                            [#type] => user_profile_item
                            [#printed] => 1
                        )

                    [member_for] => Array
                        (
                            [#required] =>
                            [#tree] =>
                            [#parents] => Array
                                (
                                )

                            [#attributes] => Array
                                (
                                )

                            [#description] =>
                            [#title] => Member for
                            [#value] => 11 weeks 1 day
                            [#type] => user_profile_item
                            [#printed] => 1
                        )

                    [#type] => user_profile_category
                    [#attributes] => Array
                        (
                            [class] => user-member
                        )

                    [#weight] => 5
                    [#title] => History
                    [blog] => Array
                        (
                            [#required] =>
                            [#tree] =>
                            [#parents] => Array
                                (
                                )

                            [#description] =>
                            [#attributes] => Array
                                (
                                    [class] => blog
                                )

                            [#title] => Blog
                            [#value] => <a href="/drupal/blog/1" title="Read GRiNREAPER&#039;s latest blog entries.">View recent blog entries</a>
                            [#type] => user_profile_item
                            [#printed] => 1
                        )

                    [#children] => <dt class="guestbook">Guestbook</dt>
<dd class="guestbook"><a href="/drupal/user/1/guestbook" title="Read GRiNREAPER&#039;s guestbook.">View recent guestbook entries</a></dd>
<dt>Member for</dt>
<dd>11 weeks 1 day</dd>
<dt class="blog">Blog</dt>
<dd class="blog"><a href="/drupal/blog/1" title="Read GRiNREAPER&#039;s latest blog entries.">View recent blog entries</a></dd>

                    [#printed] => 1
                )

        )

)

‹ Problem mit Themes Benutzeranmeldung: Wie Label Bezeichner "Benutzername" und "Passwort" entfernen? ›
  • Anmelden oder Registrieren um Kommentare zu schreiben

Ausgabe

Eingetragen von stBorchert (6003)
am 13.02.2009 - 10:02 Uhr

Moin!

grin@drupal.org schrieb

In der user-profile.tpl.php möchte ich mir z.B. das Profilefeld "Persönliche Nachricht" ausgeben lassen
<?php print check_plain($account->psm); ?>
Der Code liefert "www.gddu.net" zurück, jedoch ohne den 'Titel' des Feldes [#title] => Persönliche Nachricht.

Ok, ausgehend von Deiner Debug-Ausgabe (sehr hilfreich übrigens!) kannst Du den Titel so ausgeben:

<?php
$personalInfo
= $account->content[t('Persönliche Angaben')];
print
$personalInfo['psm']['#title'] .': '. $account->psm;
?>

hth,

 Stefan

  • Anmelden oder Registrieren um Kommentare zu schreiben

Geht leider nicht..

Eingetragen von grin@drupal.org (5)
am 14.02.2009 - 00:13 Uhr
Zitat:

Ok, ausgehend von Deiner Debug-Ausgabe (sehr hilfreich übrigens!) kannst Du den Titel so ausgeben:

<?php
$personalInfo
= $account->content[t('Persönliche Angaben')];
print
$personalInfo['psm']['#title'] .': '. $account->psm;
?>

Geht leider nicht, ausgegeben wird nur:

:www.gddu.net

Ein Test auf <?php print $personalInfo; ?> erbrachte auch nichts, dann versuchte ich <?php print $account->content[t('Persönliche Angaben')]; ?> direkt auszugeben - wieder nichts..

Irgendeine Idee?

Mfg
grin

  • Anmelden oder Registrieren um Kommentare zu schreiben

Problem erkannt - Bug?

Eingetragen von grin@drupal.org (5)
am 14.02.2009 - 01:07 Uhr

Ich habe mal die Felder [psm] und [display_name] einer neuen Kategorie zugewiesen namens [Personal Info].

Daraufhin wird über

<?php
$personalInfo
= $account->content[t('Personal Info')];
print
$personalInfo['psm']['#title'];
?>

der Titel des Feldes korrekt ausgegeben. Daraufhin habe ich mit verschiedenen Wortkombinationen (für Kategorie) getestet. Das Problem sind die Umlaute ('a', 'ö', ..).

Ist das jetzt ein Bug?

  • Anmelden oder Registrieren um Kommentare zu schreiben

Benutzeranmeldung

  • Registrieren
  • Neues Passwort anfordern

Aktive Forenthemen

  • für drupal11 ein Slider Modul
  • [gelöst] W3CSS Paragraphs Views
  • Drupal 11 neu aufsetzen und Bereiche aus 10 importieren
  • Wie erlaubt man neuen Benutzern auf die Resetseite zugreifen zu dürfen.
  • [gelöst] Anzeigeformat Text mit Bild in einem Artikel, Drupal 11
  • Social Media Buttons um Insteragram erweitern
  • Nach Installation der neuesten D10-Version kein Zugriff auf Website
  • Composer nach Umzug
  • [gelöst] Taxonomie Begriffe zeigt nicht alle Nodes an
  • Drupal 11 + Experience Builder (Canvas) + Layout Builder
  • Welche KI verwendet ihr?
  • Update Manger läst sich nicht Installieren
Weiter

Neue Kommentare

  • melde mich mal wieder, da ich
    vor 2 Wochen 1 Stunde
  • Hey danke
    vor 2 Wochen 20 Stunden
  • Update: jetzt gibt's ein
    vor 2 Wochen 1 Tag
  • Hallo, im Prinzip habe ich
    vor 2 Wochen 6 Tagen
  • Da scheint die Terminologie
    vor 2 Wochen 6 Tagen
  • Kannst doch auch alles direkt
    vor 3 Wochen 3 Tagen
  • In der entsprechenden View
    vor 3 Wochen 3 Tagen
  • Dazu müsstest Du vermutlich
    vor 3 Wochen 3 Tagen
  • gelöst
    vor 5 Wochen 6 Tagen
  • Ja natürlich. Dass ist etwas,
    vor 6 Wochen 20 Stunden

Statistik

Beiträge im Forum: 250233
Registrierte User: 20451

Neue User:

  • ByteScrapers
  • Mroppoofpaync
  • 4aficiona2

» Alle User anzeigen

User nach Punkten sortiert:
wla9461
stBorchert6003
quiptime4972
Tobias Bähr4019
bv3924
ronald3857
md3717
Thoor3678
Alexander Langer3416
Exterior2903
» User nach Punkten
Zur Zeit sind 0 User und 25 Gäste online.

Hauptmenü

  • » Home
  • » Handbuch & FAQ
  • » Forum
  • » Übersetzungsserver
  • » Suche

Quicklinks I

  • Infos
  • Drupal Showcase
  • Installation
  • Update
  • Forum
  • Team
  • Verhaltensregeln

Quicklinks II

  • Drupal Jobs
  • FAQ
  • Drupal-Kochbuch
  • Best Practice - Drupal Sites - Guidelines
  • Drupal How To's

Quicklinks III

  • Tipps & Tricks
  • Drupal Theme System
  • Theme Handbuch
  • Leitfaden zur Entwicklung von Modulen

RSS & Twitter

  • Drupal Planet deutsch
  • RSS Feed News
  • RSS Feed Planet
  • Twitter Drupalcenter
Drupalcenter Team | Impressum & Datenschutz | Kontakt
Angetrieben von Drupal | Drupal is a registered trademark of Dries Buytaert.
Drupal Initiative - Drupal Association