FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » FUDforum Development » Bug Reports » Add Custom CSS Styles?
Show: Today's Messages :: Unread Messages :: Polls :: Message Navigator
| Subscribe to topic | Bookmark topic 
Switch to threaded view of this topic Create a new topic Submit Reply
Add Custom CSS Styles? [message #1384] Wed, 10 April 2002 18:59 Go to next message
snafu is currently offline  snafu   United States
Messages: 27
Registered: April 2002
Karma: 0
Junior Member
add to buddy list
ignore all messages by this user
Is it possible to add custom styles? I tried editing the forum_data/settings/header_4.inc file, but my changes were overwritten as soon as I used the style manager again.

After editing the file, the style manager actually displayed my custom style in the form, using my /*Comment*/ as the label to the form field. (Slick!)

After I hit update, however, the style was removed. Somehow it wasn't recognized and thus deleted. Is there a place where a list of "sanctioned" styles are stored, and can it be customized?

As a workaround, I can probably add a separate stylesheet to the preheader section of the style manager, but it would be nice to have a more tightly integrated solution.
Re: Add Custom CSS Styles? [message #1389 is a reply to message #1384] Wed, 10 April 2002 22:16 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
remove from buddy list
ignore all messages by this user
snafu wrote on Wed, 10 April 2002 6:59 PM

Is it possible to add custom styles? I tried editing the forum_data/settings/header_4.inc file, but my changes were overwritten as soon as I used the style manager again.

After editing the file, the style manager actually displayed my custom style in the form, using my /*Comment*/ as the label to the form field. (Slick!)

After I hit update, however, the style was removed. Somehow it wasn't recognized and thus deleted. Is there a place where a list of "sanctioned" styles are stored, and can it be customized?

As a workaround, I can probably add a separate stylesheet to the preheader section of the style manager, but it would be nice to have a more tightly integrated solution.


There is an easy fix, when you what to add a new css style, add it to header_1.inc also, since the style defenitions are read from there. So, in your case add the style to both header_1.inc & header_4.inc that'll solve your problem.


FUDforum Core Developer
Re: Add Custom CSS Styles? [message #1396 is a reply to message #1389] Thu, 11 April 2002 17:31 Go to previous messageGo to next message
snafu is currently offline  snafu   United States
Messages: 27
Registered: April 2002
Karma: 0
Junior Member
add to buddy list
ignore all messages by this user
I tried this out, and it worked for 1 out of 4 of my new styles. I created the following styles in header_1.inc and header_4.inc:

th { /* label here */
foo:bar;
}
th a:link { /* label here */
foo:bar;
}
th a:visited { /* label here */
foo:bar;
}
th a:hover { /* label here */
foo:bar;
}

THe first one worked. The other three were saved through subsequent uses of the style manager, but the actual style rules were erased, leaving an empty selector:

th a:link { /* label here */

}

I tried rearranging their order, but these same three would be erased every time. I also checked their syntax and made sure all beginning and ending brackets were correct, etc, but I continued to get the same behavior.

My theory is that these styles are being emptied out because their selectors are contextual (i.e. multiple elements separated by spaces) and the php code that parses the styles must be tripping over the spaces in the contextual selectors. Also, none of the style selectors in the file are contextual except for these three.
Re: Add Custom CSS Styles? [message #1397 is a reply to message #1396] Thu, 11 April 2002 17:49 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
remove from buddy list
ignore all messages by this user
snafu wrote on Thu, 11 April 2002 5:31 PM

I tried this out, and it worked for 1 out of 4 of my new styles. I created the following styles in header_1.inc and header_4.inc:

th { /* label here */
foo:bar;
}
th a:link { /* label here */
foo:bar;
}
th a:visited { /* label here */
foo:bar;
}
th a:hover { /* label here */
foo:bar;
}

THe first one worked. The other three were saved through subsequent uses of the style manager, but the actual style rules were erased, leaving an empty selector:

th a:link { /* label here */

}

I tried rearranging their order, but these same three would be erased every time. I also checked their syntax and made sure all beginning and ending brackets were correct, etc, but I continued to get the same behavior.

My theory is that these styles are being emptied out because their selectors are contextual (i.e. multiple elements separated by spaces) and the php code that parses the styles must be tripping over the spaces in the contextual selectors. Also, none of the style selectors in the file are contextual except for these three.


I believe the space in the class name is causing the style parser a problem. I'll check the code and let you know.


FUDforum Core Developer
Re: Add Custom CSS Styles? [message #1454 is a reply to message #1397] Mon, 15 April 2002 14:52 Go to previous messageGo to next message
snafu is currently offline  snafu   United States
Messages: 27
Registered: April 2002
Karma: 0
Junior Member
add to buddy list
ignore all messages by this user
The problem occurs between the form being submitted and the data being written to disk. I was able to verify this because after I manually edit the header_*.inc files, the data appears correctly in the admin tool, and the styles appear in the fud pages, but when I submit the form, it vanishes from both the admintool and the pages.
Re: Add Custom CSS Styles? [message #1459 is a reply to message #1454] Mon, 15 April 2002 16:26 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
remove from buddy list
ignore all messages by this user
snafu wrote on Mon, 15 April 2002 2:52 PM

The problem occurs between the form being submitted and the data being written to disk. I was able to verify this because after I manually edit the header_*.inc files, the data appears correctly in the admin tool, and the styles appear in the fud pages, but when I submit the form, it vanishes from both the admintool and the pages.



Okie I'll take a look @the problem and see if I can replicate it & solve it.


FUDforum Core Developer
Re: Add Custom CSS Styles? [message #1462 is a reply to message #1459] Mon, 15 April 2002 20:14 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
remove from buddy list
ignore all messages by this user
I cannot replicate the bug you've reported.

I've added a test style to header_1.inc & header_2.inc and while it was in header_1.inc I could edit the style without a problem.

The style dissapeared ONLY after I removed it from header_1.inc and then update header_2.inc


FUDforum Core Developer
Re: Add Custom CSS Styles? [message #1484 is a reply to message #1462] Tue, 16 April 2002 16:22 Go to previous messageGo to next message
snafu is currently offline  snafu   United States
Messages: 27
Registered: April 2002
Karma: 0
Junior Member
add to buddy list
ignore all messages by this user
Here are the steps to reproduce the bug, assuming that you have created a layout called header_2.inc and set it as default layout:

  1. Edit both header_1.inc and header_2.inc in a text editor, adding the following styles:
    th { /* Table Header */
    text-align: left;
    background-color: black;
    color: white;
    }
    th a:link { /* Table Header Link */
    color: white;
    }

    It is important that one of the selectors be a contextual selector, containing a space (th a:link). Save the changes.
  2. Go to the forums and verify that these styles are included in the page. (May have to view source)
  3. Open header 2 in the style admin tool and confirm that these styles are displayed properly, with the comment appearing as the form field label and the style rules appearing in the form field.
  4. Press the 'update' button in the style admin tool, thus submitting the form without making any changes.
  5. Go to the forums and verify that the new styles are altered in the following way:
    th { /* Table Header */
    text-align: left;
    background-color: black;
    color: white;
    }
    th a:link { /* Table Header Link */

    }

    (may have to view source)
  6. Open header 2 in the style admin tool and confirm that these changes are visible, i.e. the Table Header Link field is now blank.
  7. Optionally, open header_1.inc and header_2.inc in the text editor and confirm that header 1 was not changed whereas header 2 was changed.


I've replicated the bug numerous times, and it only affects contextual selectors. Also, feel free to move this thread to the "Bug Reports" forum.
Re: Add Custom CSS Styles? [message #1485 is a reply to message #1484] Tue, 16 April 2002 16:58 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
remove from buddy list
ignore all messages by this user
I know the reason for this problem *finally* Smile

The space in the style name causes the problem for the style editor. If you change the style name so that it doesn't have a space it'll work fine.

I will make a modification to the style editor tonight to fix this issue...


FUDforum Core Developer
Re: Add Custom CSS Styles? [message #1762 is a reply to message #1384] Mon, 22 April 2002 15:00 Go to previous message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
remove from buddy list
ignore all messages by this user
This bug has been fixed in latest CVS.

FUDforum Core Developer
Quick Reply
Formatting Tools:   
  Switch to threaded view of this topic Create a new topic
Previous Topic: Level Manager Error
Next Topic: Problem in return to parent
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Tue May 28 06:42:11 EDT 2024

Total time taken to generate the page: 0.04104 seconds