Skip to content

Static Tags List #60

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Feb 2, 2022
Merged

Static Tags List #60

merged 11 commits into from
Feb 2, 2022

Conversation

epdubi
Copy link
Contributor

@epdubi epdubi commented Feb 5, 2021

Description

Allow for using a static tags list when creating articles. This will avoid end-users (article admins) from creating unwanted/duplicated tags.

Change Log

  • Create Use Static Tags List ArticleSetting and Tag Settings section in Main Options
  • Toggle between asp:TextBox and asp:ListBox in ucSubmitNews.ascx

Screenshots

AdminOptions - Tag Settings Section

AdminOptions-TagSettingsSection

SubmitNews - Tags ListBoxes (UseStaticTagsList setting enabled)

SubmitNews-TagsListBoxes

SubmitNews - Tags TextBox (UseStaticTagsList setting disabled)

SubmitNews-TagsTextBox

Copy link

@bdukes bdukes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few small cleanup items, but looks good otherwise. Can you add some example screenshots of what changes this PR introduces?

Comment on lines 116 to 117
Public Const USE_STATIC_TAGS_LIST_SUBMIT_SETTING As String = "UseStaticTagsList"
Public Const USE_STATIC_TAGS_LIST_SUBMIT_SETTING_DEFAULT As Boolean = False

This comment was marked as duplicate.

Comment on lines 247 to 252
Public ReadOnly Property UseStaticTagsListSubmit() As Boolean
Get
If (Settings.Contains(ArticleConstants.USE_STATIC_TAGS_LIST_SUBMIT_SETTING)) Then
Return Convert.ToBoolean(Settings(ArticleConstants.USE_STATIC_TAGS_LIST_SUBMIT_SETTING).ToString())
Else
Return ArticleConstants.USE_STATIC_TAGS_LIST_SUBMIT_SETTING_DEFAULT

This comment was marked as resolved.


Private Sub SelectTags(ByVal tagList As String)
Dim objTagController As New TagController
For Each tag As String In tagList.Split(","c)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to check for the case when tagList is Nothing, or does it always come across as an empty string if it's not set?

Also, consider using the Split overload that takes a StringSplitOptions to avoid having to handle empty tags.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, ArticleInfo.Tags is sourced from dbo.Ventrian_NewsArticles_SplitTags(@ArticleID int) which will always default to an empty string.

And good call 👍

If (tag <> "") Then
Dim objTag As TagInfo = objTagController.Get(ModuleId, tag)

If Not (objTag Is Nothing) Then

This comment was marked as resolved.


If Not (objTag Is Nothing) Then
Dim li As ListItem = lstTags.Items.FindByValue(objTag.Name)
If Not (li Is Nothing) Then

This comment was marked as resolved.


objTagController.Add(articleID, objTag.TagID)
If Not (objTag Is Nothing) Then

This comment was marked as resolved.

<table id="tblTags" cellspacing="2" cellpadding="2" summary="Appearance Design Table"
border="0" runat="server">
<tr>
<td class="SubHead" width="200"><dnn:label id="Label12" runat="server" resourcekey="UseStaticTagsList" controlname="chkUseStaticTagsList"></dnn:label></td>

This comment was marked as resolved.

Comment on lines +1140 to +1142
<data name="UseStaticTagsList.Text" xml:space="preserve">
<value>Use Static Tags List</value>
</data>

This comment was marked as resolved.

@Timo-Breumelhof
Copy link
Collaborator

A few small cleanup items, but looks good otherwise. Can you add some example screenshots of what changes this PR introduces?

Yes, some screen prints would be nice.

@epdubi
Copy link
Contributor Author

epdubi commented Feb 8, 2021

Screenshots are added above and feedback addressed. Thank you both!

Copy link

@bdukes bdukes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@skamphuis skamphuis merged commit 2cf6c8d into ventrian:master Feb 2, 2022
skamphuis pushed a commit to 40fingers/News-Articles that referenced this pull request Feb 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants