Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Jonas Gunnarsson 44 posts 194 karma points
    Nov 29, 2011 @ 11:43
    Jonas Gunnarsson
    0

    Dropdown menu

    Hi,

    I have a new umbraco v 4.7.1 (Assembly version: 1.0.4281.20201) installation, with uBlogsy package installed. It works great! I use the blog for my photgrapy business and my plan is to create a document type for my portfolio and I want to have a dropdown menu for this, it would be greate to have this for the archive as well. What´s the best approach for this? I´m pretty new to umbraco but I have god skills in html/css and .net, but my XSLT-skills is rather low. Is there a package that I can use to get a start with this? 

    Best regards Jonas

     

  • Anthony Dang 1404 posts 2558 karma points MVP 3x c-trib
    Jan 21, 2012 @ 23:38
    Anthony Dang
    0

    I guess this reply is way too late. 

    But if you wanted to make a dropdown list it is quite easy in razor. No need to ever look at xslt!

    It would be something like this:

    <select id="ddl">
    @foreach (var post in thePostsListYouWantToRender){
    <option value="@post.Url">
    @post.GetPropertyValue("uBlogsyContentTitle")</option>
    }
    </select> 
     

     

    Then you could wire up some jquery... you'll need to do something like this...

    $('#ddl').change(function (){
    window.location = $(this).val()
    });

     

    I hope that helps


  • Jeroen Breuer 4908 posts 12265 karma points MVP 4x admin c-trib
    Jan 22, 2012 @ 04:11
    Jeroen Breuer
    0

    You can also create a DropDownList with Razor code inside a UserControl. That way you can use webforms which is easier in Umbraco 4: http://our.umbraco.org/forum/developers/razor/27417-Use-Razor-code-in-UserControl?p=1#comment102639.

    Jeroen

  • Jonas Gunnarsson 44 posts 194 karma points
    Sep 18, 2012 @ 09:19
    Jonas Gunnarsson
    0

    Thank you guys!

Please Sign in or register to post replies

Write your reply to:

Draft