I'm a programmer, but new to Drupal, so a fairly able noob. I'd wanted to see some working examples of various features and API goodness, so i installed this module. But there doesn't seem to be anywhere which says what form this module takes and how to use it, e.g.

Is there a specific URL on my site i have to go to? Is there a navigation menu item? Should something come up when i go to the blocks menu (for instance)? Is there an unspoken consensus about how this kind of module works? It *appears* that maybe the examples are dotted around the admin site?

(I have enabled the various example modules in the Site Building->Modules page)

This is a feature request as well as a good old moan. Perhaps a quick explanation on http://drupal.org/project/examples ? Really quick to fix, but pretty fundamental. Thanks!

Comments

rfay’s picture

Hi - Thanks for the note.

When you enable each module, it adds links that explain how it's used. So if you enable menu_example, there's a link that shows what it's about. That link by default in D6 is /menu_example and it gets added to the Navigation menu. So if you don't have the Nav menu in a block, you'll miss it.

In D7 we've added a master module and moved everything under /examples.

We'd love to have your contribution to help make this more obvious!

Thanks, and welcome to the community.

mile23’s picture

Maybe link to http://drupal.org/developing/modules from the project page.

Graham_SC’s picture

With the form_example enabled, I can navigate with localhost:8082/examples/form_example
which gives me the following:
Form Example
The form example module provides a tutorial, extensible multistep example, an element example, and a #states example

You need to go down further to see the examples run:
localhost:8082/examples/form_example/states

rfay’s picture

And of course on any version of examples, you can look in the code of each .module file for hook_menu, and you'll see the paths.

But if people will just enable the navigation menu block and they'll see them all. It's enabled by default on a plain vanilla Drupal install.

leehunter’s picture

Right now the main documentation landing page (http://drupal.org/documentation) links directly to the Examples project page which is a bit of a jarring transition, since the project page is more about the work of creating the project rather than explaining how to use it.

How about I start an Examples orientation page to go between the docs landing page and the project page which would cover the information in this issue.

Another question that occurred to me (as a non-developer with an interest in development) is whether there might be one or two of the examples that could be mentioned as a good starting point for a complete noob (i.e. is there an example for the most common use case or that is the most illustrative?). The list of examples is great for someone who wants to find out how to work with a particular aspect of the API, but it's a little intimidating for someone starting out so it would be nice to say "If you're new to Drupal development, start with the x example."

mile23’s picture

Actually it might be better for that documentation page to link to the API site page, instead: http://api.drupal.org/api/examples/examples.module/group/examples/7

That way documentation can be patched with the modules, in doxygen format.

rfay’s picture

@LeeHunter, thanks so much for your interest.

The easiest starting example is the page example, IMO

I agree that we can do better, and an intermediate page would be fantastic.

Alternately, or in addition, the project page can be revamped. I've given you privileges as a maintainer on the project page, and you're welcome to work with it as you see fit.

I see these main ways into this:

  • Download and install.
  • Enable a module. Experiment with the module.
  • Change what it does; see if you can accomplish what you were intending by experimenting with it.

Of course, the code is also indexed by api.drupal.org, so providing examples there is a side benefit.

There is also a live install on http://d7.drupalexamples.info. That can be done better if anybody has an interest in it.

Again, thanks for stopping by, and we're very happy to support you in any path you think will help people.

-Randy

chrisjlee’s picture

@rfay Would it be appropriate if we add this issue to an FAQ of some sort? Or add an FAQ to the README (i can write and provide a patch this if it's alright with you).

rfay’s picture

@chrisjlee, would love to have you do this. I think that as @LeeHunter points out we probably need a docs page that can grow out of this issue. Let's do the work there.

@LeeHunter, you're the IA man... Where should this be put? Could you go ahead and create it? IMO we're better focusing our effort on a docs page than the README.

@chrisjlee, feel free to start discussing content for the docs page in this issue. THANKS!

mile23’s picture

Updated the project page to be a little more clear, tell people to look for menu items when they've enabled it, and link to api.drupal.org's examples landing page.

@rfay give it a look-see please. :-)

mile23’s picture

Status: Active » Needs review
rfay’s picture

Status: Needs review » Fixed

Looks good to me.

Of course, this issue isn't "fixed", it's an ongoing project, so we always need to see how we can make it work better.

Thanks so much!

Automatically closed -- issue fixed for 2 weeks with no activity.