HTML.pdf

(358 KB) Pobierz
Introducing HTML
Further Development
1
Introducing HTML
While WebPlus is an extremely versatile and feature-rich
publishing tool, there are features and functions, that may
require you to add some HTML code of your own.
For example, you can add HTML code to achieve functionality
that WebPlus does not natively support, or elements—like the
sample hit counter we'll demonstrate here—that involve some
personalization for your site or your needs.
In this tutorial we’ll show you how you can use HTML code
fragments to enhance and customize your website. Y ou’ll learn
how to:
Insert HTML code fragments.
Add a simple hit counter script to your website.
The WebPlus S mart Objects include hit counters, active viewers,
blogs, shout boxes, polls, and more, which you can quickly and easily insert
on your site. Just sign up with Serif Web Resources and you’re on your
way—no code necessary!
For more information, see the online Help. For step-by-step instructions,
see the Dynamic Objects tutorial.
690945687.008.png
 
2
Further Development
Introducing HTML
Introducing HTML
1 From the WebPlus Startup Wizard, select Create > Use Design
Template .
2 Select any website template and click Open .
3 Browse to your Workspace folder. In a default installation, you’ll find
this in the following location:
C:\Program Files\Serif\WebPlus\X4\Tutorials
4 Double-click on the Sample counter code.txt file to open it. It may
open in Notepad or another text editor.
Select all of the text (try pressing Ctrl+A on your keyboard) and copy
it to your Clipboard by pressing Ctrl+C . Close the text editor
program and return to WebPlus.
5 On the Web Objects toolbar, click Insert HTML Code , then
click on the page or pasteboard area to create a new HTML Code
Fragment window at
default size (or drag to
adjust the dimensions of
the window).
6 In the Insert HTML
Code dialog, click the
Paste to Body button.
WebPlus
inserts the
Clipboard text
into the body
of the file.
7 Click OK to
close the
dialog.
When the Ignore page position (raw
HTML) check box is cleared, WebPlus tries to
incorporate your HTML code fragment in the
correct location (where you place it on your
page) when your site is published.
690945687.009.png 690945687.010.png
Further Development
3
Introducing HTML
8 On the page, the code
fragment is displayed in the
HTML Code Fragment
window.
9 To see your new hit
counter as it will be
displayed to your site
visitors, click the
Preview Site button and choose to
Preview in Window , or Preview Site in
{your browser of
choice}.
If you are connected to
the Internet while you are
previewing this sample
site, the counter code will
connect to a server and
update the hit count, then
feed this number back to
your site as a small image.
In our example, the HTML code is pasted in the HTML Body section.
Depending on the type of HTML object you're planning to include, you
may need to paste code into the Head, Body, or both sections. It's usually
not difficult to figure out what to put where.
The HTML code itself will include <HEAD></HEAD> and/or
<BODY></BODY> tag pairs that demarcate these blocks.
If some of the code is required to be pasted into the HTML Head section,
it will often be noted as a ‘comment’ in the code.
In HTML, comments are enclosed inside <!-- --> characters. Comments
are essentially ignored by the Web browser and are there to provide
memory aids, information or instructions to the person viewing or writing
the code. Comments are often great ways of including things like the Web
designers name and copyright information.
To view the source code on any Web page, right-click the page and
choose view source from the menu.
We had to sign up for an account, which
was free in this case, so that the Web Counter
service provider could uniquely identify hits to
our site. Each time the code is viewed in a
browser, the Web Counter service provider's
HTML and JavaScript code increments the
count—so by completing this tutorial you will
raise our sample site's count (if you are online)!
690945687.001.png 690945687.002.png 690945687.003.png 690945687.004.png 690945687.005.png 690945687.006.png
4
Further Development
Introducing HTML
We've just shown you how to add a hit
counter as an object, but to get one that
actually registers hits on a real Web page,
you'll need to sign up with a service.
The text file we opened
contains HTML and JavaScript
(another flavour of Web-
language) code obtained from a
Web Counter service.
More information
A hit counter is just one example of HTML or JavaScript code that can
enhance your website. However, there is a lot more that you can do. Take
a look at sites like
HTML Goodies (www.htmlgoodies.com)
JavaScript City (www.javascriptcity.com)
HotScripts.com (www.hotscripts.com)
for code-oriented tutorials, script ideas, and sample code that you can
consider for your sites! (Please note that Serif is not responsible for
content found on external sites.)
690945687.007.png
Zgłoś jeśli naruszono regulamin