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

Forums / Developing with Sitefinity / What tables need to be populated for a news item?

What tables need to be populated for a news item?

7 posts, 0 answered
  1. Will
    Will avatar
    26 posts
    Registered:
    19 Aug 2008
    25 Nov 2009
    Link to this post
    While adding some additional meta data fields for news, I started looking at the database and it appears that there are only two tables related to storing news items, the [dbo].[sf_CmsTextContent] table contains the textual content of the news item, and the [dbo].[sf_GC_Variables] table contains all of the additional fields (meta data fields).  If I populate those tables directly, is that all that I have to do to add news items?  If not, what else needs to be populated?

    Also, is it possible to change the url for new items from the title/subject to the ID (Guid)?  The SEO recommendation for placing the title in the url was never thought out and is an extremely bad way of designing any web site.  Using the title/subject presents 2 limitations, no 2 articles can have the same title (which happens all the time), and if the title of an item is changed it either leads to 404 errors (which breaks SEO) or a url that no longer matches the title/subject (which also breaks SEO).  The ID of the item (Guid), will never change.  Does the { "/News", "UrlRewriteFormat" } entry in the [dbo].[sf_GC_Variables] table define this?  If so, how would we change it to use the ID column (Guid)?

    Thanks,
    Bill
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    25 Nov 2009
    Link to this post
    Hello Bill,

    The matadata is stored in [sf_GCMetaData], but you should better use the API to populate the tables. It is possible to change the title to GUID by modifying the provider urlRewriteFormat to ID. Note that the when you change the urlRewriteFormat to ID this will apply only to the new items. For all old content objects you need to update the title from [sf_GCMetaData]

    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.
  3. Will
    Will avatar
    26 posts
    Registered:
    19 Aug 2008
    25 Nov 2009
    Link to this post
    Hey Ivan,

    We tried writing a web service that uses the API, but it is way too slow for our needs.  Plus, when there is a correction to a news item, it will be much easier for us to make the changes directly to the database.  Using the web service, it took over 10 hours to add 5,000 news items using the API.  Doing this directly in the database, should take only a few seconds.  Are those two tables the only ones that we need to be concerned with?

    Thanks,
    Bill
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    25 Nov 2009
    Link to this post
    Hi Bill,

    As written "The matadata is stored in [sf_GCMetaData],"

    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.
  5. Will
    Will avatar
    26 posts
    Registered:
    19 Aug 2008
    25 Nov 2009
    Link to this post
    Hey Ivan,

    It looks like my original message didn't post correctly.  We need to add news items by directly adding records to the database.  Do we only need to add records to the [dbo].[sf_CmsTextContent] and [dbo].[sf_GCMetaData] tables?  If so, then we're good.  If not, what other tables need to be updated?

    Thanks,
    Bill
  6. Will
    Will avatar
    26 posts
    Registered:
    19 Aug 2008
    25 Nov 2009
    Link to this post
    P.S. I changed the [UrlRewriteFromat] entry to '[Publication_Date]/[ID].aspx', but Sitefinity keeps changing it back to '[Publication_Date]/[Title].aspx'.  Is there something else that needs to be done?
  7. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    25 Nov 2009
    Link to this post
    Hello Bill,

    The Title value is stored only in [sf_GCMetaData]. If you want to work with database this is the only table which you have to modify. You can use ID in the urlRewriteFormat wrap up with curly brackets, but in your case this will not help you because this is rewritten url. The actual value in the database table - GCMetadata will be the tile used when the object was created ( say "HotNews"). So the only way here will be injecting a GUID as Title for the news IContent object.

    Sincerely yours,
    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
7 posts, 0 answered