+1-888-365-2779
Try Now
More in this section

Forums / General Discussions / Additional URL's in events

Additional URL's in events

5 posts, 0 answered
  1. Arekayee
    Arekayee avatar
    3 posts
    Registered:
    04 Apr 2014
    01 Oct 2014
    Link to this post

    Hello,

    we're trying to setup additional url's for events but are receiving 404's.  Seems like a very straightforward task.  I've read many related posts in the Sitefinity Forums pages but have found nothing that addresses our issue. 

    Simply stated, we want to be able to access a page such as

    http://testdomain.com/home/events/events-detail/2014/09/15/default-calendar/annual-meeting

    via a shortened url like http://testdomain.com/annualmeeting.

    Within the specific event fields I have selected 'allow multiple url's for this item'.  I have specified the shortened url of '~/annualmeeting' in the additional url's entry.  I have also selected 'all additional url's redirect to the default one.'

    I have tried different permutations of these fields as well - like using '~/annualmeeting.aspx' instead as I read one was doing in a different thread.

    Still no luck, any suggestions would be greatly appreciated.

    thanks in advance

  2. Svetoslav Manchev
    Svetoslav Manchev avatar
    735 posts
    Registered:
    29 Nov 2016
    06 Oct 2014
    Link to this post
    Hello Ryan,

    The additional URL "replaces" the Event  data, for example:
    /2014/10/20/default-calendar/usa-ca-1

    so in case you have detail event view on: www.mysite.com/events/2014/10/20/default-calendar/usa-ca-1,
    the additional url will looks like:
    www.mysite.com/events/my-event-1

    Screenshot is available here.

    Regards,
    Svetoslav Manchev
    Telerik
     
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
     
  3. Arekayee
    Arekayee avatar
    3 posts
    Registered:
    04 Apr 2014
    06 Oct 2014 in reply to Svetoslav Manchev
    Link to this post

    Hello Svetoslav,

     thanks for your reply.  My apologies as I had not investigated the issue thoroughly before posting the original question.  The issue appears to not be the additional url redirects themselves but a problem in the page load of a control on the page.  We are trying to use 

    this.currentEvent = EventHelper.GetCurrentEvent(this.GetUrlParameterString(true)); 

    to return the actual event.  However, the shortened url is not recognized in this situation.  Can you tell me if there is recommended way to return the event based on the alternate, shortened url?  Thanks again for any information you can provide.

     Best regards,

  4. Arekayee
    Arekayee avatar
    3 posts
    Registered:
    04 Apr 2014
    08 Oct 2014 in reply to Arekayee
    Link to this post

    Hello again Svetoslav,

    as a follow-up...

    we are trying to retrieve information for a specific event using the following:

    var manager = EventsManager.GetManager(); 

    Event ev = manager.GetEvents().Where(e => e.ItemDefaultUrl == itemUrl  && e.Status == ContentLifecycleStatus.Master).SingleOrDefault() as Event;.

    The itemUrl is being retrieved using var ps = this.GetUrlParameterString(true);  This normally works fine, however, when one of the event's additional urls is used the GetEvents() method returns null. 

    Can you please advise if we can retrieve the event via a more specific Linq query or if there is another method to accomplish this task.  As this is being done in page load, we are assuming the redirect has not yet occurred and this is why the itemUrl is being returned as the additional url and not the original event url.  Can you please address this point as well.

    Best regards,

     

  5. Svetoslav Manchev
    Svetoslav Manchev avatar
    735 posts
    Registered:
    29 Nov 2016
    13 Oct 2014
    Link to this post
    Hi Ryan,

    In order to include the additional urls in your query, you need to check the UrlData which includes all the Item Urls, for example:
    var manager = EventsManager.GetManager();
    var itemUrl = this.GetUrlParameterString(true);
    // var urls = manager.GetEvents().First().Urls; // just for example
    Event evt = manager
        .GetEvents()
        .Where(ev => ev.Urls.Where(url=>url.Url == itemUrl).Count()>0
            && ev.Status == ContentLifecycleStatus.Master)
            .SingleOrDefault();


    Regards,
    Svetoslav Manchev
    Telerik
     
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
     
5 posts, 0 answered