vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   How can I use {vb:raw vboptions.xxx} within CSS template?? (https://vborg.vbsupport.ru/showthread.php?t=268125)

EquinoxWorld 08-07-2011 03:58 PM

How can I use {vb:raw vboptions.xxx} within CSS template??
 
Hello everyone, I currently have a slideshow to which I created a couple of options in the admin panel for the admin to be able to control it's width and height easily from the product options, instead of having to go edit style-vars.

The slideshow's width and height are controlled by CSS attributes. I created a custom CSS template and inlciuded it within my page with the slideshow making a call to said template. My problem is apparently it's not reading the CSS correctly using {vb:raw vboptions.xxx} as a replacement for actual values.

Here's what I am trying to do:

HTML Code:

#slide {
    position:relative;
    width:{vb:raw vboptions.cotw_sotw_max_width}px;
    height:{vb:raw vboptions.cotw_sotw_max_height}px;
    background:url(images/loading.gif) no-repeat 50% 50%;
}

If I do just this:

HTML Code:

#slide {
    position:relative;
    width:500px;
    height:200px;
    background:url(images/loading.gif) no-repeat 50% 50%;
}

The slideshow changes to those dimensions if I do it the previous way it does not change size, it just adapts it's size to the image that's showing. Anyone have any ideas why or how I can't get this to work being able to use those custom options to control width and height? Any info anyone can provide will be appreciated. Thanks for your time everyone.

Note: I was unsure whether to place this thread here or in Design so if any mod wants to move it by all means. Sorry for the trouble in advance if you do. :)

Lynne 08-07-2011 04:26 PM

I used options in my css template for one of my modifications and it worked just fine. What "Data Validation Type" did you select for your option? Is it an Integer?

EquinoxWorld 08-07-2011 04:29 PM

Quote:

Originally Posted by Lynne (Post 2230529)
I used options in my css template for one of my modifications and it worked just fine. What "Data Validation Type" did you select for your option? Is it an Integer?

Positive Integer... Would it make a difference?

Edited: Doesn't..I checked :)

Badshah93 08-07-2011 04:40 PM

{vb:raw vboptions.xxx} is working well. try adding ur css code to additional.css template and see if that works

EquinoxWorld 08-07-2011 04:47 PM

Quote:

Originally Posted by Sherif (Post 2230538)
{vb:raw vboptions.xxx} is working well. try adding ur css code to additional.css template and see if that works

OK it does work when I use the code in additional.css ... How can I use it on my own css template then? It would be a pain to have to ask whoever it is installing this to have to edit their additional.css template right?

Lynne 08-07-2011 04:49 PM

Are you adding it to a template that is called xxxx.css? I created my own .css template and I use the settings in there.

EquinoxWorld 08-07-2011 04:53 PM

Quote:

Originally Posted by Lynne (Post 2230546)
Are you adding it to a template that is called xxxx.css? I created my own .css template and I use the settings in there.

Yup, to COTW_Adittional.css to be exact. The options work fine in the default additional.css template but not in my own for some reason. Maybe there's some rendering that needs to be done somewhere to get the option to render in my custom css template? :confused:

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

And I am using this to link it in the template:

HTML Code:

<link rel="stylesheet" type="text/css" href="{vb:raw vbcsspath}COTW_Adittional.css" />

Badshah93 08-07-2011 05:06 PM

i just created a new css template and its working well..

where you using this code ?

Code:

<link rel="stylesheet" type="text/css" href="{vb:raw vbcsspath}COTW_Adittional.css" />

EquinoxWorld 08-07-2011 05:10 PM

Quote:

Originally Posted by Sherif (Post 2230558)
i just created a new css template and its working well..

where you using this code ?

Code:

<link rel="stylesheet" type="text/css" href="{vb:raw vbcsspath}COTW_Adittional.css" />

Yeah I am. Is it correct?

Badshah93 08-07-2011 05:14 PM

Quote:

Originally Posted by EquinoxWorld (Post 2230560)
Yeah I am. Is it correct?

ya code is correct, but you are placing this code in which template ?

i placed my code in headinclude template


All times are GMT. The time now is 11:47 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.01120 seconds
  • Memory Usage 1,739KB
  • 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
  • (2)bbcode_code_printable
  • (3)bbcode_html_printable
  • (5)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete