News Providers with different fields

Posted by Community Admin on 04-Aug-2018 07:21

News Providers with different fields

All Replies

Posted by Community Admin on 21-Mar-2012 00:00

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.

Posted by Community Admin on 27-Mar-2012 00:00

any solution ?

Posted by Community Admin on 29-Mar-2012 00:00

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

Posted by Community Admin on 31-Mar-2012 00:00

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 ?



Posted by Community Admin on 29-Mar-2013 00:00

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?

Posted by Community Admin on 02-Apr-2013 00:00

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

This thread is closed