share your email address, but hide it from spammers

Type the following code in your “contact” page or wherever you want your contact information to appear on your website:

htmlcodeforjavaemailaddress

Copy the code below, paste it in a text file and edit the content in red:
(You can use any text editor, like the Notepad app in Windows.)

<!– Begin

// NOTE: If you use a ‘ add a slash before it like this \’
// NOTE: to turn any code into a comment, type two forward slashes //
in front of the line of code
// NOTE: I left the css code in, but you would need to create it in your own style sheet

document.write(‘<span class=”phonetitle”><nobr>’);

document.write(‘Your Name Here‘);

document.write(‘</nobr></span><br>’);

document.write(‘10901 Your Street<br>’);

document.write(‘City, ST 12345<br>’);

document.write(‘PHONE: <span class=”phonetitle”>(555) 555-5555<BR></span>’);

//document.write(‘<br>’);

document.write(‘EMAIL: <A HREF=”mailto:yourown@emailaddress.com” class=”link”>yourown@emailaddress.com</a><br>’);

//  End –>

Name the text file “phone.js” and save it in the same folder as the file containing the first code.

Now, your email isn’t underlying text that’s easily found by scammers and spammers, it’s buried in code. The downside is that anyone who’s not running javascript can’t see your content – rare, but possible.

Caveat: If your website is hosted on WordPress.com, they don’t allow javascript, so this code won’t work for your site.

(code snippet credit allwebcodesign.com)

html: prevent line break after text link

preventlinebreakafterlinkwith_inlineThe problem:
Creating a text link seemingly inserts a line break and causes the text following the link to wrap to the next line. Notice the second paragraph is not a link – and it doesn’t wrap.

This is what the original code looks like:
preventlinebreakafterlinkwith_inline_codebefore

To prevent the text from wrapping/inserting a line break, add an inline property to your anchor tag.

Here’s what the inline property looks like:
preventlinebreakafterlinkwith_inline_codeafter

preventlinebreakafterlinkwith_inline_finalAnd here’s the result:
I know the font size of the link is slightly larger than the paragraph text. I’ll be fixing that next.

html lists: indent spacing and change bullet styles

Working on my website recently and created a multi-level unordered list. The spacing of the second level indent was much more than I needed and I wasn’t loving the fact that the bullets were the same for both levels.

I found code to solve both those problems, so as usual, I’m posting it here for my future reference and, hopefully, to help someone else looking to solve the same problems.

I changed the second level bullet style to square and reduced the second level indent to 15px. Here’s a screen shot of my final list, followed by the code snippets I used:

Continue reading “html lists: indent spacing and change bullet styles”

WordPerfect SWITCH and CASEOF

In generating a WordPerfect merge document, one of my clients wanted to type an acronym for a plaintiff ONE time and have the merge process insert many different things in the document, based on that one, shortened client reference.

Let’s look at how to do that. The code looks like this:

(click to zoom any image)

Step 1. In the process of setting up the WP merge, a data field was created for the plaintiff, named “Plaintiff Short.”

This particular merge form was only used for three clients, so the example is limited to three. Keep in mind, you can have more or less.

Here’s the code as it appeared in the WP merge form document:

CODES(
SWITCH(FIELD(Plaintiff Short))
CASEOF(BIGBANK1)
INSERT(The Big Bank of Central Southeast, a Florida corporation)
CASEOF(BIGBANK2)
INSERT(Small Town Bank, a Florida corporation)
CASEOF(CREDITUNION)
INSERT(The Friendly Local Credit Union, a State Chartered Credit Union)
DEFAULT
KEYBOARD(Please the Name of the Bank and Click “Continue”)
ENDSWITCH
)

Note: You can’t just type this code. Here’s how to insert the code into your form document.

Step 2. Open the merge form. In the Merge subtoolbar, click the “Insert Merge Code” button and select “More . . . ” The following dialog box appears:

The first code I insert is “CODES(merge codes)” which ignores hard returns and spaces between its parenthesis. With my cursor between the parenthesis of the CODES() merge code, I press enter to insert a hard return and place my cursor on the following line, so it looks like this (the cursor is shown in red):

CODES(
|)

Step 3. Leaving the “Insert Merge Codes” dialog box open and find the “SWITCH(exp)” merge code in the list click Insert. Another dialog box, entitled “Insert Merge Code” is displayed. I don’t enter anything and click “OK”

The code should now look like this (:

CODES(SWITCH(|))

Leave the Merge Code dialog box displayed if it doesn’t bother you, close it if it does. (I closed it so as not to confuse anyone.) Next click the “Insert Field” button on the Merge subtoolbar and select the field you need. In this case, I selected the “Plaintiff Short” field and clicked insert.

Step 4. Close the “Insert Field” dialog box. If you closed the “Insert Merge Code” dialog box, open it again by Placing the cursor on the next (empty) line, click the “Insert Merge Code” button and select “More . . . ”

Step 5. Insert the “CASEOF” code. With the cursor between the parenthesis of the CASEOF code, type the text which might be entered into the “Plaintiff Short” data field during a merge:

In this case, the text “BIGBANK1” is entered.

Step 6. Repeat step 5 as many times as needed, changing the text to be entered in each possible scenario. (In my example code above, I added an option for text entry to allow for the possibility of a new client.)

Step 7. Finish by inserting the “ENDSWITCH” merge code. The end parenthesis for the CODE command still appears and it completes the code snippet!

Step 8. One simple way to use the result of that snippet is to insert the “Plaintiff Short” field into the document everywhere the Plaintiff’s acronym should appear, but there are lots of other possibilities!


Want to learn more? Visit www.pragmaticcom.com and schedule a training session!

%d bloggers like this: