Closed (fixed)
Project:
Contact Forms
Version:
7.x-1.2
Component:
Documentation
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
6 Apr 2011 at 10:52 UTC
Updated:
18 Jan 2013 at 07:39 UTC
The following snippet works with the modified D7 API:
<!-- start snippet -->
<p>Who would you like to contact?</p>
<?php
$result = db_query('SELECT * FROM {contact} ORDER BY weight, category');
print '<div id="contact-list">';
print '<div class="item-list"><ul>';
foreach ($result as $contact) {
$cleanurl = str_replace(' ', '_' ,$contact->category);
print '<li>'. l($contact->category , 'contact/'. $cleanurl) .'</li>';
}
print '</div>';
print '</div>';
?>
<!-- end snippet -->
Comments
Comment #1
behindthepage commentedThanks
Comment #2
Shadlington commentedSo where would I put this to get it to work?
Comment #3
behindthepage commentedHi Shadlington,
This snippet can be put in a page and customised to generate links to the unique contact forms.
I would use "-" as the space replacement or have no space replacement
You can also add the page info to the above snippet with this:
<?php print $contact->page_info ?>Regards
Geoff
Comment #4
behindthepage commented