Quickies

Some small issues that I have fixed or that I have run into that others have fixed. I will provide references and a brief problem/solution to these issues, if needed.


Make Your Life Easier With A Simple Function For $form_state In Drupal 8

Found this cool function for the $form_state class for Drupal 8.

I always found objects difficult to work with in Drupal 8. I just never seem to find the proper documentation to get to what I want to do. That’s one of the bad things about D8. Not enough documentation.

Anyway, I find associative arrays much cleaner to work with. They’re easier to manipulate, they’re faster, they don’t have a bunch of shit that you need methods for.

For $form_state to convert it into an associative array, use this:

$form_state->getUserInput()

Pretty cool. I need this in my arsenal.


Issue With Scrolling In SharePoint 2010

I had an issue with scrolling in SharePoint 2010. It worked fine in all browsers except IE7. I basically started from the drawing board on my scrolling CSS hacks (to get it to work). Instead I followed the advice given on this blog: Kyle Schaeffer – SharePoint 2010 Scrolling. It works great! Thanks!

At some point I will go back and break some of these into another page of threads/blogs I found to solve my issues…


WordPress Visual Kitchen Sink (WISIWYG Editor) Not Showing Up

PROBLEM
The editor in WordPress isn’t showing up in visual on pages and posts.

SOLUTION
Add the following line of code to your wp-config.php file located on the root of WP:

define(‘CONCATENATE_SCRIPTS’, false );


Gap In LIs In IE

PROBLEM
When creating a list with borders (used with menus), there is a tiny 1px gap between each list item in Internet Explorer.

SOLUTION
Add some IE safe code to the top of the file:

<!–[if lt IE 8]>
<style type=”text/css”>
li a { display:inline-block; }
li a { display:block; }
</style>
<![endif]–>

Granted, this isn’t a great solution, but I’m using it just to save time. I really hate doing IE tricks like this.

Thanks to 456 BEREA St (Closing The Gap Between List Items In IE) for this.


IE7 Legend Text Not Wrapping

PROBLEM
Long text in a legend tag isn’t wrapping in IE7. All other browsers are fine.

SOLUTION
Put a <span> inside the <legend>. Then put this into the CSS:

legend {
white-space: normal;
width: 100%;
*margin-left: -7px;
}
legend span {
display:block;
width: 100%;
}

Yes, this fix does use an IE hack but that’s because IE7 puts a margin you can’t get rid of on legends.

This issue was found on Stack Overflow.


IE7 Long URLs Not Wrapping In Tables

PROBLEM
In IE, long URLs are not wrapping in tables. The word-wrap property fixes the issue but the table is still as long as it was with the URL long.

SOLUTION
Modify the CSS for the table:

table.google_results {
word-wrap: break-word;
table-layout: fixed;
}

This CSS added to the table will make the table render like it does natively in FireFox.

Thanks again to 456 Berea St (How To Prevent HTML Tables From Becoming Too Wide). I should subscribe to their blog!

Leave a Reply

Your email address will not be published. Required fields are marked *