CiTi · Computer Coding · Year One · Unit 3

Introduction to WebDNA: Date, Time & Reusable Includes

Student Handout

WebDNA Basics

Square brackets mean WebDNA. HTML tags use angle brackets, like <p>. WebDNA tags use square brackets, like [date]. When you see square brackets in your code, the server runs that part.

WebDNA only works on the server. Always test through your live URL (http://dev.citicoders.org/...). If you open the file from your desktop or preview it from Sublime, no server runs it, and your tags show up as plain text like [date].

Format Lab

Predict what each tag will show. Then put it on your page, upload, and write what it really showed.

TagI predictIt showed
[date format=%B %d, %Y]
[date format=%a %m/%d]
[time format=%I:%M %p]
[date format=%A, day %j of %Y]

Codes: %A Monday · %a Mon · %B September · %b Sep · %m month 01–12 · %d day 01–31 · %Y 2026 · %y 26 · %j day of year · %I hour 01–12 · %H hour 00–23 · %M minute · %S second · %p AM/PM. Case matters!

My Footer

Your footer needs a copyright year that updates itself, plus one date/time line using at least three format codes.

The code I wrote (copy it from Sublime) What it displayed on my live page

Day 2 Warm-Up

To add one link to my nav right now, how many files would I have to open and edit? What could go wrong with keeping that many copies of the same code?

My Include Plan

mysite/ includes/ header.inc nav.inc footer.inc css/ images/ index.html about/index.html (and your other pages)
My full site path (starts every link, image, CSS, and include path). Example: /citi/coding/2027/1/YOURINTS/mysite/ My include line for the nav (the same on every page) Why does every link, image, and CSS path inside an include need the full site path?

Checklist: homepage fully working before other pages · each page file holds only the three include lines and the bodycopy · every link, image, CSS, and include path uses the full site path · every page has its styling and images · tested every link from every page on the live site.

Break It On Purpose

Make one change at a time. Predict first, test on the live page, then undo it before the next one.

1. Misspell the tag in your footer as [dat]

I predict
What happened
Why

2. In your time format, change %M to %m

I predict
What happened
Why

3. On about/index.html, change the nav include to the short path [include file=includes/nav.inc]

I predict
What happened
Why

4. In header.inc, shorten the CSS link to href="css/style.css". Load the homepage, then the About page.

I predict
What happened
Why

Client Change Request

The change my teacher requested
Files I would have edited before includes
Files I actually edited

Success Criteria Check-In

Check each one when you feel confident you can do it.

Exit Ticket

Why does View Source on my page show the date but not the [date] tag? Name one change to my site that now takes one edit instead of five

My Notes

Use this space for anything: questions, reminders, code you want to keep.