The Un-Official Proxomitron Forum

Full Version: Page contents to <title> tag
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
is there any way to get some page contents into page title tag?
running Oct 23 config.

reason need it: on some forums the <title> tag contains meaningless stuff like MS apps and etc, so i want to put in contents of the <div class='maintitle'>
i've done something like this
Bounds = "<div class='maintitle'>*</div>"
Limit = 254
Match = "\1<b>\2</b>\3$SET(THtit=\2)"
Replace = "\1<b>\2</b>\3"
question is how to get it into <title> Smile!
thanks in advance for help.
could i have the link to the site-in-question?
thanks for the reply. sorry those are private boards, but the engine is a regular Invision Power Board.
i guess during engine setup, paranoia ruled Smile!. strangely ruled though i must say.
the skin and structure is similar to this one -
for this example lets say i want to update the <title> with some contents of <div id='navstrip' align='left'>
i am having troubles not with finding and setting contents of THtit but with updating <title> and adding contents of THtit. because content that i need comes after! <title> has been processed.
i hope i'am not confusing and was able to explain what i need.
ah, i see the dilemma (contents coming after title)...

perhaps a <body> tag 'onload' of some kind?
I think I'd try using the Proxomitron to empty the Title block, capture the text, and add a javascript that uses document.title to modify the title.

Otherwise, BFMI. Remove the Title block, match from </head> to desired text, place new Title block, and replace matched code.

I'd try to generate a javascript that alters document.title after identifying the portion of the target DIV to use for it. I'd generate that script either just before the /DIV or after it, and totally ignore what-ever any previous <title> might have been (if any).

Below illustrates the method. In this example the script is appending (via '+=' construct) the string to the previous title content. Maybe you want to assign your desired text instead of append.
<title>the base title</title>
Some Stuff in the body ...

<script language="javascript">
document.title += ' ** And We Added This';

yay! Smile!
<script language="javascript">\r\n
    pxDt = document.title;\r\n
    re = /Meaningless stuff/g;\r\n
    document.title = pxDt.replace(re, "") + '\2';\r\n
saw similar code in proxjs-full.js before but didn't get how to use it in my case. Smile! thanks a lot for the hints.
so many sites have bad titles, this document.title method could be a general filter, that can be customized from an include-exclude or other list file.
my purpose is only to bookmark and only a few sites worth the trouble, so i have a few site-specific filters. the filter creates link to the same page at location on the page where the usable info appears. simplified fake example, before:
<h1>text that should be good title, bookmark</h1>
<h4><a href="\u">text that should be good title,</a></h4>
Reference URL's