More in this section

Forums / Developing with Sitefinity / Shared Hyperlink that works like Shared Content?

Shared Hyperlink that works like Shared Content?

8 posts, 0 answered
  1. Penny
    Penny avatar
    4 posts
    Registered:
    20 May 2009
    31 Aug 2009
    Link to this post
    Does anyone know if sitefinity has a shared hyperlink feature that works like shared generic content?
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    01 Sep 2009
    Link to this post
    Hello Penny,

    You can create a shared content and add dynamic hyperlink in it. Then you can use this link when you create a GenericContent item. Another option is creating a custom control that gets a list of hypoerlinks and then you can add one or more links on a page.

    Best wishes,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. Penny
    Penny avatar
    4 posts
    Registered:
    20 May 2009
    01 Sep 2009
    Link to this post
    How do I add a dynamic hyperlink control within a shared content? Because I can either drag the dynamic hyperlink control above or below the generic content control.

    This is what I would like to archive:
    ------------------
    Here is a bunch of shared hyperlinks in a generic content
    1. link 1
    2. link 2
    3. link 3
    This is the end of this content
    -------------------
    And all the links(ie. link 1, link 2, link 3) will be used in some other pages, so I would like to be able to change these shared links at one place like how shared content works instead of finding out where I put the link in which page.
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    01 Sep 2009
    Link to this post
    Hi Penny,

    So what stops you to create several Generic Content items. Each item content should be only one link. This link can be created through RadEditor's LinkManager which is customized by default with a custom designer. So if you link to a resource - page, another content item from your website and then make any changes to these resources the link will not be broken. We use the GUID of an item in all links.

    All the best,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  5. Penny
    Penny avatar
    4 posts
    Registered:
    20 May 2009
    01 Sep 2009
    Link to this post
    So if I understand correctly what you mean is that I put one hyperlink into one generic content and shared it right? I did this before(see below), but the problem is I don't want the number (ie 1. 2. 3.) to be shared too.
    [each ------ is a separate generic content]
    ------------------
    Here is a bunch of shared hyperlinks in a generic content
    -------------------
    1. link 1
    -------------------
    2. link 2
    -------------------
    3. link 3
    --------------------
    This is the end of this content
    -------------------
  6. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    07 Sep 2009
    Link to this post
    Hello Penny,

    I can suggest you another approach with the shared links. You could define another provider for Generic Content and use it for your links. Then enter the numbers in the Name/Title field. This should do the trick.

    Regards,
    Georgi
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  7. Penny
    Penny avatar
    4 posts
    Registered:
    20 May 2009
    10 Sep 2009
    Link to this post
    Hi Georgi,

    I am new to sitefinity. Would you mind telling me the steps on how to achieve this?

    Thanks!!!
  8. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    10 Sep 2009
    Link to this post
    Hello Penny,

    Adding a provider can come in very handy if you want your Sitefinity modules to display items from
    some other data source, or if you want to implement some functionality that is different from the default.
    For instance, if you have several sites and need to display the same news articles across those sites, you need to store these items in a common database. To achieve this, you need to:
     set the connectionStringName attribute for each news provider to point to a connection string
    to the same database; set the applicationName attribute for each news provider to the same value.
    Follow the steps below to add your own news provider, for example “Breaking News” provider.

    1. Open the application web.config file and find the
    <cmsEngine defaultProvider="Generic_Content"> section. From the providers’ collection, copy
    the provider element named News.
    2. Paste below it and rename it to Breaking_News for example.
    3. Set the applicationName attribute to /BreakingNews. The new provider should look like this:

    <add name="Breaking_News" 
    defaultMetaField="Title" 
    visible="False" 
    securityProviderName="" 
    allowVersioning="True" 
    applicationName="/BreakingNews" 
    versioningProviderName="" 
    connectionStringName="GenericContentConnection" 
    type="Telerik.Cms.Engine.Data.Providers.DefaultProvider, 
    Telerik.Cms.Engine.Data" 
    ...... 
    /> 

    4. From the <metaFields> collection in the <cmsEngine> section, copy all elements whose
    keys start with “News”.
    5. Paste the elements below the last element so the new ones are added to the collection.
    6. Change the key of each new element from News.[FieldName] to Breaking_News.[FieldName].

    <add key="Breaking_News.Title" valueType="ShortText" visible="True" 
    searchable="True" sortable="True" defaultValue=""/> 
    <add key="Breaking_News.Summary" valueType="LongText" visible="True" 
    searchable="True" sortable="True" defaultValue=""/> 
    <add key="Breaking_News.Author" valueType="ShortText" visible="True" 
    searchable="True" sortable="True" defaultValue=""/> 
    <add key="Breaking_News.Source" valueType="ShortText" visible="True" 
    searchable="True" sortable="True" defaultValue=""/> 
    <add key="Breaking_News.Publication_Date" valueType="DateTime" 
    visible="True" searchable="True" sortable="True" 
    defaultValue="#Now"/> 
    <add key="Breaking_News.Expiration_Date" valueType="DateTime" 
    visible="True" searchable="True" sortable="True" 
    defaultValue="#Max"/> 
    <add key="Breaking_News.Thumbnail" valueType="ShortText" 
    visible="True" searchable="False" sortable="False" defaultValue=""/> 
    <add key="Breaking_News.Category" valueType="ShortText" 
    visible="True" searchable="True" sortable="True" defaultValue="" /> 


    7. Find the <news> section and from the <genericContentProviders> collection, copy the
    first element and paste below it.
    8. Rename the provider to Breaking_News:

    <add providerName="Breaking_News" 
    publicationDateField="Publication_Date" 
    expirationDateField="Expiration_Date" 
    thumbnailUrlField="Thumbnail" 
    urlRewriteFormat="[Publication_Date]/[Title].aspx" 
    urlDateTimeFormat="yy-MM-dd" 
    urlWhitespaceChar="_" /> 

    If you do not want several web sites to share the same content, but use a common database, for
    example, you want to ensure that each site has different news articles, you need to change the
    applicationName attribute for each news provider.
    Find this section <cmsEngine defaultProvider="Generic_Content">, change applicationName:

    <add name="Breaking_News" 
    defaultMetaField="Title" 
    visible="False" 
    securityProviderName="" 
    allowVersioning="True" 
    applicationName="Site1/BreakingNews" 
    ... 

    For setting custom templates for the newly added provider, please take a look at the following post.

    Greetings,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Register for webinar
8 posts, 0 answered