educational

Why I Did It: Working With Walnuts, Part 1

In this newest installment of my ongoing "Why I Did It" series, I'm going to redefine the acronym "WWW" from being short-hand for "World Wide Web" to "Working With Walnuts" ~ So what the heck am I talking about now? For some of you, it just might be the coolest thing you've read in a long time...

"The coolest thing you've read in a long time:" A bold statement indeed, and perhaps more appropriately it should be "the most helpful thing you've read in a long time:" for if you've never used them while building your sites before, I'm about to make your life a whole lot easier by exposing you to the wonderful world of HTML "includes."

As I typically do when delving into "technical" issues, I will toss this disclaimer out up-front: I am not a programmer, and often my approach is more akin to wielding a sledge-hammer than to the surgical coding precision of a "Root God" like my pal C-Dawg — and everything I discuss here should not be viewed as the "best" or most technically accurate information available. It is rather the proven techniques that I have used and developed through trial and error, cut n' paste, and several drunken rages over bits of code that have eluded me over the years. These things work on my virtually-hosted domains; use them at your own risk.

"Includes" for Fun and Profit
With that out of the way, let me enlighten those who are unfamiliar with them: "Includes" are just that; snippets of code that are "included" on (usually) multiple HTML pages for a wide variety of reasons and uses.

Why? Consider a site with *many* pages. Now say you want to update the credits and copyright info, or the navigation bar, or the background image and text colors. You could go and manually edit all of those pages, and perhaps need to do so all over again in the future. But wouldn't it be cool if you could assign the values in question to a simple text file, and then by editing that file, cause global changes to your site? Well, that's what includes can do for you!

I've used includes to provide common "headers" and "footers" on my pages. I've used them to replace the BODY tag, and I've used them to insert JavaScript into the HEAD tag. I almost always use them to insert navigational components that may be subject to change into my sites. While some alternative "work-arounds" such as using framesets for your site's navigation and Cascading Style Sheets (CSS) for BODY tag formatting are possible (and often desirable), the use of includes is often preferable. Let's take a closer look:

MS FrontPage "Include Bot"
My first exposure to using includes came from Microsoft FrontPage; a ubiquitous but quite controversial tool that I've used since version one was issued on diskette back in '94 or so. For those who are laughing, prior to my discovery of this gem from Heaven, I was writing HTML using "DosEdit" — and so FrontPage was a MAJOR improvement for me.

Anyways, at the time I had built my first network of AVS sites and was incorporating them into the first evolution of PORNWORKS. With roughly 500 pages, updating this pig was a seriously mind-numbing chore. A chore made much simpler by the FrontPage Include Bot. For those who've never used FrontPage, part of its power stems from a set of tools known as FrontPage Server Extensions that your Web Host installs on your server. These tools (known as "bots") contained an "include" bot, the value of which was dramatically shown to me when a major sponsor who provided most of the free content I used on my sites decided to change their linking URL syntax. I breathed a big sigh of relief — and thanked God that I was blessed with such powerful tools:

Because the sponsor's terms of use for their free image content dictated a link saying "Photos Courtesy of ____" underneath each image, and since each full-size pic was on a separate HTML page, I had my work cut out for me — or would have, if I hadn't used the following tag to place the sponsor's link across these several hundred pages that required it:

!--WEBBOT bot="Include" u-include="../_private/footer.htm" tag="BODY" startspan--

Now, all that I had to do was edit my footer.htm file, and voila! All of the pages were instantly updated with the sponsor's new linking code! I breathed a big sigh of relief — and thanked God that I was blessed with such powerful tools:

But what about those who do not use FrontPage? How can they use includes to perform these maintenance tasks and so much more? While other options may be available, two that I have (and do) use are PHP and Server Side Includes (SSI), both of which I'll discuss next in Part 2 ~ along with the "Walnut" revelation. Stay tuned! ~ Stephen

Copyright © 2024 Adnet Media. All Rights Reserved. XBIZ is a trademark of Adnet Media.
Reproduction in whole or in part in any form or medium without express written permission is prohibited.

More Articles

opinion

The Search for Perfection in Your Payments Page

There has been a lot of talk about changes to cross sales and checkout pages. You have likely noticed that acquirers are now actively pushing back on allowing merchants to offer a negative option, upsell or any cross sales on payment pages.

Cathy Beardsley ·
opinion

Unpacking the Payment Card Industry's Latest Data Security Standard

The Payment Card Industry Data Security Standard (PCI DSS) is a set of requirements and guidelines that apply to all businesses that accept credit card payments, and is designed to ensure the security of those transactions.

Jonathan Corona ·
opinion

Compliance With State Age Verification Laws

During the past year, website operators have faced a slew of new state age verification laws entailing a variety of inconsistent compliance obligations.

Lawrence Walters ·
opinion

Merchants in Spotlight With Visa's VIRP

By now, most merchants know about the Visa Integrity Risk Program (VIRP) rolled out in spring 2023. The program is designed to ensure that acquirers and their designated agents — payment facilitators, independent sales organizations and wallets — maintain proper controls and oversight to prevent illegal transactions from entering the Visa payment system.

Cathy Beardsley ·
opinion

How to Know When Hosting Upgrades Are Really Needed

I was reminded about an annoyingly common experience that often frustrates website owners: upgrades. Sometimes, an upgrade of physical system resources like CPU, RAM or storage really is required to solve a problem or improve performance… but how do you know you’re not just being upsold?

Brad Mitchell ·
profile

WIA Profile: Natasha Inamorata

Natasha Inamorata was just a kid when she first picked up a disposable camera. She quickly became enamored with it and continued to shoot with whatever equipment she could afford. In her teens, she saved enough money to purchase a digital Canon ELPH, began taking portraits of her friends, shot an entire wedding on a point-and-shoot camera and edited the photos with Picnik.

Women in Adult ·
trends

Collab Nation: Top Creators Share Best Practices for Fruitful Co-Shoots

One of the fastest ways for creators to gain new subscribers and buyers, not to mention monetize their existing fan base, is to collaborate with other creators. The extra star power can multiply potential earnings, broaden brand reach and boost a creator’s reputation in the community.

Alejandro Freixes ·
opinion

Bridging Generational Divides in Payment Preferences

While Baby Boomers and Gen Xers tend to be most comfortable with the traditional payment methods to which they are accustomed, like cash and credit cards, the younger cohorts — Millennials and Gen Z — have veered sharply toward digital-first payment solutions.

Jonathan Corona ·
opinion

Legal and Business Safety for Creators at Trade Shows

As I write this, I am preparing to attend XBIZ Miami, which reminds me of attending my first trade show 20 years ago. Since then, I have met thousands of people from all over the world who were doing business — or seeking to do business — in the adult industry.

Corey D. Silverstein ·
opinion

Adding AI to Your Company's Tech Toolbox

Artificial intelligence is all the rage. Not only is AI all over the headlines, it is also top of mind for many company leadership teams, who find themselves asking, “How can this new tool help our company?”

Cathy Beardsley ·
Show More