An elegant way to link to an element in a Sitecore client?

I am looking for a better way to link to an element in a Sitecore client (and not on an external website). The link will be placed in the message with a link violation. The user should be able to click the link and start the Sitecore content editor if this item is automatically selected in the tree.

I found Mark Ursino's solution on my blog here , but unfortunately it only works if you are actively logged into Sitecore (otherwise it brings you to the Sitecore desktop after logging in).

I am running Sitecore.NET 6.4.1 (version 110324)

UPDATE

Just to close the loop as Marco decided:

public void Process(LoggedInArgs args)
{
    string url = HttpUtility.UrlDecode(WebUtil.GetQueryString("url"));

    // Ensure we're dealing with the client login site and there is a URL to redirect to
    if (Sitecore.Context.GetSiteName() == "login" &&
        !String.IsNullOrEmpty(url))
    {
        var queryString = WebUtil.ParseQueryString(url);

        // Check for redirect param to prevent accidental redirections 
        if (queryString.ContainsKey("redirectAfterLogin"))
                WebUtil.Redirect(url);
    }
}
+3
source share
3

:

sitecore web.config raw url. ,

<setting name="Authentication.SaveRawUrl">
  <patch:attribute name="value">true</patch:attribute>
</setting>

loggedin CleanupUserProfile, . , , .

namespace [...]
{
    public class LoginModeSwitcher
    {
        public void Process(LoggedInArgs args)
        {
            // your code here
        }
    }
}

, :

<processors>
  <loggedin>
    <processor patch:after="*[@type='Sitecore.Pipelines.LoggedIn.CleanupUserProfile, Sitecore.Kernel']" mode="on" type="[...].LoginModeSwitcher, [ASSEMBLY]" />
  </loggedin>
</processors>

querystring, , , , .

+2

, , , Sitecore. URL , : itemID serialCode. - , , , , , , . , web.config . ItemID, , . ( , Sitecore Sitecore , )

Sitecore. Sitecore . , . , . , Sitecore, , . , , .

+3

, . , login Sitecore , ..., .

This is essentially the same as the first sentence of mstiles, minus the automatic login process. It’s just a security breach waiting to happen ... don’t do it.

0
source

All Articles