Hi folks
I'm relatively new to the wonderful world of drupal so sorry if this is a stupid question but I've come up against a bit of a confusing one.
I have a listing of news items - however this site won't have that many news items and the ones that it has are just gonna be quite short so there is not really any point in the traditional listing & item detail page model.
What I want to do is have a paged listing of news items but the listing will show the full content for the node NOT a summary - I've sorted this by creating a node of type "news" then creating a view (of type page) to only show news items....this is all fine.....however if you do a search the search results return links to the specific news items node and you go to an item detail page which you could not normally get to from the listing as the listing has no links. What I really want to happen is that if you click on the link from the search results go the appropriate page in the listing of news.
You might think this is a bit of a silly way to do news but I can see other applications where this might be the case for example a list of books on you'd recommend or a list of clients but the actual page content is on a different site so a detail page is not applicable.
Does anyone know how to do this or got any tips for how I should start?
Ta
Chris
Comments
_
Probably the simplest way to do this is by not using core search and setting up a search with views using exposed filters. You could simply add another page display to your existing view and customize whatever you want (including rewriting the fields to link to whatever you like). Using this method, you'll want to checkout the http://drupal.org/project/coresearches module as well.
Using the core search module
I'm not sure if this changes things but I'm not actually using the core search module I'm using the fuzzy search because the core search doesn't do partial matches and most users don't really expect these days to have to type an exact word to get a search result.
C
Hi Chris, just to make sure I
Hi Chris,
just to make sure I have this right:
1. you've created new items.
2. using views, you list the news items in full on a specific page (the url is defined by views).
3. there are visible links to site visitors to the actual news nodes - all access is directed to the views page.
4. when people search for content on your site, you want the results to link to the views listing page, not the actual news item pages.
Is this correct?
I've never modified the url returned by the search like that but with a quick search on api.drupal.org, it looks like you can modify the result url returned with hook_search - http://api.drupal.org/api/function/hook_search/6. you would just override all the results so that they point to your listings pages...
pete
Toronto Website Developer
Making sure
Hi Guys
I really appreciate your input on this.
Pete you're almost right - with the exception of point 3 you can take a look at http://chunt.dyndns.org/drupal-6.19/news (its just my dev server so is not always on)
There are NO links to the actual stories but if you do a search http://chunt.dyndns.org/drupal-6.19/fuzzysearch/results/lorem you'll see you get 2 results in this instance what I'd like is for clicking either of them to take you to Page X of the news listing - obviously X would depend on the result and depend on how many news items you actually have.
This is made more complicated because I'm using the drupal link module in ckeditor which allows you to create links to any node hence technically speaking content editors can link directly to a news item which should also take the user to the listing and not to the item view page.
Hope that helps clarify this.
Chris
Hi Chris, did you try using
Hi Chris,
did you try using hook_search? I think that is your best result, to override the results of the search so that they don't point to your nodes. my suggestion would also be to edit your robots.txt file to add the specific node urls you don't want indexed by search engines.
This seems like it is on the right track for you: http://drupal.org/node/175013
Toronto Website Developer
Any more for any more?
Does anyone else have any more thoughts on this. I strikes me that this must be something that affects loads of people - ok my news example is poor but for other things that are just listings - how does everyone get around this?
C
Its getting worse....
This topic was titled Having a listing only with no "item view" for nodes (just in case you've tried to help with this already)
So then....at the risk of bumping this twice in 24hours I've found another annoying similar problem. If you use a node to provide some text for a block or even the content for block but again the node is not supposed to have it's own page you get same problem
There is an example on this site http://www.substance.coop if you search for the word "demonstrate" you'll see that the last search result is the intro text from the homepage....now if you click it one would expect to go to the homepage, however what actually happens is you go to the page for that random disconnected "node" called welcome text which is being used to do the intro text.......which is just wrong (from a system P.O.V not an implementation P.O.V)
There must be a smart solution to this....in my old company where we had developed our own in house cms each content type had the concept of a display mode which could be "direct" or "indirect" to solve this exact problem because whilst one could remove the ability to search certain content types that's kinda cheating really and annoying for the user.....I suppose one could use a google search instead but they rely entirely on JS I think.
.....oh and plus if you consider my news example wouldn't it be really nice and cool if in your content you can link to a news story (I'm using the node link module in ckeditor) and then the system worked out which of page of the list of news the story is actually on....if you get my drift
Any help appreciated.
_
I'm not sure there is a 'right' answer to this-- it's not only a problem with views, but with panels as well. Indeed, any module that aggregates drupal entities into a 'content page' available at a specific url would have the same limitation.
But it works in these forums
This question I fear probably reveals some ignorance (I've yet to implement a forum in drupal) but these forums handle it fine....but are you about to tell me forums are not aggregated nodes - for example if you search for "getting worse" you'll find my post but the link is actually to this topic.
I'm surprised no-one else has not gone bonkers trying to solve this issue before
Ta, C
_
Nope, forum threads are actually a single node of content type 'forum topic' with comments. The original post is a node, the replies are not-- they're comments. There's a module called 'nodecomment' which changes replies from comments to nodes and is what Michelle usually recommends with advanced_forum (see http://shellmultimedia.com/blog/comment-or-nodecomment-advanced-forum).
More digging and maybe my first module then....
Ok well assuming I can find some time I'm gonna have a play with Apache Solr http://drupal.org/project/apachesolr as this seems to offer some re-write options, failing that I'll have to come up with a module to do some form of automatic translation of URL or redirect if you land on a particular node page somehow......
C