Please login or register.

Login with username, password and session length
Advanced search  

News:

Latest sNews - sNews 1.7 - with its own forums - for discussion and user mods.

Author Topic: Site Widget [WIP]  (Read 1298 times)

jared351

  • Sr. Member
  • ****
  • Karma: 4
  • Posts: 276
Site Widget [WIP]
« on: October 02, 2007, 07:26:42 am »

Now days it has become pretty popular to display some sort of widget on your site or blog, and they can be useful at times, so I thought doing one using sNews would be neat. To be honest, I'm not a code saavy kind of guy, although I can read through it analytically. I guess the way I would like to approach this would be to display a number of new articles in the widget and have it styled to your liking through CSS and then call it in your index.php by the js file. I really don't know where to start as far as retrieving the articles, so help with that would be appreciated.  Your opinions and help is definitely welcome!
Heres some sample code to give you an idea...  Thanks.

Code: [Select]
(function(){
document.write('<div class="widget_wrap">');

document.write('<div class="widget_title"><a href="http://www.yourdomain.com">Your Site</a></div>')

document.write('<div class="widget_content"><ul>');

    document.write('<li><a href="http://www.yourdomain.com/show/something">The Content</a></li>')

    document.write('<li><a href="http://www.yourdomain.com/show/something">The Content</a></li>')

document.write('</ul></div>');

document.write('<div class="widget_visit"><a href="http://www.yourdomain.com">Your Site</a></div>')
 
document.write('</div>') })()
« Last Edit: October 02, 2007, 07:11:32 pm by jared351 »
Logged