I am making a mailing list program that a user is able to build logic sets to include contacts that meet the criteria. Similar to how HubSpot creates mailing lists if you have ever used them. For example:
When criteria are added, the list gets refreshed via a backend job to come up with WHO is in the list. These are saved to the DB as a relationship table for quick reference by the application later Eg (List_ID & Subscriber_ID columns.
The issue I am running into is how to handle when a List includes logic that says Include Subscribers from another list. For example if List A logic says Include users from Maryland. And List B says Include all members from List A. When you make a change to List A to also include Florida for example, List B should then also be updated, because it is a dependent of A. Keep in mind there could also be other logic on either list as well. Or logic pointing to other lists that also include other lists as well!
So then you could also have situations where lists are pointing at eachother and run into some type of circular or recursion situation.
Any ideas on the best way to handle this? I would also thing the ORDER that you have to update the list and dependent lists is of importance as well.
Related
I have a Django app with two models linked by a many-to-many relationship.
Service, problem_type.
A service provides assistance for a number of problem types. I use the problem_type table to later facilitate lookups of all services that help for a specific problem type.
I update my model from an external API. I take in a list of "problem_types" for each service, eg:
['housing', 'financial aid' ... etc]
Over time, a service might get new problem_types or remove old ones. Is there a best practice for managing this?
Adding new problem_types relationships or new problem_types is ok, I just loop through the incoming list of problem types and add any new ones to the problem_type relationship/table, but what is the best way to remove now redundant ones?
Is it best to:
Loop through associated problem types and delete each not in the new incoming list?
Get all associated problem types and delete every relationship before re-adding the incoming list
Is there some built-in method for doing this that I have not been able to find?
In an ideal world love to be able to pass the incoming list of new problem_types with the current set of related problem_types to a method and add/remove as needed. Does something like this exist or do I have to implement it?
I am creating a Sitecore MVC site for a client and I need to create page that will list news articles for the company.
So far, I have created items that use a shared data template called “Article,” and I also have a sublayout (a view rendering) called “Article” that will display these items.
For the list itself, my plan was to create another component (a sublayout) call “News_List”, and to put a placeholder in it called “List”.
My question is this: can I allow the author to insert articles (e.g., N items of type “Article”) into this placeholder via the page editor?
Will SC allow you to insert multiple instances of the same component into a placeholder? Will this break anything?
I believe this is a pretty common question but I have not found a definitive answer. Thanks in advance…!
You can insert as many components (of the same type) in your placeholder as you want.. Just make sure to put the placeholder settings correctly and give it a decent name (not just "list" ;))
But are you sure you want to do this? Your editors will manually need to create a list of components for each article they want to add on the page. Doesn't sound to be very user (editor) friendly.. Maybe you should consider creating a list component that can get a list of articles as a datasource and show those. Or even select them automatically (but that might be not according to your business case)..
Yes, authors can add multiple instances of the same component into a single placeholder.
Assuming that the code of the component doesn't do any stupid things it's absolutely ok to do this.
need to know how to get SharePoint List specific View among my Custom List Views or to modify a SharePoint List Schema... I explain :
Before i start i need to tell you that my need here is to have a list exactly like Discussion Board List just i need to modify its New/Edit forms. So i have 2 important creterias that i need to have :
1/Ii need to be able to acess the schema.xml file to add my custom New/edit forms to the list
2/ Or i need to be able to get the default View of Discussion Board List (the one with reply button and like etc...)
So, here are my Problems:
If i create a custom list (from Visual Studio) and i make it based on Discussion Content Type, Condition 1 is satisfied e.g. i can have a schema.xml File in where i can modify to put my Custom Edit/New forms BUT my list is being displayed not the way i want to (like described in Point 2) it is diplayed in rows and columns (no reply button etc...)
If i create a custom list (from Visual Studio again) based on Discussion Board list template, it is displayed (its Default View) just like i want to (as described in point 2) but in Visual Studio i only have a list instance, i don't have access to its Schema.xml where i can put links to my custom New/Edit forms.
I tried too many things; I tried to provision the Views programmatically just like in this : Thread but none helped me.
The last thing i tried is to take the desired view from SharePoint Discussion Lists (found its schema.xml in 15 hive) and i tried to integrate in my custom List, but i No relevant results...
So, in summary i need either to be able to import View from List to List or to be able to modify Schema.xml of SharePoint Lists that are based on specific list template (in my case Discussion Board template)
Any help will be welcome
Let's say there exists a presentational component in a project that renders an unordered list (called ListRenderer, perhaps.) We have a couple options of supplying data to any given ListRenderer on a page:
Have a TreeList (or TreeListEx) field on the content item, and have ListRenderer read from it.
Supply a DataSource (or other Parameter) to the ListRenderer via the presentation details.
I usually avoid #1 in my projects because it binds Sublayouts to templates, which gets quite messy. If you go down that path, eventually you'll have fields to support every potential sublayout in your project.
So my solutions tend toward option #2, which gets rid of that problem. It does, however, come with its own bag of questions. Where do I put these various "Lists" for a given ListRenderer to use? To maximize reuse and sharing, I usually create a components directory near the site root that contains all these types of things, if I predict the Lists will be shared. This seems less findable and harder to use for the content author, who suddenly have no idea where the source for their ListRenderer is unless they know how to crack open the presentation details (which is slightly advanced for my average user).
If I feel like Lists won't be shared, and are very specific to the page, I'll put them directly underneath the item in question. This has a tendency to muddle up the content tree, though, and any dynamically generated navigation sublayout then has to check for whether or not an item is an actual page before it generates the link to it. The more I work in Sitecore, the less I use this approach, but it seems easier for the content author. There is much easier access to information when you use this approach.
Is there any industry-accepted way of approaching this problem? It happens in projects all the time, and in my head I struggle to balance technical and content authorship concerns in situations like these.
Great question. I've used all the techniques you mentioned, depending on the audience and specifics of the project. The problem is that, as with all things Sitecore, they are all valid ways of achieving the same goal and you will struggle to find one answer that will work in every situation.
I almost always use #2 as well, but some content author retraining maybe necessary and make sure you add in restrictions to what the content author is able to select as a target. I have (within the same project) structured the items near the root (in a shared content folder) and under the item in question, depending on what I felt would provide the best context.
Also, if other child pages would exist below the item as well as the list items, then I would put the list items in a separate folder (with a common "list items" icon") and re-order it to be the first item for separation and clarity.
If you want to use any kind of personalization and DMS then you will need the ability to switch out the datasource anyway so you shouldn't hard code locations.
You might also (if you have not already) want to consider using:
Convert Data Source Paths to IDs Using the Sitecore ASP.NET CMS
- Useful if you need to restructure your content at a later date
Queryable Datasource Locations
- Useful for multi-site situations when you need to make clones, or setting as the default datasource value in Standard Values when the lists are directly below the item but gives you the flexibility to change it.
I prefer using querable datasources personally, I find the xpath syntax more logical.
As Mark has commented, there is no real industry standard.
I feel like this is something that needs improvement.
Especially when you are using the DataSource option, things become less transparent to the editors and as the size of the site grows, so does the complexity.
All I can tell you is how I would do it, which is most likely much like how you are doing it.
1) For overview pages like news, events and faq items, I will put the items underneath the overview item and use the NewsMover shared source module to auto-create a hierarchy.
2) I will create a Global site that contains items that are shared across sites or pages. DataSource items for components will be put in here.
3) For components that are present on the standard values, I will add a list field to the template (for example, when you display related items on a content page)
Most often it's a logical choice and sometimes it's just a matter of taste.
I'd like to add that I've written a blog post on how to have datasource items created automatically for components that are set on standard values. That might help you if you are using those.
Edit:
"I usually avoid #1 in my projects because it binds Sublayouts to templates, which gets quite messy. If you go down that path, eventually you'll have fields to support every potential sublayout in your project."
Today I've blogged about a method of hiding fields and sections in the content editor if there is no sublayout set on the item that requires those fields, which helps to prevent the mess of having a lot of unused fields on your items.
I'm working on a web application using Apache Wicket and I have three types of page that are basically a numbered list. The difference between each is how the items in the list are displayed. (i.e. one has a header line and a paragraph, another just has the paragraph). Eventually, the data will come from a database, but that is not available at the moment.
I think I can do this by creating a Page that displays a RepeatingView that gets its items from an ArrayList of Panels. I would create a different Panel for each type of list item. Then I could extend the aforementioned Page to three subclasses, one for each specific type of Panels I want. Am I on the right track, or is there a better way to do this?
I find RepeatingView to be very flexible with this sort of thing and you shouldn't require three separate pages. It only expects a component to be added to the repeater, not what kind of component. As long as you keep your Wicket IDs consistent, you can even mix components that come with their own markup (e.g. Panel/Fragment).
I also discourage you from using a List of Panels. It just makes good programming sense for the list to contain your data and then add the appropriate view container based on some flag.
So, markup like this:
<div wicket:id="repeater">
<div wicket:id="listItem" />
</div>
Works with something like:
RepeatingView rv = new RepeatingView("repeater");
for (DataObject o : dataList) {
// You can probably add to the rv directly, but this is the common usage
WebMarkupContainer c = new WebMarkupContainer(rv.newChildId());
rv.add(c);
if (shortVersion)
c.add(new ShortPanel("listItem", new Model<DataObject>(o)));
else
c.add(new LongPanel("listItem", new Model<DataObject>(o)));
}
Instead of providing a List of Panels to your page, you provide the same list of Data from the database and then add different panels based on the current view.
In the end, you have one page (with a flag for view type) and different panels (or fragments) for how your data should look according to each view type.
I don't think you'll have to subclass your Page. As far as I can see, this one doesn't change at all. All the changes are within the panels. So basically all you need to do is to provide your repeating-view with different lists of panels. You wouldn't even need to create different classes for these if the differences are as small as presenting a headline or not. Just set the headline to an empty string and set it to invisible...
Basically yes, you're on one of the right tracks, maybe not the one I'd choose but yours will work too...