[Typo3] Replace single whitespace character with other characterin TS: SOLVED
digitalfan at earthlink.net
digitalfan at earthlink.net
Thu May 26 04:07:50 CEST 2005
My problem involved being able to use a SELECT BOX MENU with the REALURL extension. To solve my problem, I made a hack that re-writes the normal anchor tags that are created with TMENU, changing them to <option></option> tags. This is the only way to get the select option values to display properly if you are using REALURL, because you can't have the select menu go to "index.php?id=123" because you want to display the page name in the url, and you can't display the page name because it could have spaces, other non-url-encoded characters, etc.
TS Code:
#Includes
includeLibs.test = fileadmin/custom_lib/tmenu_lib.inc
#TMENU Fix
lib.channelselectmenu_1.1 {
IProcFunc = user_tmenu->fixLinkCodeForSelectBox
wrap = <br> <div style="margin-bottom:5px">channel selector:</div><select onchange="document.location='http://www.mysite.com/directory/typo3/'+this[this.selectedIndex].value"><option value="">select channel</option> | </select><div style="margin-bottom:2px"></div>
NO.stdWrap.data = field:subtitle
NO.stdWrap= |
}
PHP Code (tmenu_lib.inc):
class user_tmenu {
function fixLinkCodeForSelectBox($I,$conf) {
$conf["parentObj"]->I = $I;
$conf["parentObj"]->setATagParts();
$I = $conf["parentObj"]->I;
///make select box item selected if it's on that page
if($I["uid"] == $GLOBALS['TSFE']->id)
$selected_code = " SELECTED";
else
$selected_code = "";
//modify link code to option code
$I["parts"]["ATag_begin"]="<option value='".$I["linkHREF"]["HREF"]."'".$selected_code.">";
$I["parts"]["ATag_end"]="</option>";
return $I;
}
}
--
I am using the free version of SPAMfighter for private users.
It has removed 35602 spam emails to date.
Paying users do not have this message in their emails.
Try www.SPAMfighter.com for free now!
More information about the TYPO3-english
mailing list