Closed (fixed)
Project:
Taxonews
Version:
5.x-1.x-dev
Component:
Miscellaneous
Priority:
Normal
Category:
Support request
Assigned:
Reporter:
Created:
1 Feb 2008 at 11:07 UTC
Updated:
14 Jul 2012 at 23:15 UTC
Please figure revisiting previous posted issue (not sure of the protocol here) but given it has been closed and a follow up post was made there with no response I though it might be reasonable to open a new ticket on this.
The advise given in enabling a teaser block view is to override theme_taxonews_block_view($delta, $items = NULL) . Could you give an indication what this entails for the non-php literate amongst us. Taxonews is a very timely module and provides almost exactly the functionality I require excepting the teaser view. If it is more appropriate to request paid modifications I am happy to go in that direction.
Cheers
Comments
Comment #1
chlobe commentedFirst line should read 'Please forgive'
Comment #2
chlobe commentedComment #3
fgmCreating a new issue as you did is indeed the proper way to do things, AIUI.
In order to override
theme_taxonews_block_view, you just have to define a theme function in the theme used for your site. Supposing the custom theme your site is using is a plain PHP theme (like Chameleon), called "chlobe". In that case, you'll just have to add a function called:chlobe_taxonews_block_view($delta, $items = NULL)in thechlobe.themefile.In that function, you can then ignore
$items, since it contains the links to the articles and you want the teasers. So you use$tidto query for the teasers of nodes matching that tid, and display them, with a query like (assuming you ignore the various ordering choices available and go for the default ordering):Looping on the
db_query()/db_fetch_array()results, you build an array of what you want to see, typically$row->teaser, and pass it to theme_item_list to format it as a standard list under the site theme.The same mechanism can be transposed with other theme engines like phptemplate. Or the feature can be added to the module itself.
Comment #4
chlobe commentedThanks so much, I will examine the fix as soon as I get a chance, thanks again. Please see PM.
Cheers
Comment #5
andyt commentedIf I understand comment #3 the user is being asked to re-query the data to get the teaser.
I am interested also in having access to other node data for the similar purpose of presenting the data in other formats (other than as currently formatted in blockView()). After studying the code it would seem the $items array would contain the title, teaser, and possibly other node data without being formatted as a link in blockView(). Then the user can 'theme' the data as needed in block_view(). The default block_view() would format the link just like blockView() does now.
It seems the krsort function is not necessary since the data is already sorted by the SQL. In fact it may be un-sorting the data since the sort is by nid and not by 'views'. I can understand why by nid since views may have duplicate values (though unlikely).
I'm using Taxones 6.x-1.x-dev.
Comment #6
andyt commentedAfter further thought the user can retrieve as suggested in #3 the {node_revision} data in block_view(). However, blockView should not pre-format the data from {node} (leave the title in array $items as is) so the database access to {node} is not needed a second time.
Comment #7
fgmPlease try the new version. Several changes have been applied in 6.1.0 RC, notably reducing the number of requests. The krsort() is needed because it acts after the node selection whereas the SQL is part of the node selection process.
Comment #8
fgmNo comment. Assuming RC satisfies user's need.
Comment #9
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.