vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   CSS If Condtion? (https://vborg.vbsupport.ru/showthread.php?t=224563)

TheInsaneManiac 10-04-2009 07:20 PM

CSS If Condtion?
 
Is it possible to use if conditionals in CSS? Like template conditions, profile field conditionals, ect?

luki 10-05-2009 07:56 AM

I don't think so, but you can try to make two ids, #first_user, #second_user and then use if in template.

Code:

<if condition="something == 0">
 <sometag id="first_user"/> 
<else />
    <sometag id="second_user"/> 
</if>


TheInsaneManiac 10-05-2009 09:13 AM

Quote:

Originally Posted by luki (Post 1895062)
I don't think so, but you can try to make two ids, #first_user, #second_user and then use if in template.

Code:

<if condition="something == 0">
 <sometag id="first_user"/> 
<else />
    <sometag id="second_user"/> 
</if>


Well I wanted to make it so that a profile field containing a background image link could be used in the CSS. This way the USER can decide the background.

Lynne 10-05-2009 03:44 PM

Have you tried it? I would think that if you add the css inline - style="background: xxxxx"

TheInsaneManiac 10-05-2009 05:45 PM

Quote:

Originally Posted by Lynne (Post 1895193)
Have you tried it? I would think that if you add the css inline - style="background: xxxxx"

Yea I sent to the CSS manager and added $userinfo[field15] to the background url($userinfo[field15]), but it didn't work. It just made the url to http://www.website.com/$userinfo[field15]

Lynne 10-05-2009 07:26 PM

Add it *inline*.

HTML Code:

<div style="background: url($userinfo[field15])"> etc....

TheInsaneManiac 10-06-2009 12:13 AM

Quote:

Originally Posted by Lynne (Post 1895325)
Add it *inline*.

HTML Code:

<div style="background: url($userinfo[field15])"> etc....

This is the overall background though. Like the forum body background.

EX:
Code:

body
{
        background: #080B1C url(banner.jpg) no-repeat top center fixed;
        color: #007DDA;
        font: 11px verdana, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif;
        margin: 0px;
        padding: 0px;
        height: 100%;


Lynne 10-06-2009 03:34 AM

OK, so try it inline in the body tag. Just try it inline as opposed to putting it in the css area.

TheInsaneManiac 10-06-2009 04:11 AM

Quote:

Originally Posted by Lynne (Post 1895481)
OK, so try it inline in the body tag. Just try it inline as opposed to putting it in the css area.

What do you mean? Wouldn't this mean I would have to edit the body tag on EVERY template?

Lynne 10-06-2009 01:14 PM

I was trying to figure out if it would work that way. If it does, then you can figure out how to go about it.

I think I'm not understanding what you are doing. You have a User Profile Field, and the user enters a color for the background? adn then you want that to effect the background on all your pages? What is the name of your background class that you need to change or is your background actually part of the body tag as you said above? If so, have you tried just seeing if it works inline for the body tag, or tried adding the class/css in the headerinclude template?


All times are GMT. The time now is 09:24 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.02004 seconds
  • Memory Usage 1,736KB
  • 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
  • (3)bbcode_code_printable
  • (2)bbcode_html_printable
  • (4)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