如何将动态元标记添加到数据库驱动的asp页面 [英] How do i add dynamic meta tags to a database driven asp page

查看:53
本文介绍了如何将动态元标记添加到数据库驱动的asp页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个新闻网站,有asp页面。它有发布软件,允许您在数据库中添加文章,然后从链接等中调用它。我已经分为两部分添加了动态元标记。第一部分位于inc.header.asp文件中,该文件在每个页面上调用。页面本身具有元标记变量,即。标题描述。它们在所有页面上都能正常工作,除了下面我遇到问题的页面。具有讽刺意味的是,它是最重要的页面,因为它是显示整篇文章的页面。 (view.asp)读者通过单击页面中的文章标题来到达view.asp,例如此处称为articlelist.asp。我已经在这里的2页中包含了相关的代码,


这里有一些相关的代码来自列出新闻链接的页面(让我们称之为文章列表) .asp")就是这个,这里有一个这样的链接,它是一个标题,摘要和可能的图像,以及其他信息。

I have a news website, with asp pages. It has publishing software which allows you to add articles in a database, and then calls them up from links etc. I have added dynamic meta tags in 2 parts. The first part is in the inc.header.asp file which is called up on every page. The page itself has the meta tag variable, ie. title, description. They work fine on all pages, except the one below i''m having problems with. Ironically it''s the most important page, because it''s the page that shows the full page article. (view.asp) The reader reaches view.asp by clicking on the article headline in the page before for example here it is called "articlelist.asp". I have included relevant code from the 2 pages here,


Here is a bit of relevant code from the page where the news links are listed (lets call it "articlelist.asp") is this one, and here is one such link, which is a headline, summary and possible image, and other info.

展开 | 选择 < span class =codeDivider> | Wrap | 行号

推荐答案

从您的帖子中,您似乎知道如何获取数据来自数据库,但不知道如何将它放在您的网页中。如果是这种情况,这就是解决方案:
From your post, it appears you know how to get the data from the database, but don''t know how to put it in your web page. If that is the case, this is the solution:
展开 | 选择 | Wrap | 行号


或者您希望元标记不同取决于用户正在查看哪篇文章?就像他们正在看如何建造狗屋一样然后元标记将是


关键词=狗屋,狗,房子,建筑物,自己动手,DYI


或如果他们正在寻找摆脱皮疹的家庭疗法


关键词=皮疹,发痒,家庭疗法,补救措施

??
Or is it that you want the meta tags to be different depending on which article they user is looking at? Like if they''re looking at "How to build a dog house" then the meta tag would be

Keywords="dog house, dog, house, building, do it yourself, DYI"

or if they''re looking at "Home remedies to get rid of a rash"

Keywords="rash, itchy, home remedies, remedies"

??



或者您希望元标记根据用户正在查找的文章而有所不同在?就像他们正在看如何建造狗屋一样然后元标记将是


关键词=狗屋,狗,房子,建筑物,自己动手,DYI


或如果他们正在寻找摆脱皮疹的家庭疗法


关键词=皮疹,发痒,家庭疗法,补救措施

??
Or is it that you want the meta tags to be different depending on which article they user is looking at? Like if they''re looking at "How to build a dog house" then the meta tag would be

Keywords="dog house, dog, house, building, do it yourself, DYI"

or if they''re looking at "Home remedies to get rid of a rash"

Keywords="rash, itchy, home remedies, remedies"

??



是MarkRawlingson,这就是我想要的。否则,目前,标签在所有页面上都能完美运行。它们甚至可以在view.asp页面上工作,但这是需要从数据库中提取文章的页面。正如你所看到的,他们现在的样子,他们在每一页上都是相同的。它们工作,但我需要从数据库中的文章中间的页面中间绘制变量。这对我来说是一个愚蠢的复杂问题,但也许有一个简单的解决方案?


我不是html识字,我希望我不必乱拨数据库,因为它是为我做的。我希望有一个简单的解决方案。


主要问题似乎是文章的模板都在软件中,这意味着当我将它们添加到他们展示的文章的内容时(仅在查看源代码虽然在内容中,而不是在标题中,就像我想要的那样。


感谢您的任何提示,请记住,我不是HTML识字。

yes MarkRawlingson, that is what i want. Otherwise at the moment, the tags work perfectly onall the pages. They even work on the view.asp page but this is the page that needs to pull up the article from the database. As you can see, the way they are now, they pull up all the same on every page. They work, but i need to draw the variable from the middle of the page from the article in the database. its a stupid complicated problem to me but maybe there is a simple solution?

im not html literate, and i hope i don''t have to fiddle with the database, as it was done for me. Im hoping there is a simple solution to this.


The main problem seems to be that the templates for the articles are in the software, which means when i add them to the content of the article they show (only in "view source" though) in the content, not in the header, like i want them to.

Thanks for any tips, bear in mind, im not html literate.


这篇关于如何将动态元标记添加到数据库驱动的asp页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