Link to home
Start Free TrialLog in
Avatar of lapucca
lapucca

asked on

How can set to display only 1 top news in the news ticker?

http://www.uscuniversityhospital.org/ This is done in Drupal 5.7.  I'm a .net developer and definitely not in my element here.  How can I change this news ticker to display only one top news item?  We want to put up an important notice here and we want to only have that news message displayed.   I can log in as an admin.  Thank you
Avatar of Kevin Cross
Kevin Cross
Flag of United States of America image

Until you get some true Drupal advice (i.e., I am NOT a Drupal Expert), you can see if you can just manage this from the MySQL database side by using ORDER BY DateAddedColumn DESC LIMIT 1 -- i.e., whatever column denotes when a news item was added or updated should be used in order by descending so that the top most record is the latest news article, then just use limit to get the top x records. From .NET, if you did any MS SQL queries, this would be like SELECT TOP 1 ... ORDER BY DateAddedColumn DESC. In MySQL, it just goes at the end, e.g., SELECT ... ORDER BY DateAddedColumn DESC LIMIT 1.

Good luck!
Avatar of lapucca
lapucca

ASKER

I search Drupal category but didn't find it.  Thank you for adding it.  Can yo move Drupal up as the primary zone?  Thank you.
I'm not sure this is MYSql issue but thank you for the suggestion.
ASKER CERTIFIED SOLUTION
Avatar of Kevin Cross
Kevin Cross
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
It seems that the news ticker is a Drupal's  'view'.
If so go to admin/build/blocks, and check which block is positioned at the header region.
Go to admin/build/views, and look for the specific 'view' in the list and edit it.
in "Basic settings" at "Items to display" select 1.
In "Sort criteria" select node ID and "descending"
This should do it.
Avatar of lapucca

ASKER

Mw, is newsticker.module the name of the php file?  there are lots of file for this site and i only get FTP into the drive so it's hard for me to find where that file is. But thank you for your help.

Ha, I found the header view is "uscuh" but then in the View I cannot find that view to edit.  Can you have a look at the screen shots and let me know if you can see which view I'm to edit?  Thank you.
Blocks-1318081059615.jpeg
Administer-views-1318081630829.jpeg
HagayMandel for the win.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of lapucca

ASKER

I thought the same thing since that's the only view with "homepage" keyword.  I didn't find anything that has number 5 or indicate it's news.  I attached a screen shot for your review.  Also, I don't know if this matters but on the top of the home page, PressRoom, is where all the news are.  The news ticker pulls the top 5 news from there.  

I really appreciate help with this.  We lost our PHP Drupal person and still hasn't found a replacement.  If I can't figure out how to do this then I'll have to do something ugly like creating 5 top news to be exactly the same so it keeps displaying the news title. We have an important news that needs to be up by Monday morning and stay there for a few days.
Edit-view-scientific-papers-news.jpeg
I thought the view option to change would be your best bet, but since you asked -- yes, the .module file appears to be the PHP code. However, when you download newsticker, it is in a .module file. I would exhaust the GUI method first before customizing the PHP, but my changes should work if you can locate the file with the functions I noted.
Look carefully in your screen shot, aside Nodes per Block: is is indicating 6.
Change it to 1.
(I'm sorry, it's Drupal 5, and I lack knowledge about this version).
Avatar of lapucca

ASKER

I noticed the number 6 as well but I counted it before and it is only pulling top 5 news.  Anyway, I changed it to 1 just to make sure and that didn't affect the news ticker.  
Avatar of lapucca

ASKER

Thanks.  I found it in the PHP file.