Attached is a full module, for review, that does two things:

1) Allows preview of Nodes per type in StyleGuide,
2) Auto-generates nodes for preview. These auto-generated nodes are unpublished, and should generate some random CCK and node data.

Needs testing and (better) field handling. The method might also be of use to devel_generate, but I don't want to introduce the dependency during development.

Written for D6, should be portable to D7.

CommentFileSizeAuthor
styleguide_node.zip3.7 KBagentrickard
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

agentrickard’s picture

These lines (93-95) should really be commented out for real testing:

  if (empty($nid)) {
    $nid = db_result(db_query("SELECT nid FROM {node} WHERE type = '%s' ORDER BY created ASC", $type));
  }
Dublin Drupaller’s picture

this is very useful. it's generating sample nodes, where nodes don't exist but not quite generating the cck fields attached to node types as well.

furthermore...it appears to be generating a full node...rather a mix between teaser and full node. in other words, when I generate a sample event node, for example, it outputs a linked h2 title rather than a regaular h2 node title.

will try and find some time to help improve this module...and add-on...it could be a superb tool for testing or doing quality control on a theme.

dub

squiggy’s picture

This looks great. It would be super useful to be able to preview all node types on a site. I had done something similar, except if there was no node created for a content type, it provided a link to create it.

@Dublin Drupaller, Did you ever figure out the issue with the title being linked in full node view?

malcomio’s picture

I've started a sandbox project for 7.x here: https://drupal.org/sandbox/malcomio/2055771

It depends on devel_generate to get dummy content without cluttering up the database with nodes.

Still in very early stages, though...

malcomio’s picture

Version: 6.x-1.x-dev » 7.x-1.x-dev
Assigned: Unassigned » malcomio