2
votes

It may sound 'weird' but I need to have a view that lists all the content types I have.

For example i have two content types : contenttypeA, contenttypeB

I want to create a view that just displays the two content types (and show number of items of that type, but that can be done later).

For now what I did is add one content of each content type and list them but only show the 'node type'; it works well if there's at least one content but I want to display even without any content of that content type.

Any idea ?

3

3 Answers

2
votes

Introducing the node_type table to Views requires a custom module and some Views API knowledge however http://drupal.org/node/1001222 will give you a head start.

1
votes

There is no native functionality in Views to do that. You can write a static page or (overkill) a module that provide a "system"-like type similar to Views Watchdog.

1
votes
  1. Use a Customfield: PHP code field and custom code the whole thing with PHP. This is provided by the Views Custom Field module.

  2. Use the Table Wizard module to make the node_type table available to views. You may need to use the Data module as well since they say that all future development is going there.

  3. Expose the node_type table yourself by writing a custom module using the Views API as suggested by chx.

Number one is the quick and dirty way, but number 2 might be a little more manageable, but I am not completely sure it will do everything you want. If you do number 3 make sure you contribute back to the community by putting your module on drupal.org.