Search module - Teaser text

Hi,

I have made a tiny improvement to the Search module in respect to show a teaser text like 'Search here' in the search box. The user can customize the teaser text in the search box from the search settings page. It may be useful to anyone or even you may consider adding it to the 7 release.

Changes in file [search.admin.inc]:

Here I've added the 'search_preferences' panel with the option to modify the teaser text.

function search_admin_settings($form) {
  
  // Search preferences
  $form['search_preferences'] = array(
    '#type' => 'fieldset',
    '#title' => t('Preferences')
  );
  
  $form['search_preferences']['search_teaser_str'] = array(
    '#type' => 'textfield',
    '#title' => t('Teaser:'),
    '#default_value' => 'Search me',
    '#size' => 15,
    '#maxlength' => 20,
    '#description' => t('Default text in the search box. The search box will get cleared once the user clicks in the box.')
  );
  
  // Collect some stats
.
.

Changes in file [search.admin.inc]:

Here I've set the default value to be retrieved from the variables table and added 'OnClick attribute to clear the field when the user enters the search box.

function search_box($form, &$form_state, $form_id) {
$form[$form_id] = array(
'#type' => 'textfield',
'#size' => 15,

Interstitial page: Continue to survey or not now

Hi

I want to conduct an on-site user satisfaction survey. I've created my survey as a webform, but I'm not sure about how to implement it.

Drupaliest way to remove login descriptions

I'm using version 7 alpha 3 and a custom theme based on seven.

What I want to do is remove the descriptions on the user/login page text fields.
For example, under the password field label it says:
Enter the password that accompanies your username.

I know a couple ways to do it:

  • css: color text same as background (yuck)
  • change the markup based on the name of the text field:
    code from form.inc function theme_form_element($variables)
    if (!empty($element['#description'])) { $output .= ' <div class="description">' . $element['#description'] . "</div>\n"; }
    change in my template.php mytheme_form_element($variables) to
    if ((!empty($element['#description'])) && ($element[#title] != "Password" || $element[#title] != "Username")) { $output .= ' <div class="description">' . $element['#description'] . "</div>\n"; }

But these aren't sound solutions (e.g., maybe I want other Username fields elsewhere to have descriptions).
What I really want is an empty $element['#description'] for the user/login form text fields.

I know where these are defined.
It's in user.module
function user_login($form, &$form_state)
on lines 1816 and 1819 (again, I'm using Drupal 7 alpha 3).

D7 in mYsql, custom modules in mSsql

Hi,

Currently i'm seeking a probability about running D7 with mSsql, but still no success.
I just had an idea about this..

D7 and all modules, are installed with mYsql, but only my modules able to access mSsql via third-party library (doctrine, zend, etc...) but this method still mysterious for me...

Would anyone give some insight?

thank you.

internationalization question for drupal 7 - show only posts of the selected language

Hi all, I have a question regarding internationalization for drupal 7. Suppose we have a bilingual site with a language switcher block.
Will we be able to display articles from the selected language only? (ie. currently if we have a post with its translation, both will show up regardless the selected language).

Thanks in advance.

Paul

Drupal 7 admin strip and theming

Just installed Drupal 7 alpha 3 here's some feedback

Cant install Drupal 7 on a Mac without rebuilding your php set up, so had to install it under vmware

First thing that confused me was the default.settings.php file ( read the docs first )
Normally you rename it to settings.php and fill in your database details

Now what happens is you run the installer and it then asks you to rename the file.
I had to rename the default.settings.php to settings.php several times before it was picked up

Heres a couple of things that struck me from a themers point of view

The new admin strip at the top of the page could be a problem when building themes

The issue is when you are building a theme that needs the html and body set to 100%, for example if you are building a site with a sticky footer

Having an admin bar thats not part of the theme appear at the top of the page will throw out the calculations for the height
I havent looked into too much so im not sure if you can include the admin strip in your theme and if its themeable

Still no wysiwyg editor in core
Clients cant do html and need an editor

At the moment the main 2 editors are Tinymce and Fckeditor

Tinymce problems

Image upload is a pain
White screen of death
Javascript conflicts
Poor Webkit support

Fckeditor problems

Webkit bug when pasting text
Editor height problem in Webkit browsers

Pages

Subscribe with RSS Subscribe to RSS - Drupal 7.x