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

Forums / Developing with Sitefinity / EventsView contact information

EventsView contact information

9 posts, 0 answered
  1. Diana
    Diana avatar
    16 posts
    Registered:
    26 Nov 2008
    05 Feb 2009
    Link to this post
    Hi,

    When viewing the contact information for an event, I would like to have the website and email address show up as links. 

    When I look at the templates for the control (ListPageDetail and ListPageMaster) it looks likes it is trying to wrap the values in anchor tags, using a string format, but it is not doing it. The whole Text value ends up being replaced with the value instead of just the parameters. 

    Is there a way to make it do the string format?  If not, is there another option to get these items wrapped in anchor tags?

    Thanks
    Diana
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    06 Feb 2009
    Link to this post
    Hello Diana,

    Thank you for using our services.

    Here are the steps that you should follow:

    1. In ~/Sitefinity/ControlTemplates/Events/Modes/ListPageDetail.ascx I removed the plhWho tag and Text property of the Literal controls for each of the Contact fields

    <div id="ContactInfo" runat="server" class="sf_eventContact">  
        <div><asp:Literal ID="Contact_Name" runat="server"></asp:Literal></div>  
        <div><asp:Literal ID="Contact_Email" runat="server"></asp:Literal></div>  
        <div><asp:Literal ID="Contact_Phone" runat="server"></asp:Literal></div>  
        <div><asp:Literal ID="Contact_Cell" runat="server"></asp:Literal></div>  
        <div><asp:Literal ID="Contact_Web" runat="server"></asp:Literal></div>  
    </div>  


    2. In ~/Sitefinity/Admin/ControlTemplates/Events/Design/EventsViewControlDesigner.ascx remove the TextSetting for  TargetID="plhWho" and replace it as the example below demonstrates in the <DetailSettings> List & Page presentation mode.

    <sfDesignSettings:TextSetting ID="TextSetting11"  
                          TargetID="Contact_Name"  
                          SettingTitle="Contact: Name"   
                          AllowLabelSetting="False"   
                          AllowFormatSetting="True"  
                          FormatType="String"  
                          AllowVisibilitySetting="True"  
                          TargetVisibleByDefault="True">  
                          </sfDesignSettings:TextSetting>   
    <sfDesignSettings:TextSetting ID="TextSetting48"  
                          TargetID="Contact_Email"  
                          SettingTitle="Contact: Email"   
                          AllowLabelSetting="False"   
                          AllowFormatSetting="True"  
                          FormatType="String"  
                          AllowVisibilitySetting="True"  
                          TargetVisibleByDefault="True">  
                          </sfDesignSettings:TextSetting>  
    <sfDesignSettings:TextSetting ID="TextSetting49"  
                          TargetID="Contact_Phone"  
                          SettingTitle="Contact: Phone"   
                          AllowLabelSetting="False"   
                          AllowFormatSetting="True"  
                          FormatType="String"  
                          AllowVisibilitySetting="True"  
                          TargetVisibleByDefault="True">  
                          </sfDesignSettings:TextSetting>  
    <sfDesignSettings:TextSetting ID="TextSetting50"  
                          TargetID="Contact_Cell"  
                          SettingTitle="Contact: Cell"   
                          AllowLabelSetting="False"   
                          AllowFormatSetting="True"  
                          FormatType="String"  
                          AllowVisibilitySetting="True"  
                          TargetVisibleByDefault="True">  
                          </sfDesignSettings:TextSetting>  
    <sfDesignSettings:TextSetting ID="TextSetting51"  
                          TargetID="Contact_Web"  
                          SettingTitle="Contact: Web"   
                          AllowLabelSetting="False"   
                          AllowFormatSetting="True"  
                          FormatType="String"  
                          AllowVisibilitySetting="True"  
                          TargetVisibleByDefault="True">  
                          </sfDesignSettings:TextSetting>  

    Here we set FormatType as string, this allow us to use the value of this fields and set Contact_Web and Contact_Email as links on the next step.

    After you have dropped the control on a page, browse the control in edit mode and you will notice that there are new fields related to the changes we made. Mark the checkboxes  for the fields you want to be displayed on the page and enter the following for

    Contact_Web string format : <a href='http://{0}'>{0}

    Contact_Email string format: <a href='mailto:{0}'>{0}</a>

    I hope this helps.

    Kind regards,
    Ivan Dimitrov
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. Diana
    Diana avatar
    16 posts
    Registered:
    26 Nov 2008
    10 Feb 2009
    Link to this post
    Thank you - this works great!
    Diana
  4. Dave
    Dave avatar
    14 posts
    Registered:
    04 Feb 2009
    18 Mar 2009
    Link to this post
    My string format setting changes are not taking effect.  And when I go back into edit them my format string has been erased.
  5. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    18 Mar 2009
    Link to this post
    Hi Dave,

    Which version of Sitefinity are you using?

    Kind regards,
    Georgi
    the Telerik team


    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  6. Dave
    Dave avatar
    14 posts
    Registered:
    04 Feb 2009
    18 Mar 2009
    Link to this post
    3.5
  7. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    18 Mar 2009
    Link to this post
    Hello Dave,

    It is implemented under Sitefinity version 3.5. Try the following - change the View mode of the control, then save it. Afterwords, open EventsView control in edit mode, then return back  List and Page view and click "I am done" button. If this does not help, remove EventsView control from your page and add it again.

    Regards,
    Ivan Dimitrov
    the Telerik team


    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  8. Dave
    Dave avatar
    14 posts
    Registered:
    04 Feb 2009
    18 Mar 2009
    Link to this post
    This solved my problem, however, I must have the TargetID's wrong on for my Street, City, State, and Country on the EventsViewControlDesigner.  I have Event_Street for example set as my TargetID for Street.
  9. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    19 Mar 2009
    Link to this post
    Hi Dave,

    I am glad to hear that everything works fine. Let us know if there is anything else that we can do for you.

    Kind regards,
    Ivan Dimitrov
    the Telerik team


    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
Register for webinar
9 posts, 0 answered