Dave Burke : Freelance .NET Web Developer specializing in Online Communities

CS Queensryche Calendar Blog: Controlling Tag Selection

It's been a while since we calendar blogged, but I wanted to post about another Queensryche aspect of the shared Calendar Blog on a Community Server site I'm building.  We talked about displaying the Calendar Blog post on multiple dates and the aspects involved in sharing a blog among numerous authors in previous tracks.  Tonight a feature of the Calendar Blog that might be of interest beyond the calendar: controlling tag creation to a master list of tags to maintain Taxonomy integrity.

Pictorially speaking we want to prevent the creation of new tags, which on our custom CreateEditPost control is performed by removing the input box...



and providing users instead with the option of selecting appropriate tags that already exist...

 

 

that were created by an administrator on the Tags/Keywords page...

 

 

and displayed to the user on the popup tag selection modal window.

 




As for the head-banging fun, our custom CreateEditCalendarPost control contains a TagEditor control, our TagCalendarEditor.

 

<cp:TagCalendarEditor runat="server" id="Tags">
    <SkinTemplate>
    <table cellpadding="0" cellspacing="0" border="0">
    <tr valign="top">
    <td>
        <input type="hidden" ID="Tags" runat="server" />
    </td>
    <td>
        <CP:Modal modaltype="Button" width="400" height="300"
          runat="Server" id="SelectTags" ResourceName="TagEditor_SelectTags" />
    </td>
    </tr>
    </table>
    </SkinTemplate>
</cp:TagCalendarEditor>

 

The Tag[Calendar]Editor's Community Server IModalButton "SelectTags" URL is

SiteUrls.Instance().TagSelectorModal(Globals.UrlEncode(this.ClientID));


Or \themes\[theme]\utility\selecttags.aspx, which uses the CS.Controls.SelectTagForm CS Form.  Here the beauty of Community Server's deployment of client-side javascript comes into play, as SelectTagForm.cs client-registers SelectTagForm.js, located with SelectTagForm.cs in CS.Controls\Forms.  Because the modal window checkboxlist in SelectTagForm.js interacts with the HTML input item by name


var inputs = document.getElementsByTagName('input');


...we need an input control.  No other control will do, not a label (in HTML rendering as a span tag), nor readonly or hidden versions of the original ASP:TextBox.

To restrict tag selection to a pre-determined list--that is, remove the original Textbox and still have full modal window functionality--I changed the ASP:TextBox to an HTML input item of type hidden as shown above in bold, and referenced it accordingly in TagCalendarEditor.

 

A thousand cries are heard, they echo in the wind
And still the rider will unleash his chosen sin
The victims of his rage are soldiers of his mind
His scream will heed the call of those who stand behind

The nightrider sails away
The nightrider sails yeah

[Queensryche]

Comments (2) | Post RSS RSS comment feed

Posted on 8/6/2007 8:26:55 PM by Dave Burke
Categories: .NET | Community Server
Tags:

Related posts

Comments (2) -

8/13/2007 9:46:37 AM Permalink

Nice!  

I had to restrict tag selection for gallery submissions and so I had used a CheckBoxList.  This would have been much simpler and easier.

One minor thing, ideally it would be nice to see what the current tags are w/o having to click the button each time.  What do you think about adding a label (or something) that displays the contents of the hidden input.  Then add an onChange to the hidden that updates the label with the new tags.  Maybe the onChange doesn't work on a hidden input, but I think you get the idea.

David Voss |

8/13/2007 9:53:21 AM Permalink

Hi, David!  I don't have a problem with requiring a button click to view existing tags in a popup.  I had thought about displaying existing tags in a label when editing a post, but since they are checked in the popup I'm not worrying about it. Smile  Good to hear from you, as always!

daveburke |


Powered by BlogEngine.NET 2.0.0.36
Theme by Dave Burke