Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Retrieve current page title?

Guest
Nov 07, 2008 Nov 07, 2008
Without having to use CFHTTP.Filecontent, is there a way to retrieve the current page's title? I'm trying to pass in a parameter to a widget that asks for the current page title, but haven't seen a way to do it without using CFHTTP to call itself...
TOPICS
Getting started
579
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 07, 2008 Nov 07, 2008
you could probably use onRequest() method of Application.cfc to parse
the page content and get the title with some regexp... be aware though
that just having onRequest() in your Application.cfc may break
functionality of other parts of your application if you are using, for
example, flash remoting or remote calls to cfc's...

Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com/
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 07, 2008 Nov 07, 2008
Azadi wrote:
> you could probably use onRequest() method of Application.cfc to parse
> the page content and get the title with some regexp... be aware though
> that just having onRequest() in your Application.cfc may break
> functionality of other parts of your application if you are using, for
> example, flash remoting or remote calls to cfc's...
>
> Azadi Saryev
> Sabai-dee.com
> http://www.sabai-dee.com/

I'm not sure, but I wonder is something like this could be done in the
onRequestEnd() method as well?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 07, 2008 Nov 07, 2008
cffile action = read
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Nov 07, 2008 Nov 07, 2008
quote:

Originally posted by: Dan Bracuk
cffile action = read



Not sure how this relates...
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 07, 2008 Nov 07, 2008
you could use cffile action="read" instead of cfhttp ...

Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com/
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advisor ,
Nov 07, 2008 Nov 07, 2008
LATEST
If by "widget" you are referring to a Javascript widget running in the browser I'd use client side Javascript.

If you need to do this on the server side you might find this user defined function helpful.
http://www.cflib.org/udf/GetHTMLTitle
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources