Developers and coders
Migrate from Nodewords 6.x-1.6 to 6.x-1.7
Hey,
I recently experienced problems from updateing to a new version of nodewords and removing the nodewords_by_path module. Looks like the format in the DB for nodewords table has changed to the serialized format. The old meta information was still in the database, but it was not recognisible since the format was plain.
So I made a quick script to port the meta tags (abstract, copyright, keywords and description) from one format to another:
Create a page with PHP content and write the following: (it's recommended to backup the database first)
<?php
// PHP Code
$result = db_query("SELECT * FROM nodewords n WHERE ( n.name='copyright' OR n.name='abstract' OR n.name='keywords' OR n.name='description' ) AND n.content NOT LIKE 'a:%{%}';");
while ($item = db_fetch_object($result)) {
unset($new_content);
$new_content = array('value' => $item->content);
$data = array(
'mtid' => $item->mtid,
'name' => $item->name,
'content' => serialize($new_content) // looks like drupal_write_record() doesn't serialize this, so I do it manually
);
drupal_write_record('nodewords', $data, 'mtid');
}
?>Working with Contextual
placeholder text for contextual module for link from d7 help pages
Working with Overlay
placeholder page for overlay module link from d7 help pages
Lucene field types
Lucene indexes are composed of atomic documents. Each document is divided into named fields which either have content that can be searched or data that can retrieved. Before storing data into a field, it is important to determine which field type best fits the nature of the content being indexed. It is also best practice to avoid having to retrieve large amounts of data from the index itself. The Search Lucene Content module implements this practice by indexing most data using the UnStored field type. When searches match content in these fields, only the matching node ID is retrieved from the index, and the search results are populated with data from the database. This allows us to make use of Drupal's APIs without having to re-implement them on the Lucene layer. All available field types are listed below:
Release Content to Subscribers in a Sequence
Aim
To set up a Drupal site so that it can deliver a series of tutorials to subscribers over a period of time, such that in the first week of the subscription the subscriber receives tutorial one, in the second week, tutorial two and so on.
Vertical tabs
Placeholder for the vertical tabs handbook page.
http://drupal.org/project/vertical_tabs
Adding vertical tabs to your own module's form
To enable vertical tab support
<?php
function mymodule_settings_form() {
$form['mymodule_setting1'] = array(
'#type' => 'checkbox',
'#title' => t('Setting 1'),
'#default_value' => variable_get('mymodule_setting1', 0),
// Technically this should be the same value for all tabs in a set of vertical tabs, but any value that equals TRUE means that it should be included in the vertical tab set.
'#group' => 'mymodule',
);
...
// Add vertical tabs display if available.
$form['#pre_render'][] = 'vertical_tabs_form_pre_render';
return $form;
}
?>Adding verticaltab summary JavaScript to your module's fieldsets
In the following example we are going to add a fieldset to all node edit forms and add a summary.
In the file mymodule.module:
<?php
/**
* Implements hook_form_alter().
*/
function mymodule_form_alter(&$form, $form_state, $form_id) {
// Only include on node add/edit forms.
if (strpos($form_id, '_node_form') !== FALSE) {
$form['mymodule'] = array(
'#type' => 'fieldset',
'#title' => t('My module node options'),
'#group' => 'additional_settings',
