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

  • Zusätzliche Felder in der Userliste
  • Drupal 8 - Datenbank Mindmap
  • Buch: Mastering Drupal 8 Views!
  • The website encountered an unexpected error. Please try again later.
  • Drupal 8: Modul gesucht - Hervorhebung wichtiger Inhalte
  • Drupal 8: Modul prevnext
  • Verwirrung / Unterstützung
  • Vom jeweiligen User die Kunstwerke ausgeben.
  • Problem mit der Readiness für Automatic Updates
  • Multidomain
  • [gelöst]Drupal 8: Fußzeilenmenü auf Login-Seite verschwunden
  • Fullcalendar - Grösse Dialogfenster
Weiter

Neue Kommentare

  • Ja, danke! Ich habe dieses
    vor 1 Tag 52 Minuten
  • Die View heißt "Benutzer". Du
    vor 1 Tag 12 Stunden
  • Danke! Was meint denn
    vor 1 Tag 18 Stunden
  • Dazu brauchst Du kein Modul,
    vor 1 Tag 19 Stunden
  • Das heißt in dem Fall, daß
    vor 1 Tag 19 Stunden
  • Voaraussetzung sind
    vor 1 Tag 19 Stunden
  • Huhu, also in der
    vor 1 Tag 19 Stunden
  • Das Problem ist, dass nicht
    vor 1 Tag 20 Stunden
  • Ohne Composer ist der Betrieb
    vor 1 Tag 20 Stunden
  • Kann gut sein, aber ohne
    vor 1 Tag 20 Stunden

Statistik

Beiträge im Forum: 246347
Registrierte User: 18915

Neue User:

  • Enriqueemunc
  • Tulsa55
  • Elisаhaf

» Alle User anzeigen

User nach Punkten sortiert:
wla9045
stBorchert6003
quiptime4972
Tobias Bähr4019
bv3919
ronald3834
md3717
Thoor3678
Alexander Langer3416
Exterior2903
» User nach Punkten
Zur Zeit sind 0 User und 5 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