More in this section

Forums / Developing with Sitefinity / Find metadata for events through EventsIndxer

Find metadata for events through EventsIndxer

2 posts, 0 answered
  1. Tarun
    Tarun avatar
    81 posts
    14 Jan 2009
    01 Feb 2011
    Link to this post

    I have been creating search indexer for CUSTOM MODULE which work fine and search well. The same concept I am working with built-in Events module,and have created a custom event indexer which works fine and search well. Just need to figure out a simple thing. In Snippet, I am geting content "guid" at the end in snippet. I am trying to get this guid at the begging as this comes in other modules, 

    Please see attached image how the guid id coming.I just need to get this guid so i can get this content and can show its metadata on page.

  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    12 Sep 2017
    02 Feb 2011
    Link to this post
    Hi Tarun,

    Actually you can easily extract the Guid for the string by using RegularExpression so it does not matter where the item ID is added.

    public static Guid IsGUID(string expression)
             var mv = Guid.Empty;
             if (expression != null)
                 var str = String.Empty;
                 var rg = Regex.Matches(expression, @"\{{0,1}([0-9a-fA-F]){8}-([0-9a-fA-F]){4}-([0-9a-fA-F]){4}-([0-9a-fA-F]){4}-([0-9a-fA-F]){12}\}{0,1}");
                 if (rg.Count > 0)
                    str =  rg[0].ToString();
                 mv = new Guid(str);
             return mv;

    Best wishes,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
2 posts, 0 answered