vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   Custom Thumbnail Size For Section (https://vborg.vbsupport.ru/showthread.php?t=275274)

clayton47 12-09-2011 04:21 PM

Custom Thumbnail Size For Section
 
How would I go about doing this? I tried just changing it up with some css, but the thumbnail settings over ride anything with the important rule that is attached by default. I want to keep thumbnails the same everywhere buy my home page of my cms.

Any help on this would be greatly appreciated. I have been banging my head for weeks. Found nothing on the forums, or googling.

Thanks, Clayton

Lynne 12-09-2011 05:40 PM

What do you have set for AdminCP > Settings > Options > content management > Use Thumbnails in Preview ? If you have that set to No, then it will use regular CSS to size the images and then you could write some custom CSS for your Home page to change it just there.

clayton47 12-09-2011 05:57 PM

It is set to no. I cleared cache, rebuilt thumbnails. and tried adding new posts and new thumbnails and it still automatically resized them.

Do I need to double click the image and select the size? It only gives me thumnail, med, large, fullsize. Or do I need to select anything if I set my css for the image size?

--------------- Added [DATE]1323457565[/DATE] at [TIME]1323457565[/TIME] ---------------

the default template is "vbcms_content_section_page" if I want to create my own and use it how do I select it or activate it? So pages that I want to use a certain size thumbnail I can, and others that I want to use the default they will. If I address the css for the default template it obviously affects it everywhere.

Lynne 12-09-2011 08:01 PM

It will resize them via this CSS:
.cms_article_preview_image {
max-height:{vb:stylevar image_thumbnail_max};
max-width:{vb:stylevar image_thumbnail_max} !important;
_width:{vb:stylevar image_thumbnail_max}; /*IE6*/
}

clayton47 12-09-2011 08:22 PM

I had already targeted .cms_article_preview_image, but why you include {vb:stylevar image_thumbnail_max}?

Back to my template question, I found the template - vbcms_content_article_preview

Can I create a duplicate of it with a different name, rename some of elements and select where to show this template? If I only want my home page section to show thumbnails a certain way could I do it that way? I dont know how to activate or utilize creating a custom template. Please clarify how I can do that, I would be able to do some really nice stuff If I could only find how to implement the custom templates.

clayton47 12-13-2011 05:24 PM

Lynne could you answer my question on how to use the custom templates. I have found no solid answer anywhere on how to use it once created. *only have found info for when creating a static page. But what about using it for a specific section. And then letting all the other sections use the standard templates.

I would greatly appreciate any help on this!

Lynne 12-13-2011 09:42 PM

Totally replacing the template for one section? The only part I know you may easily replace is the grid via the layout.

clayton47 12-13-2011 10:02 PM

Ok, how can you use a custom template then. If I select a template this is what is shown
Quote:

vbcms_content_article_preview:

This template has not been customized in this style or any of its parent styles.

Double-click the template name or click the 'Customize' button to add a customized version of this template to the current style and its child sets.

Last edited June 28 2011 at 16:09 by michael.lavaveshkul
So If you create a new vbcms_content_article_preview template named "vbcms_content_article_custom_preview" how would you use it?

Lynne 12-14-2011 01:04 AM

You would need to modify the code, or write some plugin (not sure you can do it via plugin), to render the new template, if in that specific section, which is not as easy as it sounds.

clayton47 12-14-2011 02:49 AM

I know its not easy as it sounds. Thats why I am here asking this specific question. I just dont know why its made so conveniently easy to "create a custom template" for the vbulletin template structure and no way to conveniently use it.

Dead Eddie 12-14-2011 03:21 AM

To be fair, changing the template used on the fly isn't exactly standard functionality.

There's no great way to do it, but you should be able to hook into vbcms_article_populate_start and recreate the $view object.

Completely untested:

PHP Code:

if(self::VIEW_PREVIEW == $viewtype && $this->content->getParentId() == 1//set to the node id of your home page.
{
$view = new vB_View_Article('vbcms_content_article_custom_preview');


This would have to be repeated for other content types as needed...

(Actually, on second thought, ignore this. It'll only work if your home page content is assigned to the hme page)

clayton47 12-14-2011 04:15 AM

Thank you for your reply. When you say this would have to be repeated for other content types as needed what does that mean?

All I want to do is have a custom structure of my "home" page which is a specific section in vbulletin terms. And only that section use it.

Heres one part of my reasoning for the custom template for the vbcms_content_article_custom_preview vs the default vbcms_content_article_preview - is the default template has css styling that has the *important rule applied that I cant over ride in the "additional.css". So I was going to add some custom div class's to target the thumbnail images for that specific section.

If you have a better way of achieving this please let me know. Cause I want the default to work everywhere else. I already have to manually add the articles to this "home" section as it is.

Lynne 12-14-2011 04:19 AM

You may override CSS. You just haven't told us the exact rule you wish to override so we can't see exactly where it is in your page (which you also have not linked to) and so we can't tell you what to do. Also, even if you do a new basic page, I'll bet you still use a layout/grid and my guess is the CSS is in there. But, we won't know until you tell us exactly what you need to change.

clayton47 12-14-2011 04:30 AM

I want to change the article preview thumbnail in my home page section.

--------------- Added [DATE]1323840903[/DATE] at [TIME]1323840903[/TIME] ---------------

right now when I try to target the element it reflects it everywhere.

clayton47 12-15-2011 09:49 PM

Do you know what I need to do differently?

Lynne 12-15-2011 11:12 PM

How about a link to the section you wish to change and a link to a section that should stay the same.

clayton47 12-15-2011 11:25 PM

Ok I will post a link soon as I get my custom style loaded. I am having difficulty for some reason.

clayton47 12-19-2011 05:04 PM

ok the url is texasmx.com/forums the site is password protected since it is in a testing directory. I will pm you the login details so you can access it. you will see one thumbnail on the home page of the cms in the post "welcome to texasmx" I would like to make the preview thumbnail larger. maybe even full width of that area. and then style the title and preview text differently. I just cant seem to figure how to override the default *important styling. This is the point I was trying to make a custom template and rename the divs around the code that calls the content. Since this is the only section that will really be using thumbnails I can just have the archives of that section display it the same way.

Looking forward to your response!

clayton47 12-21-2011 03:55 PM

Lynne did you happen to take a look yet?

Lynne 12-21-2011 09:58 PM

Quote:

Originally Posted by clayton47 (Post 2279761)
Lynne did you happen to take a look yet?

I replied to you just after I got your PM.


All times are GMT. The time now is 04:18 AM.

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.01071 seconds
  • Memory Usage 1,761KB
  • 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
  • (1)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (20)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