Startseite
  • » Home
  • » Handbuch & FAQ
  • » Forum
  • » Übersetzungsserver
  • » Suche
Startseite › Forum › Drupalcenter.de › Module › Modulsuche ›

(gelöst) Gibt es ein Modul, mit dem man die User Profile Seite einfach customizen kann?

Eingetragen von beaschmitz (469)
am 05.03.2011 - 12:18 Uhr in
  • Modulsuche
  • Drupal 6.x

bin nicht so fit im pogramieren und deshalb auf der suche nach einer fertigen lösung... gibt es sowas oder muss ich tatsächlich an die user_profile.tpl.php ran, erstellen und bearbeiten??
danke

‹ Rechnung online erstellen bei ubercart/drupal Node mit Referenzen auf Felder anderer Inhaltstypen ›
  • Anmelden oder Registrieren um Kommentare zu schreiben

Um die volle Kontrolle über

Eingetragen von SteffenR@drupal.org (2262)
am 09.03.2011 - 11:00 Uhr

Um die volle Kontrolle über die Ausgabe zu haben, wäre schon ein Eingriff in die user-profile.tpl.php nötig. Du kannst einfachere Änderungen ( Positionierung / Farbigkeiten etc) natürlich auch erstmal mithilfe von CSS realisieren.

SteffenR

  • Anmelden oder Registrieren um Kommentare zu schreiben

Oder Du entfernst die

Eingetragen von Ionit (1802)
am 09.03.2011 - 12:57 Uhr

Oder Du entfernst die $profile-Variable aus der user-profile.tpl.php und gibst sämtlichen Profile-Content über diverse Views-Blöcke aus (so mache ich das).

Mein Profile-Content ist auf 7 - 10 Blöcke verteilt.

Gruß Matthias

  • Anmelden oder Registrieren um Kommentare zu schreiben

Hallo LONIT, wenn ich die

Eingetragen von beaschmitz (469)
am 27.04.2011 - 13:51 Uhr

Hallo LONIT,
wenn ich die $profile variable entferne, dann kann ich die Variablen ja auch einfach ausgeben (wie in dem Mustardseed Video erklärt), wie aber (bzw. was schreibe ich, wenn ich einen Block printen will?) gebe ich einen Block aus?
Ich hoffe Du antwortest mir, auch wenn Du vielleicht verärgert bist?!
DANKE

PS: es kann natürlich auch jemand anderes antworten :)))

  • Anmelden oder Registrieren um Kommentare zu schreiben

beaschmitz schrieb wie aber

Eingetragen von Thoor (3678)
am 27.04.2011 - 15:20 Uhr
beaschmitz schrieb

wie aber (bzw. was schreibe ich, wenn ich einen Block printen will?) gebe ich einen Block aus?

-> http://drupal.org/node/499274

  • Anmelden oder Registrieren um Kommentare zu schreiben

Na ganz einfach. Du legst

Eingetragen von Ionit (1802)
am 27.04.2011 - 15:37 Uhr

Na ganz einfach. Du legst einen View, mit den entsprechende Feldern, an, erstellst davon einen Block und schiebst den Block unter "admin/build/block" in die entsprechende Region. Sichtbarkeiten anpassen - fertig.

Oder Du machst es so wie in dem Link von Thoor beschrieben wird.

  • Anmelden oder Registrieren um Kommentare zu schreiben

ok, verstehe, wenn ich also

Eingetragen von beaschmitz (469)
am 27.04.2011 - 20:53 Uhr

ok, verstehe, wenn ich also das print profile entfern, dann kommt ja auch nichts, bzw. es wird nichts geschrieben und wenn ich dann einfach die views/blöcke "einhänge" dann sieht man diese?! ok, ich gaube ich komme gedanklich mit.... ich muss mal alles ausprobieren und stelle die frage erst einmal auf gelöst....

ich hab beim surfen im netz auch noch folgendes gefunden (auch noch nicht ausprobiert)......vielleicht geht das auch, oder ist so ähnlich wie das von thoor gelinkte:
-------------------------------------------------------
Add Block Regions to your User Profile page in Drupal 5 and 6

Tags
Here's a small snippet to allow the output of blocks in your user profiles. This is assuming that you are currently over-riding the user page with the following code.
Update!I've added code for both Drupal 5 and 6, take a look.

