Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

HTML Forum


You are currently viewing our HTML Forum as a guest. Please register to participate.
Login



Post a Project »

Find a Professional HTML Freelancer!

Find a Freelancer to help you with your HTML projects

FREE Outsourcing eBook!

Reply
Loading a chunk of HTML as an object from a master file?
Old 12-12-2007, 09:11 AM Loading a chunk of HTML as an object from a master file?
Novice Talker

Posts: 8
Name: Steven
Trades: 0
It is possible to clump together a chunk of HTML, stick it in a ‘master file’ and call it up on my webpage instead of having to rewrite the HTML for that object every time it appears on the page?
Maxamillious is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 12-12-2007, 09:42 AM Re: Loading a chunk of HTML as an object from a master file?
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,380
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
http://www.candsdesign.co.uk/articles/coding/includes/

Server Side Includes
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 12-12-2007, 10:44 AM Re: Loading a chunk of HTML as an object from a master file?
wayfarer07's Avatar
Poo on You

Latest Blog Post:
Introducing WowWindow
Posts: 3,987
Name: Abel Mohler
Location: Asheville, North Carolina USA
Trades: 0
I use php. The format is:
PHP Code:
<?php include 'wherever/whatever.inc'?>
The included file should not have a header, title or anything like that, unless it is needed(for example including a common header). It can be HTML, Javascript, or more php code.
__________________
I build web things. I work for the startup
Please login or register to view this content. Registration is FREE
.
wayfarer07 is offline
Reply With Quote
View Public Profile Visit wayfarer07's homepage!
 
Old 12-12-2007, 11:02 AM Re: Loading a chunk of HTML as an object from a master file?
Novice Talker

Posts: 8
Name: Steven
Trades: 0
Oh wow, thank you very much! This makes my life much easier now.

Now, in the instance I’m using SSI for a button (or anything else really), how would I apply different text to the button each time it’s called up?
Maxamillious is offline
Reply With Quote
View Public Profile
 
Old 12-12-2007, 02:25 PM Re: Loading a chunk of HTML as an object from a master file?
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,380
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
For something like that I would use a function
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 12-19-2007, 06:26 PM Re: Loading a chunk of HTML as an object from a master file?
Novice Talker

Posts: 8
Name: Steven
Trades: 0
I’m not really understanding what you mean by use a function with SSI. I’ve done some browsing around and none of the tutorials and guides that I’ve read have made any reference of functions in relation to SSI.

Could you please explain?
Maxamillious is offline
Reply With Quote
View Public Profile
 
Old 12-19-2007, 07:50 PM Re: Loading a chunk of HTML as an object from a master file?
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,380
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
You don't actually make a function in SSI. You include a file that has the code to write out the required HTML.

eg:
To write a button that changed (as buttons do) captions etc:

Code:
<%
sub writeButton( sType, sName, sID, sValue)
dim quotes
quotes = chr(34)

with response
	.write "<input "
	.write "type="
	.write quotes
	.write sType
	.write quotes
if sID <> "" then
	.write " id="
	.write quotes
	.write sID
	.write quotes
end if
if sName <> "" then
	.write " name="
	.write quotes
	.write sName
	.write quotes
end if
if sValue <> "" then
	.write " value="
	.write quotes
	.write sValue
	.write quotes
end if
	.write ">"
	.write vbcrlf
end with
end sub
%>
And to use it you pass the required parameters
Code:
<%writeButton "submit", "go", "go_btn", "Go Here"%>
that example would write on to the page;
HTML Code:
<input type="submit" id="go_btn" name="go" value="Go Here">
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Reply     « Reply to Loading a chunk of HTML as an object from a master file?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.83798 seconds with 12 queries