On Thursday 15 November 2007, Fred Jones wrote:
I know PHP/MySQL and I am learning Drupal. I like it very much, but there are some things which I have not found a way to do so I just code them myself in PHP.
Here are two examples to start:
- A Contact Us page which returns the data submitted to the user. I
mean that the page displays the email and message submitted.
Form-alter the contact form to add your own submit handler.
Mail-alter the message that is being sent and just store the value of the message to a variable with variable_set(). You'll probably want to key it per-user.
In the submit handler, redirect to a custom menu callback.
Add a custom menu callback, and in that callback pull the value from the variable you set earlier and display it as the body of the page. The delete the variable. If the variable is not set, just redirect to the contact form.
There may be an easier way, but that's the first that comes to mind.
- A nested navigation UL based on a taxonomy vocabulary. What I mean is
that I have an estore and the categories of products are stored as terms in a certain vocabulary. I want to display links to each category page as nested UL lists, so that Shoes is one link and inside of it is another UL with Men's Shoes and Womens' Shoes, each also a link to that category.
I am pretty sure there's a module that creates menu blocks out of taxonomy. Search for "site map", restricted to project nodes.