Skip to main content

Home/ Drupal for Developers/ Group items tagged templates

Rss Feed Group items tagged

Daniel Gregoire

Theming the User Registration Form in Drupal 6 | Trellon - 0 views

  • <?phpfunction themename_theme($existing, $type, $theme, $path) {  return array(    ...    // tell Drupal what template to use for the user register form    'user_register' => array(      'arguments' => array('form' => NULL),      'template' => 'user-register', // this is the name of the template    ),    ...  );}?>
  • <div id="registration_form">  <div class="field">    <?php      print drupal_render($form['account']['name']); // prints the username field    ?>  </div>  <div class="field">    <?php      print drupal_render($form['account']['pass']); // print the password field    ?>  </div>  <div class="field">    <?php        print drupal_render($form['submit']); // print the submit button      ?>    </div>  </div></div>
  • <?php  print '<pre>';  print var_export($form);  print '</pre>';?>
  • ...3 more annotations...
  • Don't forget to render hidden fields or it won't work ;) echo drupal_render($form['timezone']); echo drupal_render($form['form_build_id']); echo drupal_render($form['form_id']);
  • you also have to print the "token" in order to make the form work print drupal_render($form['form_token']);
  • From my own experience using a form tpl.php, you need to print the whole $form at the very end of the template to ensure that the form will validate upon submission. <?php print drupal_render($form); ?> Just adding the hidden form_build_id and the form_id fields will not mean the form will work. Printing the entire form at the end, however, will mean that all the stuff you wanted to hide in making the template will show. For those fields, include "unset" statements for each one: <?php unset($form['field_to_hide']); ?> Please correct me if I'm wrong or if there is a better way to do this.
Daniel Gregoire

How to define page callbacks that you don't want to render using page template in Drupa... - 1 views

  • Method 1 : Printing your stuff and exit
  • Method 2 : Printing your stuff and returning NULL
  •  
    Callbacks, and how to get just the output (without template calls, etc.).
Scott Blackburn

Making additional variables available to your templates | drupal.org - 0 views

  •  
    Making additional variables available to your templates
Bartłomiej Małysz

Drupal 5.x | Drupal Themes, Joomla Templates, PHPKIT Styles - 0 views

  •  
    nice themes for games like wow, guildwars, etc.
Scott Blackburn

Reducing the quantity of Views and template code | Ceardach - 0 views

  •  
    good article to understand the use and power of arguments.
Bartłomiej Małysz

best free drupal 6 themes - 2 views

  •  
    my private collection of absolutely free best drupal 6 templates all themes are categorized
clariene Austria

Lead generation marketing - 2 views

We know how expensive websites can cost. And we know how expensive SEO can be. We don't want you to get into overdraft to get a website, but we don't want to design a low quality website as well. S...

lead generation seo web design

started by clariene Austria on 08 May 12 no follow-up yet
Scott Blackburn

Views Help: How to get a field to "Link this field to its user" besides username | drup... - 0 views

  • Though one would think the $field object is what we wanted-- the actual object we needed is $row (even though we're only looking at one field in the row). Put the following into the field tpl file to see what the necessary info is: <?phpprint '<pre>';print_r($row);print '</pre>';?> Then, to actually make the link, put the following in your field tpl file: <?php$account = user_load($row->uid);print l($row->profile_values_profile_fullname_value, 'users/' . $account->name);?> Change 'profile_values_profile_fullname_value' to the proper field alias (based on the $row output). Also, be sure to change 'users' to whatever the path is for your user accounts. I also had another thought-- given your use case, you may want to consider the http://drupal.org/project/realname module as well. It will replace usernames with whatever field(s) you designate all over the site. EDIT: I had another thought. I'm not sure of the performance implications of doing a user_load in the template file. Another option is to add the 'User: name' field to the view but exclude it from display. Then you could avoid the user_load and change the code in the tpl file to: <?phpprint l($row->profile_values_profile_fullname_value, 'users/' . $row->users_name);?>
  •  
    theming the field tpl files for Views2
Scott Blackburn

Alternative templates for different block types | drupal.org - 0 views

  •  
    Here's a little trick that will allow you to use a different block.tpl.php for a specific block. You can control by Block name or Block ID. Here' a modified block.tpl.php with a conditional at the top. All you need to do is edit the module == '[modulename
webExplorations

Securing Drupal User Accounts | Mad Irish . net - 0 views

  • This helps to limit automated account creation attempts (by bots). This configuration can be accessed via the main Drupal navigation menu following the links for Administer -> User settings.
  • On the 'User settings' page you'll notice that some of the content of the e-mail templates are tokenized, including place holders such as "!username" and "!password." These tokens are replaced with user specific values before e-mails are sent. It is important to remove any occurrence of "!password" token to prevent user passwords being sent via e-mail. Without the password users must utilize a time sensitive link in order to activate their account or change their password.
  • You can install and utilize the Password Strength module (http://drupal.org/project/password_strength) in order to require that users select strong passwords
  • ...1 more annotation...
  • Another great module for protecting user accounts is the Login Security module (http://drupal.org/project/login_security). This module detects brute force, or automated password guessing, attacks and can prevent them by notifying administrators and locking accounts for a time.
  •  
    Several steps you can take to stop bots from spamming your client's site. It is no fun spending an afternoon deleting hundreds of SPAM comments.
Daniel Gregoire

Apache Solr and Drupal Default's Search | Trellon - 0 views

  • One issue that comes up from ApacheSolr being a separate search page is that the search form does not go to it by default. This is the $search_box in the page.tpl.php template. The way we change this behavior is to add a new submission handler to that form. You can create a custom module for this or put it in your custom theme. <?php/*** Implementation of hook_form_alter()*/function custommodule_form_alter(&$form, $form_state, $form_id) {  // Add submission handler to redirect to apachesolr  if ($form_id == 'search_theme_form') {    // Add a submit, because the search form redirects to a specific place    $form['#submit'][] = 'custommodule_search_submit';  }}/*** Implementation of form submit function*/function custommodule_search_submit($form, &$form_state) {  // Get form ID  $form_id = $form['form_id']['#value'];  // Create new redirect  $form_state['redirect'] = 'search/apachesolr_search/'. trim($form_state['values'][$form_id]);}?>
Daniel Gregoire

Theming Views In Drupal 6.x | Drupaler | Drupal Blog, Collaborative Drupal Resource - 0 views

  • <?phpfunction garland_preprocess_views_view__my_view(&$variables) {  $variables['foo'] = 'some text';}?>
Scott Blackburn

Drupal Performance Tip: Block Visibility | Lullabot - 3 views

  •  
    "So remember: don't rely on regions and template files to hide blocks; they do so visually only. Using block visibility settings will ensure that extra processing is not performed on blocks that aren't being printed out in the first place, and keep your server nice and speedy!" See also the comment regarding the Context module and even Panels. Personally, I rarely use the traditional block page these days and rely more and more on the Context module as well as the Panels module in some cases.
1 - 17 of 17
Showing 20 items per page