Dynamic Titles and Meta Descriptions

W

weismana81

I am trying to create dynamic title and meta tag descriptions for my pages
that are called from a database. I'm really not sure how to go about this.
But I took a stab at it with this. Shot in the dark.

<title>Tutorials:<%=FP_FieldURL(fp_rs,"tutorialID")%></title>

Of course this did not work. Any suggestions? I guess I'll need to open my
db connection and all that. If someone could point me in the right
direction, it would be much appreciated.
Thanks...
 
C

Chris Leeds, MVP-FrontPage

you'd have to connect to the db and get that data before any other code in
the source of your page.

HTH

--
Chris Leeds,
Microsoft MVP-FrontPage

ContentSeed: great tool for web masters,
a fantastic convenience for site owners.
http://contentseed.com/
 
W

weismana81

Thanks! That did the job!!!
Would you by chance have any advice on creating the description tag. I
don't suppose it would look something like this?:

<% strDescription = Request("body1")%>
<head>
<meta name="description" content="<%=strDescription%>">
</head>

P.S. Employee... Tutorial... Whatever:)

Thanks again.
 
S

Stefan B Rusynko

Yes if body1 is the db field w/ the info and you have opened the DB connection to that table before you create the string

<%
strTitle = Request("tutorialID")
strDescription = Request("body1")
%>
<head>
<title>Tutorial: <%=strTitle%></title>

<meta name="description" content="<%=strDescription%>">
</head>





| Thanks! That did the job!!!
| Would you by chance have any advice on creating the description tag. I
| don't suppose it would look something like this?:
|
| <% strDescription = Request("body1")%>
| <head>
| <meta name="description" content="<%=strDescription%>">
| </head>
|
| P.S. Employee... Tutorial... Whatever:)
|
| Thanks again.
| "Kathleen Anderson [MVP - FrontPage]" wrote:
|
| > <% strTitle = Request("tutorialID")%>
| > <head>
| > <title>Tutorial: <%=strTitle%></title>
| > </head>
| >
| > would probably be better :)
| >
| > --
| >
| > ~ Kathleen Anderson
| > Microsoft FrontPage MVP
| > Spider Web Woman Designs
| > http://www.spiderwebwoman.com/resources/
| >
| >
| >
| > > Try this:
| > >
| > > <% strTitle = Request("tutorialID")%>
| > > <head>
| > > <title>Employee number: <%=strTitle%></title>
| > > </head>
| > >
| > >
| > >
| > >> I am trying to create dynamic title and meta tag descriptions for my
| > >> pages that are called from a database. I'm really not sure how to go
| > >> about this. But I took a stab at it with this. Shot in the dark.
| > >>
| > >> <title>Tutorials:<%=FP_FieldURL(fp_rs,"tutorialID")%></title>
| > >>
| > >> Of course this did not work. Any suggestions? I guess I'll need to
| > >> open my db connection and all that. If someone could point me in the
| > >> right direction, it would be much appreciated.
| > >> Thanks...
| >
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top