Well this post isn’t exactly a PROBLEM/SOLUTION post but more of an entry to put the few things I need to remember on Drupal 7. Here are three things I should remember for the next time I need help with it. I’m naming it I just in case I want more than one.
Limit Site Search Results By Content Type
If you ever need to exclude some content types from the site search, do the following:
- Install and enable the search_config module.
- Go to #overlay=admin/people/permissions%23module-search_config and at the bottom you can limit anonymous users by content type.
Remove Authoring Information From Search Results
On the search results page, by default, the authoring information is displayed. This kind of stuff should be turned off my default (in my opinion) since sites usually do not expose this information to the user. Only blogs or news articles have author info so it should be turned off for site search, on pages, etc but that’s a different vent. Anyway to turn this information off, do the following:
- In /modules/search copy the search-result.tpl.php and paste it into the theme root (like /sites/all/themes/your_theme/ )
- Remove the authoring information code.
- Save the page.
- Clear the Drupal cache.
Search Title & Content Body In View Block
- In the view, select the Tontent: Title and Content:Body under the Fields
- If you do not want the Body (or any other thing exposed in the list) select the “Exclude from display” in the Configure field: Content:Body.
- Under Filter Criteria, choose the “Global: Combine fields filter”.
- Check the “Expose this filter to visitors, to allow them to change it”, “Single filter”.
- For the Operator, choose “Contains” and select both/all fields under “Choose fields to combine for filtering”.
Permissions On The /sites/default/files Folder
I struggled with permissions issues for like two days. Between going back and forth with IT on what’s allowed and what isn’t allowed. Blogs everywhere say that the files directory should be 777. But that’s access to everything for everybody.
Ours has this access for the directory:
Every folder underneath this one should be granted the same privileges. By the way, this is on a UNIX box.