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

Forums / Developing with Sitefinity / News Providers with different fields

News Providers with different fields

6 posts, 0 answered
  1. Shalaka
    Shalaka avatar
    50 posts
    Registered:
    24 Mar 2011
    21 Mar 2012
    Link to this post
    Hi,

    I wanted to have different fields as per different provider for new in sitefinity 4.4.
    I have added three providers to news using administrator -> advance settings.
    but whenever i add a news in one provider, it is getting display in all other providers, except the default openaccessnewsprovider.
    how should i avoid this? i want news as per the assigned providers.
    and i wanted to have different fields to each provider.
    How should i manage this.
    Please help...


    Thanks & Regards.
  2. Shalaka
    Shalaka avatar
    50 posts
    Registered:
    24 Mar 2011
    27 Mar 2012
    Link to this post
    any solution ?
  3. Jen Peleva
    Jen Peleva avatar
    568 posts
    Registered:
    10 Nov 2016
    29 Mar 2012
    Link to this post
    Hello Shalaka,

    If you have implemented you custom news providers properly, when a new item is created in one of the websites, it should appear in the others. Can you verify that you performed the same steps as listed below to be sure that you aren't missing something:
    1. Navigate to Administration -> Settings -> Content- > Providers.
    2. Create a new provider with the same fields as the OpenAccessDataProvider, but with a different Title.
    3. Next step is to create a new connection string, which will point to the database of the other project (the subdomain project).
    4. Go to Data - > Connection Strings -> Create New.
    5. The fields of the custom connection string should be filled the same way as the fields of the initial connection string (Sitefinity). The only difference will be the initial catalog property of the ConnectionString field. In it you should specify the name of the database, used by the other project.
    6. Go back to Providers and the newly created custom blogs provider. The last thing that has to be done is to add two parameters to the custom provider.
    7. The first parameter is applicationName and is completely identical to the applicationName parameter of the OpenAccessDataProvider.
    8. The second parameter is connectionString, where we specify the connection string, which will be used by our custom provider. That's how its properties should be filled out:
    Key: connectionString
    Value: NameofYourCustomConnectionString

    Greetings,
    Jen Peleva
    the Telerik team
    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 Public Issue Tracking system and vote to affect the priority of the items
  4. Shalaka
    Shalaka avatar
    50 posts
    Registered:
    24 Mar 2011
    31 Mar 2012
    Link to this post
    Sorry. But this is not as per my requirement.

    My requirement is - I need different metafileds as per news provider.
    Ex - I am having two providers - Pro1 and Pro2 .
    If i am adding news for Pro1 then i should able to fill following fields - Title , Summary
    If i am adding news for Pro2 then i should able to fill following fields - SearchName , Title.

    Now please tel me that how can i achieve my requirement in Sitefinity 4.4 ?



  5. Elizabeth
    Elizabeth avatar
    83 posts
    Registered:
    23 Mar 2005
    29 Mar 2013 in reply to Jen Peleva
    Link to this post
    This works, in that I can now see lists from the second provider. But when I go to put a list into a page, I don't see the lists from the other provider. How do I do that?
  6. Jen Peleva
    Jen Peleva avatar
    568 posts
    Registered:
    10 Nov 2016
    02 Apr 2013
    Link to this post
    Hello,

    First of all I want to clarify the main purpose of the provider model. The idea when creating separate providers is to separate data logically. However, this is vaid for data from one provider. Sharing information between two projects is is a possible, but not very reliable use of custom providers, since it raises a lot of question. Here are some of the drawbacks you must keep in mind. You can proj1 and Proj2 and you're pulling items from proj2 to proj1:

    • you can pull the items once, but this will not keep them synchronized;
    • when items are addedto proj2, they may not appear in proj1, because proj1 doesn't "know" about the change and because of the database caching of the proj2 database. Database caching should be disabled.
    • If you're making changes to the same item in both projects, the latest change will get applied (the latest transaction will be commited) and some database errors may be raised, because one of the projects will not know about the changes.
    This has not been tested, because, as I mentioned, the purpose of the provider model is not to share items between two working environments, but rather to create a logical division between the data in one project - for example create a separate environment for storing items from the same project.

    If you'd like to pull custom fields from another project, you should also keep in mind that this will not pull taxonomies - since taxonomies have unique ids in the database and if the custom fields are from type texfield you can try creating a field with the same name as the custom field in the project you're pulling items from. This will create a mapping between the custom provider and the database.

    Elizabeth, each contentView widget has a ProviderName property, exposed in the designer, where you can set the provider from whcih you'll be pulling items.

    Greetings,
    Jen Peleva
    the Telerik team
    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 Public Issue Tracking system and vote to affect the priority of the items
6 posts, 0 answered