Skip to content

Commit ebbeeff

Browse files
committed
Introduced a new IsIndexed property
The `IsIndexed` property allows a view to implement e.g. a table of contents for either the categories or the items on the page, while giving the editor control over whether or not that option is enabled. Not all implementors will expose this option in the editor, and it's up to the view designer to determine how it will be implemented in the markup. Nevertheless, it's a common enough feature that having it built-in to the view model offers a lot of flexibility.
1 parent b303f13 commit ebbeeff

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

OnTopic.ViewModels/ContentListTopicViewModel.cs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,22 @@ public class ContentListTopicViewModel: PageTopicViewModel {
3636
/// </summary>
3737
public TopicViewModelCollection<TopicViewModel> Categories { get; } = new();
3838

39+
/*==========================================================================================================================
40+
| IS INDEXED?
41+
\-------------------------------------------------------------------------------------------------------------------------*/
42+
/// <summary>
43+
/// Provides a flag determining whether or not the content list should be indexed.
44+
/// </summary>
45+
/// <remarks>
46+
/// The <see cref="IsIndexed"/> property, if set, requests that the view provides a list of <see cref="ContentItems"/> or
47+
/// <see cref="Categories"/> at the top, with links to each one. This is entirely up to the discretion of the view as to
48+
/// how to implement—or even whether it's appropriate. For instance, it might not make sense on views rendering as an
49+
/// accordion or a searchable list. Nevertheless, it's a common enough feature that having it exposed as a first-party
50+
/// option helps implementors account for common scenarios. As with other properties, it won't be set if there isn't a
51+
/// corresponding attribute, and so this can easily be hidden or disabled globally via the editor.
52+
/// </remarks>
53+
/// <returns>True if the content list should be indexed; false otherwise.</returns>
54+
public bool IsIndexed { get; set; }
55+
3956
} //Class
4057
} //Namespace

0 commit comments

Comments
 (0)