vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Design and Graphics Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=253)
-   -   Full image on CMS home page and text below image (https://vborg.vbsupport.ru/showthread.php?t=280032)

fwulfers 03-14-2012 04:01 PM

Full image on CMS home page and text below image
 
The default is showing a thumbnail of 150px and the intro to the article starting to the right of the thumbnail.

I would like to show the first full image of the article (usually 640px on our site) and the text starting below the picture on the CMS home page. Something similar as they have on Autoblog.com.

I know how to adjust the size of the thumbnail to a larger size but how to make the text start below the image?

Attitude5ire 03-15-2012 06:24 AM

There is an option in CMS to show full images instead of thumbnails.. should be in content management settings

fwulfers 03-15-2012 01:23 PM

Thanks for the response. I already have it set to No:

Quote:

Set this to yes to switch the article previews to use image thumbnails rather than resizing the full images. Thumbnails must be enabled for this option to have any effect.
But the size of preview images are still controlled by the attachment_image_thumbnail_max settings under Attachments in the stylevar.

Quote:

This stylevar controls the maximum size of inline attached images whose size is set to "Thumbnail" in their Image Settings.
Doesn't make sense..

chrisngrod 03-15-2012 03:19 PM

That is true...

Code:

.cms_article_preview_image {
        max-height:{vb:stylevar attachment_image_thumbnail_max};
        max-width:{vb:stylevar attachment_image_thumbnail_max} !important;
}

Hard code some numbers in there?

vbcms.css

fwulfers 03-15-2012 05:41 PM

That is possible but that's the same as changing the value in the stylevar. And I still need the preview text to start below the image, not to the side.

chrisngrod 03-15-2012 06:24 PM

Quote:

Originally Posted by fwulfers (Post 2309745)
That is possible but that's the same as changing the value in the stylevar. And I still need the preview text to start below the image, not to the side.

Sorry I think I only read the last posts. Went back and looked at OP.

Code:

<img class="cms_article_preview_image" src="{vb:raw previewimage}" alt="<vb:if condition="$attachment_settings['alt']">{vb:raw attachment_settings['alt']}<vb:else />{vb:rawphrase article_preview}</vb:if>" <vb:if condition="$attachment_settings['title']">title="{vb:raw attachment_settings['title']}"</vb:if> /></a>

to this...


<img src="{vb:raw previewimage}" width="650" alt="<vb:if condition="$attachment_settings['alt']">{vb:raw attachment_settings['alt']}<vb:else />{vb:rawphrase article_preview}</vb:if>" <vb:if condition="$attachment_settings['title']">title="{vb:raw attachment_settings['title']}"</vb:if> /></a>
<br />

Even doing something simple like this seems to work. You could tweak the code to your needs.

fwulfers 03-15-2012 07:14 PM

Brilliant, that is perfect and looks great. http://saabworld.net/content/

Some articles do have smaller pictures so those are being stretched out to 650px. Is there a way to set it so smaller images than the specified width (650px here) will display their original size?

chrisngrod 03-15-2012 07:41 PM

Looked at your site...

How big do your images get? You could take the width out, but this could have a negative impact if your users have a high res screen.

Have you ever thought about going fixed width just for the CMS portion? (example is my site)


You could add something like this to vbcms.css or additional.css if you have that plugin...


Code:

.myarticlepreview {
        max-height: 450px;
        max-width: 650px !important;
        display: block; 
        margin-left: auto; 
        margin-right: auto;
        margin-top:15px;   
}

Configure your max settings... When the image isn't larger than that, it won't resize. Change what you did earlier to (vbcms_content_article_preview).

Code:


<img class="myarticlepreview" src="{vb:raw previewimage}" alt="<vb:if condition="$attachment_settings['alt']">{vb:raw attachment_settings['alt']}<vb:else />{vb:rawphrase article_preview}</vb:if>" <vb:if condition="$attachment_settings['title']">title="{vb:raw attachment_settings['title']}"</vb:if> /></a>
<br />

Oh yeah that puts us back to where we started at... Also in vbcms.css... Comment this out like so...

Code:

.cms_article_preview_image,
.showpreviewonly object,
.showpreviewonly iframe {
        border:{vb:stylevar vbcms_article_preview_image_border};
        outline: {vb:stylevar vbcms_article_preview_image_outline};
        /* float:{vb:stylevar left}; */
        margin:{vb:stylevar vbcms_article_preview_image_margin};
}

Guess we have to fix the videos as well...

vbcms_article_preview_object_size (stylevar) - Change to whatever sizes you want.

I tried to center up the video, but unless I used <center></center> it didn't work (that has been depreciated and most people will say don't use it... however I think there is going to be compatibility for a long time). I have a fixed width CMS so it won't affect me as much. Your video will probably show up aligned to the left though.

Good luck.

Gamelobby 01-08-2013 05:24 PM

Is all of this still necessary in 4.2 ?

Toorak Times 03-16-2013 01:27 PM

Quote:

Originally Posted by Gamelobby (Post 2395584)
Is all of this still necessary in 4.2 ?


I have a mate that swore black and blue you had to hard code to get results, most can be done through the Stylevars for me, just recently'getting' it, when you do it is a piece of cake


All times are GMT. The time now is 09:13 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01567 seconds
  • Memory Usage 1,742KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (5)bbcode_code_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete