Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Code Support: ASP (Non-Forum Related)
 Reading <TITLE> For Display Within A Document
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

Kong
Junior Member

100 Posts

Posted - 26 March 2002 :  01:10:32  Show Profile
Is there any way it may be possible for an ASP script to READ the [b]<TITLE></TITLE> tags of a webpage and display it within the pages?

I'm looking to have that coding within a top.asp and have it display whatever the title is for the page which is being viewed.

Similar to this...

You are viewing, About My Website. or something like that

I need coding that can look into...

<html>
<head>
<title>About My Website</title>
</head>

Can anyone help me out?

_________________________
Come on by and visit Deth Incarnate.
Growing slowly, but growing none the less.

Kat
Advanced Member

United Kingdom
3065 Posts

Posted - 26 March 2002 :  05:09:10  Show Profile  Visit Kat's Homepage
Why don't you define your page title in an ASP variable and refer to it in the title and anywhere else in the page that you need to?

e.g.

<%
PageTitle = "This is the page title"
%>

<title><%=PageTitle%></title>
...

in body somewhere
<p>You are viewing <%=PageTitle%></p>



KatsKorner

For Installation help: http://www.aslickpage.com/snitz_help.html
For Snitz Mods: http://ls3k.com/snitz/



Edited by - kat on 26 March 2002 05:09:38
Go to Top of Page

Kong
Junior Member

100 Posts

Posted - 26 March 2002 :  15:17:38  Show Profile
Thanks it works great.

However, I was kinda hoping for something that could read the <title> tags... oh well.

If any one knows how to read the title tags without changing it above let me know.

Thanks for the help Kat, it works great.

_________________________
Come on by and visit Deth Incarnate.
Growing slowly, but growing none the less.
Go to Top of Page

Kat
Advanced Member

United Kingdom
3065 Posts

Posted - 27 March 2002 :  04:30:34  Show Profile  Visit Kat's Homepage
I do not know of a way to read the title tags Kong. Glad my idea helped though, even if it wasn't what you wanted.

KatsKorner

For Installation help: http://www.aslickpage.com/snitz_help.html
For Snitz Mods: http://ls3k.com/snitz/

Go to Top of Page

TerryG
Junior Member

United Kingdom
179 Posts

Posted - 27 March 2002 :  07:12:51  Show Profile
You could do it in javascript if thats any help ie.
<BODY>
You are viewing
<SCRIPT>
document.write (document.title)
</SCRIPT>
</BODY>

I guess you could put that in an ASP file (without the body tags) and <!-- #include --> that file wherever you wanted the title to appear.

Go to Top of Page

Kat
Advanced Member

United Kingdom
3065 Posts

Posted - 27 March 2002 :  07:23:59  Show Profile  Visit Kat's Homepage
Yep TerryG is right. You could do it in JavaScript.

You still can't access the contents of the Title tags that way though. I still haven't found how to do that if you it is possible at all - which I doubt.

KatsKorner

For Installation help: http://www.aslickpage.com/snitz_help.html
For Snitz Mods: http://ls3k.com/snitz/

Go to Top of Page

TerryG
Junior Member

United Kingdom
179 Posts

Posted - 27 March 2002 :  07:36:30  Show Profile
Kat
I am confused (a not unusual occurance) whats the difference between 'document.title' and 'the contents of the title tags'?

Go to Top of Page

Kat
Advanced Member

United Kingdom
3065 Posts

Posted - 27 March 2002 :  07:57:42  Show Profile  Visit Kat's Homepage
I think Kong was looking for a way to grab the contents of the HTML without using script - unless I read it wrong.

Both our solutions involved script.

That was all. It may be me whos gone nuts...

KatsKorner

For Installation help: http://www.aslickpage.com/snitz_help.html
For Snitz Mods: http://ls3k.com/snitz/

Go to Top of Page

TerryG
Junior Member

United Kingdom
179 Posts

Posted - 27 March 2002 :  08:03:09  Show Profile
quote:

I think Kong was looking for a way to grab the contents of the HTML without using script[size=1]KatsKorner




OK, I understand and I can't see how its possible either.

Go to Top of Page

Kat
Advanced Member

United Kingdom
3065 Posts

Posted - 27 March 2002 :  08:14:32  Show Profile  Visit Kat's Homepage
so I am not nuts.. cool.

KatsKorner

For Installation help: http://www.aslickpage.com/snitz_help.html
For Snitz Mods: http://ls3k.com/snitz/

Go to Top of Page

@tomic
Senior Member

USA
1790 Posts

Posted - 27 March 2002 :  11:33:43  Show Profile  Visit @tomic's Homepage  Send @tomic an ICQ Message
How does the title of the page get into the title tags? Are you hard coding it? Are they the titles from a web page on another web site?

@tomic

http://www.skepticfriends.org
Go to Top of Page

Doug G
Support Moderator

USA
6493 Posts

Posted - 27 March 2002 :  12:42:59  Show Profile
I don't get it. If you're viewing an asp page, the title HTML was sent to the browser from the asp page and it should be easy to capture the title and generate some other HTML based on the current page title.

If you want to get the title of some other page other than the one you're viewing, you can use ASPTear or similar components to get the other page source into a variable you can use.


======
Doug G
======
Go to Top of Page

TerryG
Junior Member

United Kingdom
179 Posts

Posted - 28 March 2002 :  03:44:20  Show Profile
Doug G, give us a short example please so we can be sure we are not all talking at cross-purposes, thanks. Kong's original post talks about displaying a documents title within the same document, lets ignore displaying other docs titles in this doc for now.

Go to Top of Page

Kat
Advanced Member

United Kingdom
3065 Posts

Posted - 28 March 2002 :  04:24:56  Show Profile  Visit Kat's Homepage
Kong no longer seems to be participating in this discussion

Still never mind - we can carry on.

KatsKorner

Installation Help | http://ls3k.com/snitz/" target="_blank">Snitz Mods | Forum Hosting
Go to Top of Page

Doug G
Support Moderator

USA
6493 Posts

Posted - 29 March 2002 :  00:20:07  Show Profile
<%
dim sTitle
sTitle = "About My Website"
%>

<html>
<head>
<title><%=sTitle%></title>
</head>



======
Doug G
======
Go to Top of Page

Kong
Junior Member

100 Posts

Posted - 30 March 2002 :  05:28:18  Show Profile
What i was looking for was exactly what Kat had told me.

I took the coding and put it into the pages and I works great.

The only thing that I was hoping for was to not go into every document and change the title from say...


<title>My Webpage</title>


to...


<%PageTitle = "This is the page title"%>
<title><%=PageTitle%></title>


That's it. The coding Kat gave me to use works perfect and I'm very greatful she was able to help.

What I had said in my second post was that if anyone knows away to basically read the <title> tags without having to change it I would appreciate it... but I assume it's not possible.

Like I had already said... Kat solved the problem for me.

Thanks again.

_________________________
Come on by and visit Deth Incarnate.
Growing slowly, but growing none the less.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.33 seconds. Powered By: Snitz Forums 2000 Version 3.4.07