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 - 15: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 - 15: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 - 18: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 - 18: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 - 19: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

  • Entity Reference - Title Felder werden als Link angezeigt
  • Tokens werden in Viev als Link angezeigt
  • Drupal Website gestalten
  • [bug entdeckt & workaround gefunden] benutzerdefinierte Felder vom Userprofil tauchen ungefragt auch in den Forumtopics auf...
  • [gelöst] Mass contact Empfängerliste nach Taxonomy Term statt Rolle
  • Update V. 9.3.12 auf V. 9.4 mit Fehler: Modul mySQL fehlt. Bitte Hilfe.
  • Sprachpfad, in Drupal Korrekt einstellen, auch bei den Meta-Tags
  • Update von Drupal 9.3 auf 9.4 oder bei 9.3 bleiben
  • Terminverwaltung
  • Views in Seite einbetten
  • Hilfe! Nach Update auf 7.90 zeigt User reference (Kontrollkästchen/Auswahlknöpfe) nicht mehr vollständig an
  • ("Gelöst,...") Das Deinstallieren eines Content typen, der keinen Content hat, ist nicht möglich.
Weiter

Neue Kommentare

  • Ah, ok. Wenn es ein Paragraph
    vor 1 Stunde 17 Minuten
  • Also kleiner Nachtrag noch:
    vor 2 Stunden 6 Minuten
  • In der View gibt es einen
    vor 4 Stunden 39 Minuten
  • Kann ich euch gerne mit
    vor 16 Stunden 19 Minuten
  • ursache gefunden
    vor 1 Tag 3 Stunden
  • nun wirds erst richtig lustig...
    vor 1 Tag 4 Stunden
  • ursache weiter eingegrenzt
    vor 1 Tag 9 Stunden
  • Nein, das war es nicht. S. o.
    vor 4 Tagen 9 Stunden
  • Eventuell hier ein Hinweis?
    vor 4 Tagen 10 Stunden
  • Lösung gefunden
    vor 2 Tagen 20 Stunden

Statistik

Beiträge im Forum: 247853
Registrierte User: 19585

Neue User:

  • Tkakah
  • JeraldFub
  • andycrestodina

» Alle User anzeigen

User nach Punkten sortiert:
wla9212
stBorchert6003
quiptime4972
Tobias Bähr4019
bv3924
ronald3845
md3717
Thoor3678
Alexander Langer3416
Exterior2903
» User nach Punkten
Zur Zeit sind 0 User und 4 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