jhdesign Posted September 8, 2005 Posted September 8, 2005 I'm using the category dropdown list contribution. I'm trying to add "&langauge=XX" to the generated URL. Links are created here: $info_box_contents[] = array('form' => '<form action="' . tep_href_link(FILENAME_DEFAULT) . '" method="get">' . tep_hide_session_id(), 'align' => 'left', 'text' => tep_draw_pull_down_menu('cPath', tep_get_paths(array(array('id' => '', 'text' => PULL_DOWN_DEFAULT))), $cPath,'onchange="this.form.submit();"') ); I tried adding the code in various parts but it doesnt work. closest I got was to put it in the 'text' line in 'cPath' but the & and ? come up as % codes and not actual letters. Been at this for 2 days now any help is appreciated! Jacob
♥Monika in Germany Posted September 8, 2005 Posted September 8, 2005 try this: $info_box_contents[] = array('form' => '<form action="' . tep_href_link(FILENAME_DEFAULT . '?language=' . $language) . '" method="get">' . tep_hide_session_id(), 'align' => 'left', 'text' => tep_draw_pull_down_menu('cPath', tep_get_paths(array(array('id' => '', 'text' => PULL_DOWN_DEFAULT))), $cPath,'onchange="this.form.submit();"') ); let me know what you get! :-) Monika addicted to writing code ... can't get enough of databases either, LOL! my toolbox: Textpad - Compare and Merge - phpMyAdmin - WS_FTP - Photoshop - How to search the forum Interactive Media Award July 2007 ~ category E-Commerce my advice on the forum is for free, PMs where you send me work are considered consultation which I charge for ...
user99999999 Posted September 8, 2005 Posted September 8, 2005 $info_box_contents[] = array('form' => '<form action="' . tep_href_link(FILENAME_DEFAULT . '?language=' . $language) . '" method="get">' . tep_hide_session_id(), 'align' => 'left', 'text' => tep_draw_pull_down_menu('cPath', tep_get_paths(array(array('id' => '', 'text' => PULL_DOWN_DEFAULT))), $cPath,'onchange="this.form.submit();"') ); Almost but try this $info_box_contents[] = array('form' => '<form action="' . tep_href_link(FILENAME_DEFAULT, 'language=' . $language) . '" method="get">' . tep_hide_session_id(), 'align' => 'left', 'text' => tep_draw_pull_down_menu('cPath', tep_get_paths(array(array('id' => '', 'text' => PULL_DOWN_DEFAULT))), $cPath,'onchange="this.form.submit();"') ); The ? and params get put on by tep_href_link() so you cant append in the function.
jhdesign Posted September 8, 2005 Author Posted September 8, 2005 No go on both tries. The URL changes to index.php?cpath=XX and this is where i need the &language=XX appended. If I look at the source before selecting a different category from the dropdown I see http://www.xxx.com/index.php?language=xx But after select a diff category it resets back to: http://www.xxx.com/index.php Any ideas?
user99999999 Posted September 8, 2005 Posted September 8, 2005 Hmmm I guess thats why tep_hide_session_id() is in there. So try putting it as a hidden field. $info_box_contents[] = array('form' => '<form action="' . tep_href_link(FILENAME_DEFAULT) . '" method="get">' . tep_hide_session_id() . tep_draw_hidden_field('language', $language), 'align' => 'left', 'text' => tep_draw_pull_down_menu('cPath', tep_get_paths(array(array('id' => '', 'text' => PULL_DOWN_DEFAULT))), $cPath,'onchange="this.form.submit();"') );
jhdesign Posted September 9, 2005 Author Posted September 9, 2005 That worked! Thank you. Can you tell me how you figured it out? or how it works?
user99999999 Posted September 9, 2005 Posted September 9, 2005 That worked! Thank you. Can you tell me how you figured it out? or how it works? <{POST_SNAPBACK}> Nope I really cant. Can you tell me why you need to do that because the language is set to the default and stored in the session and the only time a language=xxx is needed is when you want to change it.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.