November 18, 2004

Smilies Improved? Maybe!

Hello Munuvians!

I have a better way to do the smilies on our sites. Here goes:

1. Open up your Edit Templates and go all the way down to:

Create new template module

Click that, of course, and then copy and paste this into the Module Body. Just right-click in the box and select all:

(I decided ascii was too much to learn real quick like :-) )

2. Still with me? Good! In the box at the main top called Template Name type in:

macros

or whatever you want to call it. Make sure if you name it something different to change it in the tag near the end of this!

save and DO NOT REBUILD!

Yet.

3. Now we need to go into each template you want the smilies to appear and add some code to each one.

I'd add the coding to these:

Main Index
Individual Entries
Comment Listing
Comment Preview

and you'll add this to each template:

A. At the top right before the tag </head> add this to it:

<MTInclude module="macros">

Hint: If you named the template way above something else, change macros in this tag to that something else you wrote ;-)

OK! Moving on. Wrap the part of code you want your smilies to appear in like this:
<MTMacroApply> </MTMacroApply>

I wrapped the entire part of the body in it, but I may find this to be wrong later. No problems thus far, however. Do this for each template you want smilies to appear, and then REBUILD! Smile, you have smilies!

Advantages for doing this instead of just doing what Pixy mentioned earlier comes down to ease of adding new smilies, or editing and changing the ones already listed. The cool thing about macros is that whatever you want to add is easy to do.

Let's say you want to make a Darth Vader smiley? Here's all I changed:

Posted by Nick Queen at November 18, 2004 04:51 PM
Comments
#1

Well, I'm at a loss how Pixy made his code below without the smilies showing up throughout...

That's why he is the master, and I'm still a snot nosed student...

Posted by Nick Queen at November 18, 2004 04:57 PM
#2

Nick: The smilies are enabled on this site so the code for the smilies will actually display the smilies... you would need to use ascii code to display the symbols for the smilies and not the actual smilies....

Posted by Madfish Willie at November 19, 2004 01:27 AM
#3

I will admit that I am at a loss on ascii code. Will try to learn it.

Posted by Nick Queen at November 19, 2004 03:18 AM
#4

Yeah, it was a real pain doing that. I quite like your solution though.

And using a template module is definitely the way to go.

Posted by Pixy Misa at November 19, 2004 05:36 AM
#5

ASCII Reference

Posted by Madfish Willie at November 19, 2004 06:38 PM
#6

Nick: FYI - just replace the lead character with the ascii equivalent and the smilies won't display... hope that helps.

Posted by Madfish Willie at November 19, 2004 06:39 PM
#7

Hadn't thought of that. I like this format for code though. Right click and select all rocks.

Posted by Nick Queen at November 19, 2004 09:02 PM
#8

Okay,

I am doing something wrong but don't know what. I tried to wrap the apply around the main entries (wrapping it around the body gave me a line of smilies and html code on the borders.) Any suggestions? I really am at a loss here. Also, what should the output field say?

Posted by Rachel Ann at November 24, 2004 10:56 AM
Live Comment Preview
Post a comment









Remember personal info?