Get Content Type

The get_content_type module fills an oversight by the D5 developers. When they moved the part of CCK (sometimes called CCK-Lite) into core for creating new content types, they forgot the analog to taxonomy/term/xxx, that is node/type/xxx. This simple module provides that function.

Thanks to milianw this module now supports RSS feeds.

Installation

Normal module installation applies.

Text filters and Input Formats

This handbook page is based on a similar article by Robert Douglass at http://www.lullabot.com/articles/drupal_input_formats_and_filters. It is modified for inclusion here by permission.

Processing textual content for output in a browser is one of Drupal's most critical tasks. Without such processing we would all have to become masters at typing in HTML text! This section of the handbook explains what filters and input formats are, why they are important, how they are used, and why they impact site security.

Filters and Input Formats

The pillars of Drupal's text handling are filters and input formats. A filter is a set of rules that can be applied to transform text in some way. Some filters strip certain HTML tags or security hazards from text. Other filters look for special patterns and expand the text in a meaningful way. Other fun-oriented filters, such as the Pirate Filter, rewrite the text altogether (in this case, to make it "talk like a pirate"). Filters know how to do one thing, and do it well; text in, filtered text out.

Some filters have extra configuration options. The HTML filter, for example, strips all but an allowed set of HTML tags from text. The set of allowed tags can be determined by the administrator.

Some simple (but useful) examples

This page is a collection of simple replacement rules you can use for yourself. Before you can use any of this, you should have a filter as a container.

Simple replace (case sensitive)

This will convert all occurrence of foo into bar, but it is case-sensitive, means that it won't work for Foo, or fOO.

  • Pattern: /foo/
  • PHP Code: off
  • Replacement: bar

Creating filters

To create a filter, you can do these steps:

  • Make sure you have the Custom Filter module installed
  • Go to Custom Filters (/admin/settings/customfilter) (6.x & 7.x)
  • Click Add Filter tab

Now there should be a form asking some properties. Give this new filter:

  • Name, as an identifier for this filter
  • Description, some sort of description to describe what this filter is about and what this filter does. This information is used only in the Custom Filter administration page.
  • Tips (short), short tips to be shown in the node creation form, below body field.
  • Tips (full), longer tips to be shown in Compose Tips. That is the page when you click more information about formatting options.
  • Cache to determine the node should be cached. When this option is on, filtering will be cached. If you need a filter that must be processed everytime the node loads (e.g. filter that shows current date/time, or filter that generates random numbers), you should turn this option off.

Replacement rules

Panel nodes

The panel node module creates a new node type, the 'panel' node, which has a panel layout. It is otherwise independent from your other nodes, as well as from panel pages. It is sort of a lesser cousin to panel pages, and it exists in case you actually need the functionality of a 'node' for your panels; sometimes this does turn out to be necessary.

Asset CCK

There are a number of DIFFERENT ways that you could add "assets" to a node, this page describes adding an "asset field" to a node, not how to embed an asset in the body of a node.

First make sure you have both asset (http://drupal.org/project/asset) and cck (http://drupal.org/project/cck) installed and activated.

Go to Home>Administer>Content management. Click on “Add content type”. Type in a name and content type (for example I type “Asset_Test” as name and “asset_test” as content type).

Then push “save content type”. Now on the main cck page click edit next to the content type you just made.

Now click “Add field”, type in a name for the field and select the “Asset” field type. Then click “Create field”. Now, if you want to be able to add multiple fields to one asset component check the “Multiple values” field. Push “Save field setting” to finish.

Go to “Create content” and click on “Asset_Test” or whatever you named your content type. You should see links to “Insert asset” and if you selected multiple values there should be a “More Assets” button you can push to add more assets.

Pages

Subscribe with RSS Subscribe to RSS - Site administrators