1
btesec
Yahoo Style News display - News Module
  • 2010/6/1 18:36

  • btesec

  • Friend of XOOPS

  • Posts: 623

  • Since: 2007/2/20


Hi Everyone,

I am creating a site based on xoops. I need to display a latest news items block using the Yahoo's "TODAY" latest news items style located at the top of center column. The idea is for users to place their mouse on over and show news intro with image, and to rotate the latest news items automatically when no mouse over status with images..

I am using News 1.66 module by Trabis.

Any solution. let me know.

thanks.
btesec

2
btesec
Re: Yahoo Style News display - News Module
  • 2010/6/2 15:19

  • btesec

  • Friend of XOOPS

  • Posts: 623

  • Since: 2007/2/20


any idea from anyone?

3
mariane
Re: Yahoo Style News display - News Module
  • 2010/6/2 15:42

  • mariane

  • Theme Designer

  • Posts: 649

  • Since: 2008/1/11


I think Yahoo is using this slider
http://css-tricks.com/creating-a-slick-auto-playing-featured-content-slider/
you can integrate it to your theme and edit news and pictures manualy or you can create/edit an existing block from your news modules (I tried to do it with publisher) and copy the same effect to the block.
below the code I added to publisher , I created a new block and added a jquery effect, so maybe it can be useful for you to do yours,

