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

block element wird nicht angezeigt bei modul erstellung!

Eingetragen von Trasher (87)
am 04.11.2007 - 14:09 Uhr in
  • Module
  • Drupal 5.x

hi@all

ich bin ein "noob" oder wie auch immer in drupal.

Ich wollte nen stink normal block mit content erstellen. Ich habe die von http://api.drupal.org/api/function/block_example_block/5 1zu1 den code übernohmen!

Es befindet sich kein block auf der Seite. Modul lässt sich ein einschalten usw. allerdings kein block!

<?php


function block_example_block($op = 'list', $delta = 0, $edit = array()) {
  switch (
$op) {
    case
'list':
     
// If $op is "list", we just need to return a list of block descriptions.
      // This is used to provide a list of possible blocks to the administrator,
      // end users will not see these descriptions.
     
$blocks[0]['info'] = t('Example: configurable text string');
     
$blocks[1]['info'] = t('Example: empty block');
      return
$blocks;
    case
'configure':
     
// If $op is "configure", we need to provide the administrator with a
      // configuration form. The $delta parameter tells us which block is being
      // configured. In this example, we'll allow the administrator to customize
      // the text of the first block.
     
$form = array();
      if (
$delta == 0) {
       
// All we need to provide is a text field, Drupal will take care of
        // the other block configuration options and the save button.
       
$form['block_example_string'] = array(
         
'#type' => 'textfield',
         
'#title' => t('Block contents'),
         
'#size' => 60,
         
'#description' => t('This string will appear in the example block.'),
         
'#default_value' =>
           
variable_get('block_example_string',  t('Some example content.')),
        );
      }
      return
$form;
    case
'save':
     
// If $op is "save", we need to save settings from the configuration form.
      // Since the first block is the only one that allows configuration, we
      // need to check $delta to make sure we only save it.
     
if ($delta == 0) {
       
// Have Drupal save the string to the database.
       
variable_set('block_example_string', $edit['block_example_string']);
      }
      return;
    case
'view': default:
     
// If $op is "view", then we need to generate the block for display
      // purposes. The $delta parameter tells us which block is being requested.
     
switch ($delta) {
        case
0:
         
// The subject is displayed at the top of the block. Note that it
          // should be passed through t() for translation.
         
$block['subject'] = t('Title of block #1');
         
// The content of the block is typically generated by calling a custom
          // function.
         
$block['content'] = block_example_contents(1);
          break;
        case
1:
         
$block['subject'] = t('Title of block #2');
         
$block['content'] = block_example_contents(2);
          break;
      }
      return
$block;
  }
}
   
?>

danke schon mal im voraus

‹ OG Forum fehler Acidfree und Taxonomy ›
  • Anmelden oder Registrieren um Kommentare zu schreiben

Zitat:http://drupal.org/pro

Eingetragen von quiptime (4972)
am 04.11.2007 - 14:56 Uhr
Zitat:

Es befindet sich kein block auf der Seite. Modul lässt sich ein einschalten usw. allerdings kein block!

Erklaer das bitte genauer.

-------------
quiptime

Nur tote Fische schwimmen mit dem Strom.

XING

Da geht noch was.

  • Anmelden oder Registrieren um Kommentare zu schreiben

also ich will einen block

Eingetragen von Trasher (87)
am 04.11.2007 - 17:32 Uhr

also ich will einen block erstellen mit content! Ich habe nun wie gesagt den code aus drupal.org handbook genohmen und eingepflanzt. Nun erwarte ich das ich einen Block kriege.

Das problem ist, ich kriege keinen block raus!

Hast du eine idee bzw. einen 100% funktionierenden code wie ich ein einfaches block mit content ausgeben kann?

  • Anmelden oder Registrieren um Kommentare zu schreiben

module

Eingetragen von dawehner (2639)
am 04.11.2007 - 17:34 Uhr

module http://drupal.pastebin.com/m326b7d95
info http://drupal.pastebin.com/m585d6a30
Also bei mir gings :)

  • Anmelden oder Registrieren um Kommentare zu schreiben

Wie ist das mit dem Blockcontent?

Eingetragen von quiptime (4972)
am 04.11.2007 - 18:23 Uhr

Den Hintergrund verstehe ich nicht.

Wie soll dann am Ende Content in den Block kommen? Eher dynamisch oder statisch?
Statisch: Block erstellt, Content drin und gut is.
Dynamisch: Der Content im Block aendert sich oft. Wie wenn man einen neuen Artikel erstellt?

In Abhaengigkeit der Contentnutzung des Blockes wuerde ich die Loesung suchen.

Also, wie ist das mit dem Blockcontent?

-------------
quiptime

Nur tote Fische schwimmen mit dem Strom.

XING

Da geht noch was.

  • Anmelden oder Registrieren um Kommentare zu schreiben

Benutzeranmeldung

  • Registrieren
  • Neues Passwort anfordern

Aktive Forenthemen

  • lqunojlhtnjh
  • Meldung zu Token im Statusbericht
  • Fehlermeldung: Deprecated function
  • Versenden von Anfragen per Webform
  • Goodbye Online Drupal Meetup Germany - Hello Drupal DACH Online Meetup!
  • Übersetzte Felder bei Inhaltstyp automatisch übernehmen
  • Content Ex-/Import
  • RESTful Path request will nicht
  • Modulupdate per Webinterace scheitert an authorize.php und access denied für Admin-User
  • Wer ist online Block
  • Doppelte Anzeige von Node im View
  • URL-Alias von bestehendem Link wird gelöscht und auf -0 gesetzt 404 Fehler entsteht
Weiter

Neue Kommentare

  • Gut zu wissen. Demnächst
    vor 12 Stunden 52 Minuten
  • Token Fehler behoben
    vor 13 Stunden 12 Minuten
  • Du hast völlig recht, da habe
    vor 18 Stunden 9 Minuten
  • Link 404
    vor 21 Stunden 47 Minuten
  • Die Datei existiert ja auch
    vor 1 Tag 1 Stunde
  • Patch für Metatag
    vor 1 Tag 1 Stunde
  • Link auf Pfad/Menü eines View
    vor 1 Tag 1 Stunde
  • Die englische Übersetzung
    vor 1 Tag 3 Stunden
  • Genau das habe ich auch
    vor 2 Tagen 17 Minuten
  • Tja, das kann ich wirklich
    vor 2 Tagen 29 Minuten

Statistik

Beiträge im Forum: 245968
Registrierte User: 18827

Neue User:

  • rtyfivad
  • finnster
  • Damian1802

» Alle User anzeigen

User nach Punkten sortiert:
wla9010
stBorchert6003
quiptime4972
Tobias Bähr4019
bv3916
ronald3829
md3717
Thoor3678
Alexander Langer3416
Exterior2903
» User nach Punkten
Zur Zeit sind 1 Benutzer und 9 Gäste online.

Benutzer online

  • torfnase

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