Now that my layout is wider, I realized I need much more space in my admin write area too. I also had a problem with the preview tab because the preview was dependent upon Textpattern’s stylesheet instead of mine on the front end. So, here’s how I fixed both of those problems.

Preview Style

For the preview style it was relatively easy. I took some of my styles for my posts, the blockquote, headings, etc. and copied the code into the textpattern stylesheet. I put my styles at the bottom with a comment to remind me that they’re my styles.

Textpattern Stylesheet /textpattern/textpattern.css

Wide Write

To make my writing space wider it was a little more difficult than putting a style into the stylesheet because the admin area is littered with inline styles, overwriting anything I were to do with the stylesheet. So, I had to find the inline style in the document and change that.

The write admin file /textpattern/include/txp_article.php

Open that file and find the following code…


    if ($view=="preview") {
            if ($textile_body == USE_TEXTILE) {
                echo $textile->TextileThis($Body);
            } else if ($textile_body == CONVERT_LINEBREAKS) {
                echo nl2br($Body);
            } else if ($textile_body == LEAVE_TEXT_UNTOUCHED) {
                echo $Body;
            }
        } elseif($view=="html") {
            if ($textile_body == USE_TEXTILE) {
                $bod = $textile->TextileThis($Body);
            } else if ($textile_body == CONVERT_LINEBREAKS) {
                $bod = nl2br($Body);
            } else if ($textile_body == LEAVE_TEXT_UNTOUCHED) {
                $bod = $Body;
            }
            echo tag(str_replace(array(n,t),
                    array(br,sp.sp.sp.sp),htmlspecialchars($bod)),'code');
        } else {
            echo '<textarea>width:400px;height:420px" rows="1" cols="1" name="Body" tabindex="2" >', htmlspecialchars($Body),'</textarea>';
        }

The code in blue is what you want to change to widen your text area.

+UPDATE: Allowing for a table style…+

This was something I couldn’t do last night but figured out this morning. I was trying to put in a div to separate the preview section from the rest of the area so that my styles would not effect the rest of the admin area – just the preview area.

Open /textpattern/include/txp_article.php again and find the above code again. This time, look for these two small sections of code…

<td valign="top" style="width:500px"><div id="article">';

....

echo hInput('from_view',$view),
'</div><!-- /#article --></td>';
echo '<td valign="top" align="left" width="20">';

I put a div called “article” inside the tags. Then I went back to my stylesheet to add #article to my declarations. Now I can preview tables without effecting the entire admin area (which is built with tables).