test
Viewing 15 posts - 1 through 15 (of 17 total)
  • Author
    Posts
  • bmtoth Friend
    #155122

    How do we go about linking the items in the drop down box at the top of the page?

    Thanks for any pointers.

    Phill Moderator
    #358316

    Which item? The ones in the main menu or the top right marked USA, UK etc?

    The dropdown is a simple html options list (google the <option> tag for more information). It is located in the module position “Top”. You can put whatever you want in that module position.

    amir00251 Friend
    #377801

    I have tried various different codes to sort out this linking with no success. For example

    <option value=”http://www.southafrica.com”>South Africa</option>

    Can you please give a example, instead of referring to search engines. I have tried some more codes and the results are the same. Can someone use this custom code for other JA templates? Thanks.

    Ninja Lead Moderator
    #377915

    you meant you want South Afica to appear as a link that can be clicked? I think its not possible, cause <option> tag can not contain a link.

    amir00251 Friend
    #377963

    Thanks for your reply. The South Africal is just an example with an example url. What I want is that by choosing South Africa as an example by user, the browser could be redirected to a website related to that choice. Say like multilingual websites, you have the dropdown for languages and choosing each language redirects to the right url.

    Ninja Lead Moderator
    #378091

    you have to modify the code, mainly javascript, for a direction you should do as following:
    have a dropdown list that use <select> tag which has the onchange event bound to a javascript function, in that function you have the javascript code to redirect browser to selected url.
    There are much docs on web that you can consult in order to acomplish this.

    amir00251 Friend
    #378113

    Hello, it would have been good when this template was designed to put a sample javascript code for this module which does have the links in. I now add the Javascript code and after saving when I go back to the html, the code has been disappeared. Should this code be inserted in the html area?

    The original code in module is:

    <ul class=”quick-contact”>
    <li class=”phone”><strong>Sales: </strong>0987 989898</li>
    <li class=”email”><strong>Email: </strong><a href=”#” title=”Sample link”>info@yourdomain.com</a></li>
    <li class=”sites”><strong>Sites: </strong><select id=”inputbox”><option>USA</option><option>UK</option><option>France</option><option>Japan</option><option>South Africa</option></select></li>
    </ul>

    and I have changed this to

    <ul class=”quick-contact”>
    <li class=”phone”><strong>Sales: </strong>0987 989898</li>
    <li class=”email”><strong>Email: </strong><a href=”#” title=”Sample link”>info@yourdomain.com</a></li>
    <li class=”sites”><strong>Sites: </strong><select id=”inputbox”>
    <option value=”nothing” selected=”selected”>Select a site</option>
    <option value=”http://www.testdomain.com/us”>USA</option>
    <option value=”http://www.testdomain.com/uk”>UK</option>
    <option value=”http://www.testdomain.com/fr”>France</option>
    <option value=”http://www.testdomain.com/ja”>Japan</option>
    <option value=”http://www.testdomain.com/sf”>South Africa</option>
    </select>

    <script type=”text/javascript”>

    var selectmenu=document.getElementById(“inputbox”)
    selectmenu.onchange=function(){ //run some code when “onchange” event fires
    var chosenoption=this.options //this refers to “selectmenu”
    if (chosenoption.value!=”nothing”){
    window.open(chosenoption.value, “”, “”) //open target site (based on option’s value attr) in new window
    }
    }

    </script>

    </li>
    </ul>

    found this code in http://www.javascriptkit.com/jsref/select.shtml which is working fine in the demo on that website but it does not seem to work in my joomlart template. Anything I should change or do? Thanks.

    Ninja Lead Moderator
    #378249

    it seems to be cleaned by MCE editor when you saved.
    try go to global configuration and choose text editor to None, you will be able to save the js code.

    amir00251 Friend
    #378262

    Hello, Thanks for the advive. I did that and what happens is that javascript code shows up on the website after dropdown like a text. I am not really sure that this is the reason, there should probably be another reason. That is why I think it would have been good to make a example on the template for linking different dropdown options to a test url.

    Sherlock Friend
    #378337

    Dear amir00251,

    I tried with the codes you posted and I saw it working well :),Please check it again

    amir00251 Friend
    #378884

    Hello,

    I have tested again, I even copy pasted exact same code from original website, still the same results. After saving, the Javescript code disappears and no redirection on the frontend! I will try to use a ticket system for support team could have a look at the code in my backend. Thanks

    andrzejmarek Friend
    #381149

    For me it doesn’t work 🙁 HELP, please http://www.renouveau.be/NEW/

    andrzejmarek Friend
    #382106

    And to go in the same window ? (interne link)
    :(( Help please 🙂

    Ninja Lead Moderator
    #382494

    <em>@andrzejmarek 227415 wrote:</em><blockquote>For me it doesn’t work 🙁 HELP, please http://www.renouveau.be/NEW/</blockquote>
    Can you give me your admin access to your site via PM. I will try to check and fix it for you.

    dansel Friend
    #384493

    You have to remove the double quotes in web pages, then everything works. These were inserted at least for me, by copy / paste the html code.

    <option value=”http://www.testdomain.com/us”>USA</option>

    Hope it helps.

    BTW: Thanx a lot for the code!!!!!!!!!! I’ve tried for weeks about it but never managed to get that it looks like in the demo. Now it fits!

Viewing 15 posts - 1 through 15 (of 17 total)

This topic contains 17 replies, has 9 voices, and was last updated by  pritam 13 years, 7 months ago.

We moved to new unified forum. Please post all new support queries in our New Forum