Other posts that might interest you
Favorites
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 Comments are now closed. You may write a note just as you would a comment and I'll see it. It just won't be posted to the blog for others to read. Advertisements 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).
4 Comments
Write a note
Customizing Big Cartel
Even Christians Have Abortions
Chocolate Pancakes Recipe
Override Inline Styles from the Stylesheet
Tortilla Chips
DIY Fabric Tape + Stickers
Paint Old Baking Pans for Storage
Easter Fudge
Book Cover Tutorial
Vintage Popcorn Boxes





Very nice. I wonder if it works with the backend template I already have installed (I can’t remember the name of it, but it changes the ugly tabs and reworks the admin area so its nicer to look at).
Good idea to give more space to the writing area.
Nice tip! I’ve been doing a lot of modification lately to
taghandlers.phpto add some smarter image attributes, and convert the output to HTML. I think I’ll add this to my to do list!If I remember correctly, Mary just finished removing all the inline styles. Can’t wait “˜til the next version! Definitely give the Admin Facelift a shot too. TXP is so much nicer with those styles :).
Natalie, you have smacked me upside the brain. I can’t believe I’ve never even considered this!
I use Movable Type instead of Textpattern, but MT suffers from the same problem of applying its own styles to post previews.
Once I looked at it, I realized it was a five-minute mod, which I’ve posted on my site.
Thanks!
Love your site! I found your site via the Persecution Carnival, came to check out your post for that reaason and have been here for a while. I will be back!
God Bless You and Yours,With Love In Christ,Cindy