Oct 12, 2006


As i have said and will say again, if you write to ask me something, i will deliver you answers, no matter how easy or hard the question is.
This time around was about posting Code into a Blog Post:



Avatar, i have seen in your blog and in others that somehow you can write code on post, how i do that?



"Somehow?"


heh, there are lots of ways to do it, but the cleanest, easy and the prettiests are this ones:

1.-Inline Replacing Marks

This way you only need to write this to replace the code openers and closer tags:



To get this:

<a href="http://bloggeratto.blogspot.com">Bloggeratto</a>

That in your post Html Editor must look like this:



2.-Inline Text Fields

In this case you need to put a code to be able to show the code you want to post.

To do this, you need to put a text area form field each time you want to post a some code and then place it inside.

The code for a Textarea form field is this:


<br /><center><form><textarea rows="3" cols="50" readonly>Code you want to post</textarea></form></center><br />

To get this:





See?, very easy to do. now, i use the first method, and others like Hans use the second method.

So, it is only a matter of taste.

Well, i hope this have been some help to someone.and once again, i am just a message away, and now you can also find me at Bloggeratto Bordee Pageboard where you can leave me messages publicly or in private mode.



5 comments:

Avatar X said...

Jason:

A little mistep uh?, oh well glad you got here in a second try.

and yeah, it is has to be worked, but it look great.. i wish someone would make a online form so any code you posted would then get all ther >< replaced automaticlly so, it would be a breeze to use..

pat said...

some post has box with scroll bar to minimize space.. i wish i know how to do that can you teach me? tnx.. send me a reply 2posporo2@gmai.com
more power

WallsZONE said...

I used the first one work great for me but the second dont work it add me automaticaly "br" in every line.

Anonymous said...

I was wonder how to do something and am hoping you might be able to help explain it. I want to be able to post a repost code box like in the number 2 Inline Text field however, I want to be able to put the code box inside also. What I am wanting to do is have it so when someone goes to repost the code they also can repost the box with the code inside. Is there a way for me to be able to do this?
Thanks for all the awesome information has saved me bunches of time when giving out codes.

Avatar X said...

@Anonymous

well, there is a manual way to do that:

1.-use method 2 normally to have your code in a text area from field.
2.-Below the t.a.f.f in a different line you can put the embed code for it by using the inline replacing marks for the code of the t.a.f.f as shown in method 1 + the code you need using the same method. That way you can offer both the code and the code+ the t.a.f.f at the same as if it was an embed code.
3.-In order to not have to repost the inline replacing marks verse for the t.a.f.f, you can simply add it to your post template that is in your formating sub-tab in your blog settings tab.

Hope this helps

Post a Comment

Welcome To Bloggeratto. In here you can post any kind of comment you want. Seriously, Go ahead.

Lijit Ad Wijit

Categories

Blog Archive

Followers

Powered By Blogger
Web Statistics