How to display custom CCK field (text or imagefield) in Drupal core search results page?
相关问题
- What is the best way to do a search in a large fil
- Search Multiple Arrays for
- Find index given multiple values of array with Num
- Google Custom Search Engine not giving the expecte
- Drupal 8: How do I customize a form widget to show
相关文章
- What is the complexity of bisect algorithm?
- Visual Studio: Is there an incremental search for
- How do I hide a site from search engines? [closed]
- Why is C# Array.BinarySearch so fast?
- Find three elements in a sorted array which sum to
- Render a Drupal node
- TreeMap - Search Time Complexity
- How to allow multiple blocks in a module of Drupal
It depends how you do the search.
If you use views to build a search, you can decide yourself what to show.
If you're using some other search mechanics, you can use a combination of a proprocess hook, theming function, template you get the output you want. You should have the node object available, so displaying a CCK should be easy enough.
Edit:
For the Drupal core search module you need to overwrite the search-result.tpl.php in your theme, to alter how search results are printed. Here you can add or delete info. If you need more variables, you can create them for use in the template in a process hook. This is basic Drupal theming, check out the handbook.
You need to override search-result-tpl.php in your theme. Copy it from modules/search to your themes directory, clear the theme cache, and you're set. You'll see that there is an array available to the theme file called 'result', which contains a bunch of data, including a node object. So your file becomes something like:
Good luck!
1 Copy search-result.tpl.php file from modules/search to your theme folder
2 For CCK text field add:
3 For imagefield with imagecache:
4 CSS styling next.
Thanx for cam8001 & googletorp!