DRUPAL 5

<?php
/**
* Catch the theme_user_profile function, and redirect through the template api
*/
function phptemplate_user_profile($user, $fields = array()) {
// Pass to phptemplate, including translating the parameters to an associative array. The element names are the names that the variables
// will be assigned within your template.
/* potential need for other code to extract field info */
return _phptemplate_callback('user_profile', array('user' => $user, 'fields' => $fields));
}
?>

(Code from: http://drupal.org/node/35728 )

and have your user_profile.tpl.php named as so.

SETTINGS UP YOUR BLOCK REGIONS:
First we'll slip into our theme's template.php file and make sure we create a new region.

<?php
function basic_regions() {
return array(
'sidebar_left' => t('left sidebar'),
'sidebar_right' => t('right sidebar'),
'content_top' => t('content top'),
'content_bottom' => t('content bottom'),
'header' => t('header'),
'footer_block' => t('footer'),
'profile_block' => t('profile blocks'),
);
}
?>

This allows us to create a new region called profile block which will hold all our blocks that we decide to put there. Now we want to be able to pass the $profile_block variable onto our user_profile.tpl.php to be outputted.

ADDING THE BLOCK VARIABLES:

<?php
function _phptemplate_variables($hook, $vars = array()) {
switch (
$hook) {
case
'user_profile':
$vars['profile_block'] = theme('blocks', 'profile_block');
break;
}
return
$vars;
}
?>

Now we can go into our user_profile.tpl.php and add the following code anywhere in the file. This is where our newly created block region will be outputted.

<?php
echo $profile_block;
?>

DRUPAL 6
In your themename.info file (themename being replaced by your actual theme name) add your block region.

(In our themename.info)

<?php
regions
[profile_block] = Profile Block
?>

We now create our user-profile.tpl.php file where we will output the block region and any other profile information that we need. To expose the $profile_block variable to our user-profile.tpl.php, we add the following code to our template.php file:

(In our template.php)

<?php
function phptemplate_preprocess_user_profile(&$variables) {
$variables['profile'] = array();
// Sort sections by weight
uasort($variables['account']->content, 'element_sort');
// Provide keyed variables so themers can print each section independantly.
foreach (element_children($variables['account']->content) as $key) {
$variables['profile'][$key] = drupal_render($variables['account']->content[$key]);
}
// Collect all profiles to make it easier to print all items at once.
$variables['user_profile'] = implode($variables['profile']);
$variables['profile_block'] = theme('blocks', 'profile_block');
}
?>

( Structure taken from: http://api.drupal.org/api/function/template_preprocess_user_profile/6 )
Note the added $variables['profile_block'] = theme('blocks', 'profile_block'); at the end. This allows us to access the block region, profile_block, by echoing out $profile_block in our user-profile.tpl.php file like so:

(In our user-profile.tpl.php)

<?php
echo $profile_block;
?>

Voila! Block regions in our user profile template file!

  • Anmelden oder Registrieren um Kommentare zu schreiben

Benutzeranmeldung

  • Registrieren
  • Neues Passwort anfordern

Aktive Forenthemen

  • Medien und andere Daten mit Feeds von Drupal 7 auf Drupal 10 migrieren
  • 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?
Weiter

Neue Kommentare

  • Inzwischen sind wir bei
    vor 4 Tagen 8 Stunden
  • Migrieren von D7 auf D8/ D10/ D11
    vor 5 Tagen 23 Minuten
  • melde mich mal wieder, da ich
    vor 8 Wochen 2 Tagen
  • Hey danke
    vor 8 Wochen 2 Tagen
  • Update: jetzt gibt's ein
    vor 8 Wochen 3 Tagen
  • Hallo, im Prinzip habe ich
    vor 9 Wochen 1 Tag
  • Da scheint die Terminologie
    vor 9 Wochen 1 Tag
  • Kannst doch auch alles direkt
    vor 9 Wochen 5 Tagen
  • In der entsprechenden View
    vor 9 Wochen 5 Tagen
  • Dazu müsstest Du vermutlich
    vor 9 Wochen 5 Tagen

Statistik

Beiträge im Forum: 250235
Registrierte User: 20463

Neue User:

  • marouane.blel
  • capilclinic
  • Quabzibboter

» 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