Copied to clipboard

Flag this post as spam?

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


  • Dharmesh 50 posts 210 karma points
    Mar 30, 2017 @ 13:11
    Dharmesh
    0

    Popup on clicking on related link in umbraco

    Hello

    I have a partial view that i want to display as popup on related link. i don't have idea how to do that in umbraco with related links ? Please help guys :)

    Thanks
    Dharmesh

  • Sven Geusens 169 posts 881 karma points c-trib
    Mar 31, 2017 @ 13:19
    Sven Geusens
    100

    Step 1) A partial view is part of a page. So if you create a doctype with _Layout = null; and the partial call in it, you can display only the partial.

    Step 2) Create a Node of the doctype you just created. Now you can link to this node

    Step 4) Create some display code to example that uses our.umbraco.corepropertyvalueconverters package below

    var links = Model.Content.GetPropertyValue<RelatedLinks>("relatedLinks");
    
    foreach (var link in links)
    {
        if (link.IsInternal && link.Id.HasValue)
        {
            var linkedItem = Umbraco.TypedContent(link.Id.Value);
            if (linkedItem.DocumentTypeAlias == "docTypeAliasOfyourPopupDoctype")
            {
                // render it as a popup
            }
        }
        else
        {
            // render it like normal
        }
    }
    
Please Sign in or register to post replies

Write your reply to:

Draft