Compose tips
input formats:- Filtered HTML:
- Web page addresses and e-mail addresses turn into links automatically.
Allowed HTML tags: <a> <em> <strong> <small> <sup> <sub> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd> <h1> <h2> <h3> <h4> <img> <br> <br/> <p> <div> <span> <b> <i> <font> <color>
This site allows HTML content. While learning all of HTML may feel intimidating, learning how to use a very small number of the most basic HTML "tags" is very easy. This table provides examples for each tag that is enabled on this site.
For more information see W3C's HTML Specifications or use your favorite search engine to find other sites that explain HTML.
Tag Description You Type You Get Anchors are used to make links to other pages. <a href="http://pcrro.org">PCRRO.ORG</a>PCRRO.ORG Emphasized <em>Emphasized</em>Emphasized Strong <strong>Strong</strong>Strong No help provided for tag small. Superscripted <sup>Super</sup>scriptedSuperscripted Subscripted <sub>Sub</sub>scriptedSubscripted Cited <cite>Cited</cite>Cited Block quoted <blockquote>Block quoted</blockquote>Block quoted
Coded text used to show programming source code <code>Coded</code>CodedUnordered list - use the <li> to begin each list item <ul> <li>First item</li> <li>Second item</li> </ul>- First item
- Second item
Ordered list - use the <li> to begin each list item <ol> <li>First item</li> <li>Second item</li> </ol>- First item
- Second item
Definition lists are similar to other HTML lists. <dl> begins the definition list, <dt> begins the definition term and <dd> begins the definition description. <dl> <dt>First term</dt> <dd>First definition</dd> <dt>Second term</dt> <dd>Second definition</dd> </dl>- First term
- First definition
- Second term
- Second definition
Header <h1>Title</h1>Title
Header <h2>Subtitle</h2>Subtitle
Header <h3>Subtitle three</h3>Subtitle three
Header <h4>Subtitle four</h4>Subtitle four
No help provided for tag img. By default line break tags are automatically added, so use this tag to add additional ones. Use of this tag is different because it is not used with an open/close pair like all the others. Use the extra " /" inside the tag to maintain XHTML 1.0 compatibility Text with <br />line breakText with
line breakBy default line break tags are automatically added, so use this tag to add additional ones. Use of this tag is different because it is not used with an open/close pair like all the others. Use the extra " /" inside the tag to maintain XHTML 1.0 compatibility Text with <br />line breakText with
line breakBy default paragraph tags are automatically added, so use this tag to add additional ones. <p>Paragraph one.</p> <p>Paragraph two.</p>Paragraph one.
Paragraph two.
No help provided for tag div. No help provided for tag span. Bolded <b>Bolded</b>Bolded Italicized <i>Italicized</i>Italicized No help provided for tag font. No help provided for tag color. Most unusual characters can be directly entered without any problems.
If you do encounter problems, try using HTML character entities. A common example looks like & for an ampersand & character. For a full list of entities see HTML's entities page. Some of the available characters include:
Character Description You Type You Get Ampersand && Greater than >> Less than << Quotation mark "" - Lines and paragraphs are automatically recognized. The <br /> line break, <p> paragraph and </p> close paragraph tags are inserted automatically. If paragraphs are not recognized simply add a couple blank lines.
-
Gallery2 Filter:
You can link to items in your embedded Gallery2 using a special code. This code will be replaced by a thumbnail image that is linked to the actual item in your Gallery.
Syntax:
[G2:item_id n=number type=type size=number class=name frame=name album_frame=name item_frame=name]- item_id (required): This is the item ID from Gallery2. If you look at the URL of the item, this is the last number. Note that if the item_id is a single photo, n must be 1.
- n (suggested): This is the number of photos you want the block to show. It will override whatever is set in the defaults (initially 1). Note: this will change past instances where you did not set n -- the reason for its suggested use.
- type: The default type of gallery block. Any of the following may be used: randomImage, recentImage, viewedImage, randomAlbum, recentAlbum, viewedAlbum, dailyImage, weeklyImage, monthlyImage, dailyAlbum, weeklyAlbum, monthlyAlbum, specificItem. Note that for n=1, selectedItem is automatically chosen regardless of this parameter.
- class: The block that Gallery2 returns is wrapped in a DIV so additional styling can be done. The classes for this DIV are located in g2_filter.css. Included with the module are "left", "right", and "nowrap". These position the image block to the left or right or on a line all its own with the text not wrapping. You can also add your own class(es) to the CSS file and they will automatically be available.
- size: The length of the longest side for the thumbnail. The other side is determined automatically to keep the same aspect ratio. This option (for Gallery2.2 and above) will use the gallery image that is closest in size, and so may end up using a smaller image and expanding it (lower quality). If so, use "exactsize". For Gallery2.1, if you want your size to be bigger than the thumbnail size for that image as defined in your Gallery2, you must select "Full Size" in the gallery settings page (but note that the full image will be returned and then resized by the browser, so it may take a while to download).
- exactsize: The length of the longest side for the thumbnail. The other side is determined automatically to keep the same aspect ratio. This option always ensures that the image is scaled from a larger image and so image quality is maintained. This only works for Gallery2.2 and above.
- frame/album_frame/item_frame: You can use just "frame" to assign a frame to the thumbnail regardless of whether it's for an album or a single item. Using aframe will only affect albums and iframe will only affect single items. Frames included with the default Gallery 2 install are: bamboo, book, brand , dots, flicking, gold, gold2, polaroid, polaroids, shadow, shells, slide, solid, notebook, wood.
You can use <object>, <embed> and <script> tags from the following sites to add media to your posts:
- PHP code:
-
Using custom PHP code
If you know how to script in PHP, Drupal gives you the power to embed any script you like. It will be executed when the page is viewed and dynamically embedded into the page. This gives you amazing flexibility and power, but of course with that comes danger and insecurity if you do not write good code. If you are not familiar with PHP, SQL or with the site engine, avoid experimenting with PHP because you can corrupt your database or render your site insecure or even unusable! If you do not plan to do fancy stuff with your content then you are probably better off with straight HTML.
Remember that the code within each PHP item must be valid PHP code - including things like correctly terminating statements with a semicolon. It is highly recommended that you develop your code separately using a simple test script on top of a test database before migrating to your production environment.
Notes:
- You can use global variables, such as configuration parameters, within the scope of your PHP code but remember that global variables which have been given values in your code will retain these values in the engine afterwards.
- register_globals is now set to off by default. If you need form information you need to get it from the "superglobals" $_POST, $_GET, etc.
- You can either use the
printorreturnstatement to output the actual content for your item.
A basic example:
You want to have a box with the title "Welcome" that you use to greet your visitors. The content for this box could be created by going:
print t("Welcome visitor, ... welcome message goes here ...");If we are however dealing with a registered user, we can customize the message by using:
global $user; if ($user->uid) { print t("Welcome $user->name, ... welcome message goes here ..."); } else { print t("Welcome visitor, ... welcome message goes here ..."); }For more in-depth examples, we recommend that you check the existing Drupal code and use it as a starting point, especially for sidebar boxes.
-
- Full HTML:
- Web page addresses and e-mail addresses turn into links automatically.
- Lines and paragraphs are automatically recognized. The <br /> line break, <p> paragraph and </p> close paragraph tags are inserted automatically. If paragraphs are not recognized simply add a couple blank lines.