-1

Im using sitecore 7.0 and ECM 2.1 and I came to an issue. Im trying to add a view online link to my message but I dont know where to redirect to. Basically the message is made of different modules with different datasources so I dont have a page? Does anyone have a suggestion/example?

Thank you in advance

Snapper
  • 686
  • 1
  • 13
  • 29

1 Answers1

1

You should be able to use some query string parameters for this, passing in the Id and language of your message. You have to make sure that all your ECM items are published though in order for it to work.

I've setup a basic ASP.NET HyperLink below in the code behind of a User control. You can then add this control to the Layout used by the message:

  ViewOnlineHyperlink.NavigateUrl = String.Format("/?sc_itemid={0}&sc_lang={1}&sc_pd_view=1", Sitecore.Context.Item.ID, Sitecore.Context.Language);
Ian Graham
  • 3,206
  • 1
  • 15
  • 23
  • Thanks Ian, I tried your suggestion and the url seems to be formatted correctly (ID pointing to the email message). However, when I open the link it shows the homepage? Doesn't seem to redirect... when I preview from sitecore it shows fine... http://website/?sc_itemid={IDHERE}&sc_mode=preview&sc_lang=en but it requires login... Any ideas? – Snapper Oct 27 '15 at 02:26