Anyone familiar with Drupal knows Views. It's great for pulling information from the database and displaying it in just about any format you want. I recently set up a job listing site, which was pretty trivial task in Drupal (I've seen guides on setting up job listing sites in a few Drupal books). The problem I had was when I needed to add a separate "read more" link to the job listing after the description text.

Overriding the default output on the table was simple… Views shows the list of suggested template override filenames under "Advanced → Other → Theme: Information". In my case, the template to create "theme_directory/templates/views-view-field--list-all-jobs--page--body.tpl.php". I started by copying the content of "/sites/all/modules/views/theme/views-view-field.tpl.php" and modifying to taste. Creating the "read more" link to that row's node was done using the following code.
The documentation for the function url(...) can be useful in understanding what's happening here. Basically, we're using the node ID to make the URL "node/X", and then asking the "url" function what the absolute URL for that path should be. This returns the full path for that link as defined in the alias for the node.
Add new comment