Major problem

Unable to override theme_more_link - Drupal 7

Description of Erratum

  • I followed the instructions provided in the book, but when I clear my cache nothing changes. I have attempted to code the code from another template and still have the same issue. I have attempted to Google a solution but I have as of yet to find a solution.

    <?php
    /**
    * Overrides theme_more_link().
    * - Changed the text from "More" to "Show me More"
    * - Changed the class from "more-link" to "more"
    */
    function dgd7_more_link($variables) {
    return '<div class="more">' . l(t('Show me MORE!'), $variables['url'], array('attributes' => array('title' => $variables['title']))) . '</div>';
    }
  • hook_theme() Implementation for Using Templates with Forms

    Description of Erratum

  • The code in listing 16-30 doesn't seem to be working at all. I'm working on Linux(Ubuntu). There is the code here:
    <?php
    /**
    * Implements hook_theme().
    */
    function mytheme_theme() {
    return array(
    'contact_site_form' => array(
    'render element' => 'form',
    'path' => drupal_get_path('theme', 'mytheme') . '/templates',
    'template' => 'contact-site-form',
    ),
    );
    }

  • Recommended Correction

  • I've got no idea.

  • Implementing theme_contact_site_form()

    Description of Erratum

  • listing 16-29: The code doesn't seem to be working at all. I'm working on Linux (Ubuntu); there is the code here:
    <?php
    /**
    * Implements theme_contact_site_form().
    */
    function dgd7_contact_site_form($variables) {
    // Hide the subject field. It's not required.
    hide($variables['form']['subject']);
    // Change the labels of the "name" and "mail" textfields.
    $variables['form']['name']['#title'] = t('Name');
    $variables['form']['mail']['#title'] = t('E-mail');
    // Create output any way you want.
    $output = '';
    $output .= ''. t("We'd love hear from you. Expect to hear back from us in 1-2 business days.") .'';
    $output .= render($variables['form']['name']);
    $output .= render($variables['form']['mail']);
    $output .= '';
    // Be sure to include a rendered version of the remaining form items.
    $output .= drupal_render_children($variables['form']);
    // Return the output.
    return $output;
    }

  • Recommended Correction

  • I can't figure out what's wrong with it. Any ideas? Many thanks for responses.

  • Example code doesn't work

    Description of Erratum

  • theme('xray_help', array('text' => $output));
    Does not return anything, and therefore causes function _xray_help_admin_appearance() to return nothing as well, generating no help text. (at least in drupal 7.9).

  • Recommended Correction

  • I have no idea 8).

  • Subscribe to Major problem