TinyPortal

Development => Support => Topic started by: Bloodlvst on October 29, 2010, 04:40:58 PM

Title: Custom Stylesheets for blocks?
Post by: Bloodlvst on October 29, 2010, 04:40:58 PM
I've made a ventrilo block, which I will post here once it's finalized.

The problem is that I want to avoid using an iframe. The php script works great, and I have a css file linked to it, in the same directory. When I use an iframe, the script's CSS styling is like as if I ran the script alone. If I use a php block with the following code, it's formatted only according to SMF/TP's CSS.
include('ventrilo/vent.php);
Title: Re: Custom Stylesheets for blocks?
Post by: IchBin on October 29, 2010, 05:18:19 PM
Use the full path instead of the relative path when calling your file from inside a block.
Title: Re: Custom Stylesheets for blocks?
Post by: Bloodlvst on October 29, 2010, 06:07:30 PM
Quote from: IchBin on October 29, 2010, 05:18:19 PM
Use the full path instead of the relative path when calling your file from inside a block.

Would it be possible to just use the pure code as well?

EDIT: Using the full path did not change anything. :(

EDIT2: Pure code also uses default TP CSS
Title: Re: Custom Stylesheets for blocks?
Post by: WillyP on October 29, 2010, 07:09:43 PM
Take a look with Firebug and see if it's finding the css file at all.
Title: Re: Custom Stylesheets for blocks?
Post by: hidden69 on October 30, 2010, 05:50:42 AM
code example:


<style type="text/css">
.ventrilo {
    color: #FF0000;
}
.ventrilo p {
      color: #0000FF;
}
</style>

<span class="ventrilo">

MY TEST

<p> even that works for cut&paste freaks</p>

</span>
Title: Re: Custom Stylesheets for blocks?
Post by: IchBin on November 01, 2010, 11:11:43 PM
Although that is not valid when you stick a <style> tag outside of the body of the theme, it should still work.
Title: Re: Custom Stylesheets for blocks?
Post by: hidden69 on November 02, 2010, 07:21:30 PM
you are right, its not valid, but it is shown.

a valid solution would be

<p style="color:#FF0000">Test 1</p>

<p style="color:#00FF00">Test 2</p>
Title: Re: Custom Stylesheets for blocks?
Post by: Bloodlvst on November 03, 2010, 02:59:48 AM
It was actually me misinterpreting IchBin's answer.

I have it working now, will post it once I tweak the looks.
Title: Re: Custom Stylesheets for blocks?
Post by: hidden69 on November 03, 2010, 09:00:12 AM
Quote from: Bloodlvst on November 03, 2010, 02:59:48 AM
It was actually me misinterpreting IchBin's answer.

I have it working now, will post it once I tweak the looks.

well <link .. > is only allowed in the head section of a html-document and not in the body section to be valid, the same as the first example.