Register Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools
  #1  
Old 15 Jul 2011, 02:44
Blade-uk Blade-uk is offline
 
Join Date: Nov 2003
Thumbnail Images

Ok so i have a widget called featured content and i have copied the template code from vbcms_widget_recentarticle_page and created a new template called vbcms_widget_recentarticle_page_featured and pointed my featured content widget at it.

You can see it in action at the top of the page on www.eteknix.com

This is the code for it:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

What i want to do now is to have a thumbnail to go with each article but i can't for the life of me work out the code needed.

Also i would much prefer a horizontal list as opposed to the vertical list of articles as it's currently set out.

Any ideas?

Thanks,

Andy
__________________
Website - www.eteknix.com
Forum - http://forums.eteknix.com
Email - aruffell at eteknix dot com
Reply With Quote
  #2  
Old 15 Jul 2011, 02:56
Post Reader's Avatar
Post Reader Post Reader is offline
 
Join Date: Nov 2009
Real name: Wajdaan Alam
as far as i can say but not confirmed look at this code but it'll show a same image on all news



Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Reply With Quote
  #3  
Old 15 Jul 2011, 12:21
Blade-uk Blade-uk is offline
 
Join Date: Nov 2003
Tried tinkering around myself, but am unsure on the syntax to use.

Anyone able to help?
__________________
Website - www.eteknix.com
Forum - http://forums.eteknix.com
Email - aruffell at eteknix dot com
Reply With Quote
  #4  
Old 17 Jul 2011, 11:00
Blade-uk Blade-uk is offline
 
Join Date: Nov 2003
Wow it seems this site really is dying. I asked on vb.com and they told me to come here but was afraid to due to the site dying, so now i'm stuck with something that doesn't have the functionality i need.
__________________
Website - www.eteknix.com
Forum - http://forums.eteknix.com
Email - aruffell at eteknix dot com
Reply With Quote
  #5  
Old 17 Jul 2011, 17:55
Dead Eddie's Avatar
Dead Eddie Dead Eddie is offline
 
Join Date: Apr 2004
Originally Posted by Blade-uk View Post
What i want to do now is to have a thumbnail to go with each article but i can't for the life of me work out the code needed.
This'll display the preview image associated with the article.


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Reply With Quote
  #6  
Old 18 Jul 2011, 22:02
Blade-uk Blade-uk is offline
 
Join Date: Nov 2003
Originally Posted by Dead Eddie View Post
This'll display the preview image associated with the article.


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.
Eddie you are a legend.

Only problems i have now is that i've had to make it 100x60 as it was WAY too big for that box but now it looks odd as the images are all different sizes so don't end up square. How can i sort that so it uses the imagewidth and heigh as mentioned in the settings but at a 40% reduction or something so the thumbnails are the right aspect ratio?

Also here is my code:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

How can i have it so i have two columns as there is a big white space on the right of the widget box.

Many thanks,

Andy
__________________
Website - www.eteknix.com
Forum - http://forums.eteknix.com
Email - aruffell at eteknix dot com
Reply With Quote
  #7  
Old 19 Jul 2011, 03:04
Dead Eddie's Avatar
Dead Eddie Dead Eddie is offline
 
Join Date: Apr 2004

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

You can adjust the proportions as you need, just as long as they stay the same between the two options. And remember, you're not actually resizing the image, you're adjusting the size that the page is using to display it. By default, the CMS doesn't do a very good job with thumbnails...

As for your other issue, sorry. Tried it, but CSS isn't my strong suite.
Reply With Quote
  #8  
Old 29 Nov 2011, 16:12
Jokorey Jokorey is offline
 
Join Date: Nov 2011
Dead Eddie - thank you for pointing me here I'm having an issue getting this to work, or maybe I'm not understanding the functionality properly. Could you shed some light on this for me? How do I associate a preview image with an article? I feel like this is a 'duh' question, but I am pretty lost on this. Also, where should I insert this code? I may or may not have a problem with this, instead it may just be I don't have a preview image associated with the article. Right now, I have an article that has an image attached to it, and when that happens, my goal is to have a preview of that image shown in the widget. Here is my code:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Reply With Quote
  #9  
Old 30 Nov 2011, 03:05
Dead Eddie's Avatar
Dead Eddie Dead Eddie is offline
 
Join Date: Apr 2004
Originally Posted by Jokorey View Post
How do I associate a preview image with an article?
The preview image is associated when you save an article. Typically, it's either the first one attached or embedded in the article (it's also what displays on the section/category pages).

Originally Posted by Jokorey View Post
Also, where should I insert this code?
Simple answer is "Insert it where you want it to show up".

I've attached an idea of where I'd start (although, I haven't previewed this, so the display may be wonky...try it on a test board!). I've bolded my edits, in case you're looking for them.


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Reply With Quote
  #10  
Old 05 Dec 2011, 20:22
Jokorey Jokorey is offline
 
Join Date: Nov 2011
Thanks Eddie - this works as intended perfectly! I'm curious about one thing though...when we are talking about image size, the /# is an indicator of the ratio, not a fixed size, right? Is there a way to code in a fixed size so my contributors don't have to worry about using a specific image size? Or am I way off base?
Reply With Quote
  #11  
Old 05 Dec 2011, 22:18
Dead Eddie's Avatar
Dead Eddie Dead Eddie is offline
 
Join Date: Apr 2004
Sure. width="100" height="100".

You just want to make sure the images are the correct proportion. Nothing worse than taking an image that's 75 by 300 and resizing it to 100 by 100.
Reply With Quote
  #12  
Old 26 Jun 2012, 18:11
johnnymc7 johnnymc7 is offline
 
Join Date: Nov 2010
Dead Eddie thanks for that code its exactly what Ive been searching for!!! Is there anyway i can make the text go to the rightside of the image I used your code on my website www.irishdrumandbass.com

Thanks John
Reply With Quote
  #13  
Old 18 Jul 2012, 13:40
Dead Eddie's Avatar
Dead Eddie Dead Eddie is offline
 
Join Date: Apr 2004
Answered the PM, but I'll poke my head in here, too. Better late than never, eh?

Change the image tag to this:

<img src="{vb:raw article.previewimage}" width="{vb:math {vb:raw article.imagewidth} / 2}" height="{vb:math {vb:raw article.imageheight} / 2}" style="float:left;">

(Or whatever you used in the height/width properties)
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


New To Site? Need Help?

All times are GMT. The time now is 06:30.

Layout Options | Width: Wide Color: