User login

Complete

To be used with care. Pages are complete only when they meet the posting guidelines.

See all available variables for theming

Nicely written, Drupal-focused answer:
http://www.dottedidesign.com/node/36

<?php
print '<pre>';
print_r(get_defined_vars());
print '</pre>';
?>

Off-topic, for Dan:
http://neemtree.com.au/drupal-theming-designers

An example output for a fairly complex node (CCK, Taxanomy)

Label nodes with their content type

In the node.tpl.php (example attached), Agaric simply added:

<div class="type"><?php print $node->type ?></div>

And the CSS:

<pre>
.node .type {
  float: left;
  font-size: 80%;
  font-style: italic;
  color: #714839;
  margin-right: 5px;
}
</pre>

Modifying a view with a views hook: example of custom empty text

From wsf_action.module:

<?php
/**
 * Implementation of hook_views_pre_view
 *
 */
function wsf_action_views_pre_view(&$view) {  // don't need $items
 // in_array($view->name, $place_views)
  if (substr($view->name, 0, 6) == 'place_') {
    wsf_action_place_view($view);
  }
}

Agaric replaces Quicktags with BUEditor (both are easy ways to add HTML markup to your content)

Agaric officially considers Quicktags, though written by the great Bér Kessels, to be deprecated in favor of BUEditor.

Key features:

  • Easily create new tag types, without making a module or anything.
  • Decide which textarea form elements to show it on, and which not to.

Also nice: the link javascript dialog box is very intuitive.

Possible drawbacks

Drupal.org's PHP input format

how does Drupal.org do its PHP input filter?

the one that if you put PHP tags around it it will make nicely formatted and colored code

(may have posted this question on agaric)

Thanks Lullabot!

http://www.lullabot.com/articles/drupal_input_formats_and_filters

Code Filter Renders syntax-highlighted PHP code. This module is used on Drupal.org.

How to add CSS and Javascript just for the front page, as for a custom GMap call

You cannot call drupal_add_css, drupal_add_js, or drupal_set_html_head in any page.tpl.php files themselves. This makes sense, as the variables used to display the page have to have been loaded already for the page to start displaying.

Legal liability for other people's contributed content on your web site

David Ardia on Immunity and Liability for User Content Under the Communications Decency Act:

1. If you passively host third-party content, you will be fully protected against defamation and defamation-like claims under CDA 230.

2. If you exercise traditional editorial functions over user submitted content, such as deciding whether to publish, remove, or edit material, you will not lose your immunity unless your edits materially alter the meaning of the content.

Save a file in Vim after editing and only realizing it's read only when saving

Superseded by a better way to force saving from in vi when read-only, noted in the comments and in Agaric's own post there as :w !sudo tee %

If you've used Debian or any other type of Linux or Unix-like for editing files on your server, at some point you will have done a whole bunch of editing without seeing the "READ ONLY" warning, and then... you try to save.

Publishing from iPhoto to Drupal image gallery with iPhotoToGallery and Image Publisher module

Background searches and thoughts on iPhoto to Drupal publishing.

Resolution

  1. Download and install iPhotoToGallery
  2. on your Mac.

  3. Install Image Publishing module in Drupal.
  4. (Probably needed) add this line to your conf or .htaccess: SecFilterEngine Off

@TODO ben-agaric: look up the security implications of that last line.

Syndicate content