vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   Alt. colour based on style (https://vborg.vbsupport.ru/showthread.php?t=304440)

Morrus 11-12-2013 01:39 PM

Alt. colour based on style
 
I'm hoping this isn't a programming question, but I'll start here.

I have two styles; black and white. Default text colours work correctly, as they should (light on the black, dark on the white).

However, I also need to be able to post snippets in news items in a different colour to the rest of the (default) text. I can't select a colour from the colour chooser, as one colour won't be suitable for both styles. So I need a way to select a 'alt default' colour which changes depending on the style in the same way that the default colour does.

So... how would I do that? Thanks!

Lynne 11-12-2013 04:54 PM

"post snippets in news items" ??? Where is this? Are you talking about making regular posts or what? I would say to use a class and then define that class in that style, but that may not work depending on where you are talking about these "post snippets".

Morrus 11-12-2013 05:20 PM

By "posts snippets in news items" I mean "part of the text in a post, usually using the CMS, but sometimes a regular forum post too".

Like this:

This is a new item. It contains a snippet like this: "This is the snippet. It's a different colour. This colour depends on what style I'm using." Continuing the news item in regular forum default colour.

Max Taxable 11-12-2013 05:24 PM

Sounds like you need a BB code that makes anything under it the second alternate color of the style?

Morrus 11-12-2013 06:00 PM

Is there a second alternate colour setting somewhere? Or are we talking programming templates and conditionals and stuff here?

Max Taxable 11-12-2013 06:09 PM

Quote:

Originally Posted by Morrus (Post 2460168)
Is there a second alternate colour setting somewhere? Or are we talking programming templates and conditionals and stuff here?

Styles and Templates>Style Manager>Style in question>All Style Options.

At least that's where to find it in vB3.8.7 - not sure if that's true of v4.

Scroll down until you find "Second Alternating Color."

You don't necessarily want to change that, you want to be able to call to it in script. In script, that call looks like <td class="alt2" or "alt1"

Morrus 11-12-2013 08:20 PM

I don't have 3.x; but from what I recall what you're referring to there is table row background colours, not font colours?

Max Taxable 11-12-2013 10:02 PM

You are right for some reason I was thinking of bg, like a quote box.

However if you create a custom BB code that allows you to pick any HEX color (such as #001D3E as a example) or even a pre-set one, it would apply to the type inside the BB tags, correct?

Only question now is, how to construct that custom BB code.

Lynne 11-12-2013 10:45 PM

You could add a special bbcode for it. Something that adds a class:

<span class="alt2">YOUR TEXT HERE</span>

and then you just define .alt2 in your additional.css template for each style.

Max Taxable 11-12-2013 11:07 PM

^^ DING DING DING!

Or you could even call up a already existing "additional css template" from the style if it's appropriate.


All times are GMT. The time now is 11:39 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.01024 seconds
  • Memory Usage 1,728KB
  • 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_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