le="color: #000000"><?php <head> <link rel="stylesheet" type="text/css" href="<{$xoops_url}>/modules/publisher/css/featuredcontentglider.css" /> <script type="text/javascript" src="<{$xoops_url}>/modules/publisher/js/jquery-1.2.1.pack.js"></script> <script type="text/javascript" src="<{$xoops_url}>/modules/publisher/js/featuredcontentglider.js"></script> <script type="text/javascript"> featuredcontentglider.init({ gliderid: "canadaprovinces", //ID of main glider container contentclass: "glidecontent", //Shared CSS class name of each glider content togglerid: "p-select", //ID of toggler container selected: 0, //Default selected content index (0=1st) persiststate: false, //Remember last content shown within browser session (true/false)? speed: 500, //Glide animation duration (in milliseconds) autorotate: true, //Auto rotate contents (true/false)? autorotateconfig: [3000, 2] //if auto rotate enabled, set [milliseconds_btw_rotations, cycles_before_stopping] }) </script> </head> <div id="canadaprovinces" class="glidecontentwrapper"> <{foreach item=item from=$block.items}> <div class="glidecontent"> <{if $item.image_path}> <img src="<{$item.image_path}>" alt="<{$item.clean_title}>" title="<{$item.clean_title}>" width="250"/><br /> <{/if}> <{$item.titlelink}><br /> <{$item.summary}><br /> </div> <{/foreach}> </div> <div id="p-select" class="glidecontenttoggler" style="font-family: verdana; width:326px; height:19px; font-size:2mm; font-weight:bold; text-align:right"> <a href="#" class="toc">1</a> <a href="#" class="toc">2</a> <a href="#" class="toc">3</a> <a href="#" class="toc">4</a> <a href="#" class="toc">5</a> <a href="#" class="toc">6</a> <a href="#" class="toc">7</a> <a href="#" class="toc">8</a> <a href="#" class="toc">9</a> <a href="#" class="next">Next</a> </div> </div>

the road of success is always under construction

4
btesec
Re: Yahoo Style News display - News Module
  • 2010/6/2 17:32

  • btesec

  • Friend of XOOPS

  • Posts: 623

  • Since: 2007/2/20


thanks. I will check it out. Has anybody else tried this with News mod? If I am not mistaken there was a site that had this implemented, does anyone remember which site not sure if it was in English or in another language?

5
h725
Re: Yahoo Style News display - News Module
  • 2010/7/20 7:50

  • h725

  • Just popping in

  • Posts: 4

  • Since: 2010/7/19


Hi friends, hi mariane..
I tried to integrate it to my theme but it doesn't appear.
Can you post all code and help me to solve the question?

6
Yurdal
Re: Yahoo Style News display - News Module
  • 2010/7/20 9:10

  • Yurdal

  • Friend of XOOPS

  • Posts: 395

  • Since: 2005/3/27


@btesec
Do you mean latest news slider ? there is a hack for smartsection to display this in a block

7
mariane
Re: Yahoo Style News display - News Module
  • 2010/7/20 9:37

  • mariane

  • Theme Designer

  • Posts: 649

  • Since: 2008/1/11


hello, I am preparing a theme,in it I integrate featured content slider with publisher,maybe it can help you.
by this way each news added to publisher will be automaticly shown in the block.
I think the end of this week it will be published.
the road of success is always under construction

8
h725
Re: Yahoo Style News display - News Module
  • 2010/7/20 12:44

  • h725

  • Just popping in

  • Posts: 4

  • Since: 2010/7/19


Quote:

Do you mean latest news slider ? there is a hack for smartsection to display this in a block


I need to create a block in which latest news appears like Yahoo homepage, with a slide effect.
What's the hack I can use? I want to test it on my site, thanks!


Thank you mariane, if you can post the code of your block I guess I can use it.

9
mariane
Re: Yahoo Style News display - News Module
  • 2010/7/20 13:32

  • mariane

  • Theme Designer

  • Posts: 649

  • Since: 2008/1/11


my code will be based on publisher,so you dont have to change anything manualy with each update of your website.
the standard way to add it to your theme is the following :
- download the effect from here then unzip the folder
- put the js folder inside your theme
- edit your theme.html , and in the js area put this code :
le="color: #000000"><?php <script type="text/javascript" src="<{$xoops_imageurl}>js/jquery-1.2.6.min.js"> </script> <script type="text/javascript" src="<{$xoops_imageurl}>js/jquery-easing-1.3.pack.js"> </script> <script type="text/javascript" src="<{$xoops_imageurl}>js/jquery-easing-compatibility.1.2.pack.js"> </script> <script type="text/javascript" src="<{$xoops_imageurl}>js/coda-slider.1.1.1.pack.js"> </script>


also in the theme.html , and before the </head> immediatly put this code :
le="color: #000000"><?php <script type="text/javascript"> var theInt = null; var $crosslink, $navthumb; var curclicked = 0; theInterval = function(cur){ clearInterval(theInt); if( typeof cur != 'undefined' ) curclicked = cur; $crosslink.removeClass("active-thumb"); $navthumb.eq(curclicked).parent().addClass("active-thumb"); $(".stripNav ul li a").eq(curclicked).trigger('click'); theInt = setInterval(function(){ $crosslink.removeClass("active-thumb"); $navthumb.eq(curclicked).parent().addClass("active-thumb"); $(".stripNav ul li a").eq(curclicked).trigger('click'); curclicked++; if( 6 == curclicked ) curclicked = 0; }, 3000); }; $(function(){ $("#main-photo-slider").codaSlider(); $navthumb = $(".nav-thumb"); $crosslink = $(".cross-link"); $navthumb .click(function() { var $this = $(this); theInterval($this.parent().attr('href').slice(1) - 1); return false; }); theInterval(); }); </script>

now it's time to put the slider, create a folder inside your theme for images and call it images or img, as you want.
then edit again your theme.html, choose where you want to put the slider.
past this code please , I xoopsified it to you , it means instead src="images/abc.jpg" , I put the xoops link :="<{xoImgUrl images/abc.jpg}>" :
use this code please :

le="color: #000000"><?php <div id="page-wrap"> <div class="slider-wrap"> <div id="main-photo-slider" class="csw"> <div class="panelContainer"> <div class="panel" title="Panel 1"> <div class="wrapper"> <img src="<{xoImgUrl images/tempphoto-1.jpg}>" alt="temp" /> <div class="photo-meta-data"> Photo Credit: <a href="http://flickr.com/photos/astrolondon/2396265240/">Kaustav Bhattacharya</a><br /> <span>"Free Tibet" Protest at the Olympic Torch Rally</span> </div> </div> </div> <div class="panel" title="Panel 2"> <div class="wrapper"> <img src="<{xoImgUrl images/tempphoto-2.jpg}>" alt="temp" /> <div class="photo-meta-data"> Chicago Bears at Seattle Seahawks<br /> <span>Fifth field goal, overtime win for the Seahawks</span> </div> </div> </div> <div class="panel" title="Panel 3"> <div class="wrapper"> <img src="<{xoImgUrl images/scotch-egg.jpg}>" alt="scotch egg" class="floatLeft"/> <h1>How to Cook a Scotch Egg</h1> <ul> <li>6 hard-boiled eggs, well chilled (i try to cook them to just past soft boiled stage, then stick them in the coldest part of the fridge to firm up)</li> <li>1 pound good quality sausage meat (i used ground turkey meat, seasoned with sage, white pepper, salt and a tiny bit of maple syrup)</li> <li>1/2 cup AP flour</li> <li>1-2 eggs, beaten</li> <li>3/4 cup panko-style bread crumbs</li> <li>Vegetable oil for frying</li> </ul> </div> </div> <div class="panel" title="Panel 4"> <div class="wrapper"> <img src="<{xoImgUrl images/tempphoto-4.jpg}>" alt="temp" /> <div class="photo-meta-data"> A Poem by Shel Silverstein<br /> <span>Falling Up</span> </div> </div> </div> <div class="panel" title="Panel 5"> <div class="wrapper"> <img src="<{xoImgUrl images/tempphoto-5.jpg}>" alt="temp" /> <div class="photo-meta-data"> New Video on CSS-Tricks<br /> <span>Using Wufoo for Web Forms</span> </div> </div> </div> <div class="panel" title="Panel 6"> <div class="wrapper"> <h1>A Tale of Two Cities</h1> <p><em>Charles Dickins</em></p> <blockquote>It was the best of times, it was the worst of times, it was the age of wisdom, it was the age of foolishness, it was the epoch of belief, it was the epoch of incredulity, it was the season of Light, it was the season of Darkness, it was the spring of hope, it was the winter of despair, we had everything before us, we had nothing before us, we were all going direct to heaven, we were all going direct the other way - in short, the period was so far like the present period, that some of its noisiest authorities insisted on its being received, for good or for evil, in the superlative degree of comparison only.</blockquote> </div> </div> </div> </div> <a href="#1" class="cross-link active-thumb"><img src="<{xoImgUrl images/tempphoto-1thumb.jpg}>" class="nav-thumb" alt="temp-thumb" /></a> <div id="movers-row"> <div><a href="#2" class="cross-link"><img src="<{xoImgUrl images/tempphoto-2thumb.jpg}>" class="nav-thumb" alt="temp-thumb" /></a></div> <div><a href="#3" class="cross-link"><img src="<{xoImgUrl images/tempphoto-3thumb.jpg}>" class="nav-thumb" alt="temp-thumb" /></a></div> <div><a href="#4" class="cross-link"><img src="<{xoImgUrl images/tempphoto-4thumb.jpg}>" class="nav-thumb" alt="temp-thumb" /></a></div> <div><a href="#5" class="cross-link"><img src="<{xoImgUrl images/tempphoto-5thumb.jpg}>" class="nav-thumb" alt="temp-thumb" /></a></div> <div><a href="#6" class="cross-link"><img src="<{xoImgUrl images/tempphoto-6thumb.jpg}>" class="nav-thumb" alt="temp-thumb" /></a></div> </div> </div> </div>


and the final step is the css :
- paste this code to your style.css used in your theme
le="color: #000000"><?php /* UTILITY STYLES */ .floatLeft { float: left; margin-right: 10px;} .floatRight { float: right; } .clear { clear: both; } a { outline: none; } /* PAGE STRUCTURE */ #page-wrap { width: 500px; margin: 25px auto; position: relative; min-height: 500px; background: url(images/bg.png) top center; } /* TYPOGRAPHY */ ul { list-style: square inside; } a, a:visited { color: #729dff; text-decoration: none; } a:hover, a:active { color: white; } blockquote { padding: 0 20px; margin-left: 20px; border-left: 20px solid #ccc; font-size: 14px; font-family: Georgia, serif; font-style: italic; margin-top: 10px;} /* SLIDER */ .slider-wrap { width: 419px; position: absolute; top: 87px; left: 40px; } .stripViewer .panelContainer .panel ul { text-align: left; margin: 0 15px 0 30px; } .stripViewer { position: relative; overflow: hidden; width: 419px; height: 285px; } .stripViewer .panelContainer { position: relative; left: 0; top: 0; } .stripViewer .panelContainer .panel { float: left; height: 100%; position: relative; width: 419px; } .stripNavL, .stripNavR, .stripNav { display: none; } .nav-thumb { border: 1px solid black; margin-right: 5px; } #movers-row { margin: -43px 0 0 62px; } #movers-row div { width: 20%; float: left; } #movers-row div a.cross-link { float: right; } .photo-meta-data { background: url(images/transpBlack.png); padding: 10px; height: 30px; margin-top: -50px; position: relative; z-index: 9999; color: white; } .photo-meta-data span { font-size: 13px; } .cross-link { display: block; width: 62px; margin-top: -14px; position: relative; padding-top: 15px; z-index: 9999; } .active-thumb { background: transparent url(images/icon-uparrowsmallwhite.png) top center no-repeat; }

and dont forget to copy all icons and pictures inside the FeaturedContentSlider/images into your images folder inside the theme.

- clear the cach, and that's it.
by this way each time you add a new article, you have to create an image and a thumbnail with the same sizes used in the slider, then upload them to yourtheme/images, and change the name if necessary also write the headlines of the article under the class into the div in each panel.

my way , or what I am working on, is to make this slider woking automaticly with publisher, and as I told you it will be online soon.
try this code and let me know the result


the road of success is always under construction

10
btesec
Re: Yahoo Style News display - News Module
  • 2010/7/20 14:48

  • btesec

  • Friend of XOOPS

  • Posts: 623

  • Since: 2007/2/20


Hi Guys,

I followed up a couple of hacks that were available. however these work with publisher or articles module. My scenario is that I am already using the news module last version by Tabis on Xuups site . So adopting the Publisher solution is not an option now.

I need to display the latest three news articles from the news mod categories with their attached image, using similar style from http://css-tricks.com/creating-a-slick-auto-playing-featured-content-slider/

This is the ultimate goal.

Login

Donat-O-Meter

Stats
Goal: $15.00
Due Date: Aug 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $15.00
Make donations with PayPal!