Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsRepositoryRepositorySuggest A Link Template?Suggest A Link Template?
Previous
 
Next
New Post
1/4/2007 5:07 PM
 

1. there is currently no way to display the Categories as a drop down instead of checkboxes without making code changes.

2. Yeah, don't feel bad .. Attributes take a once-through to get used to .. but then it's usually pretty clear.

Adding/using a custom Attribute:
a. On the Repository Settings page . create your custom attribute ( for example Color .. please note that Attributes are case-sensitive .. I know, bad programming ;) )
b. Select your new Attribute and enter one or more valid values ( for example:  Red, White, Blue, etc)
c. Save your Repository settings.

So, at this point you've defined yoru custom attribute and given it a name and some valid values. Now, there are 3 things you have to do with regards to template

-. edit the form.html/form.xml files ( the upload form ) to allow users to select from the list of valid values when they upload/edit an item
-. edit the template.html/template.xml files ( the list display ) to display the selected attribute values ( if desired )
-. edit the header.html/header.xml files ( the list header ) to allow users to 'filter' the list based on attribute values ( in this example, so that they can only show items where the Color is Red )

So, let's walk through each one
d. open form.html. Verify that there is a tag named [ATTRIBUTES] in the form.html file. If not, add it where you would like the Attrbitues to be displayed. NOTE: At runtime, this tag will be replaced with a set of either checkboxes or radiobuttons ( depending on a form.xml setting we'll talk about in a minute ) for EACH custom attribute.If you defined 2 custom attributes, you don't need 2 [ATTRIBUTES] tags and you can't only display one set of attributes. The [ATTRIBUTES] tag displays selection controls for ALL of the custom attributes for this particular repository.  Decide if you want to allow people to select only one of the valid values ( radiobuttons ) or more than one ( checkboxes ). In the form.xml file, add an Object->Token named ATTRIBUTES and a Setting named Select. Set it to SINGLE for radiobuttons, or MULTIPLE for checkboxes.

This will now display your custom attributes on the upload/edit form and allow the user to select from the list of valid values.

e. edit the template.html/template.xml files. Here you can specify individual attributes if you have more than one. So, in your template.html file, decide where you want to display the selected values and add a tag like this .. [ATTRIBUTE:Color]. Again, make sure the attribute name, in this case Color matches the attribute ( case -sensitive ) that you created on the Setttings page. When rendered, the selected values will be displayed as a comma delimited list. ( for example: Red,White

f. final step. edit the header.html/header.xml files.If you want to allow the user to filter the list by a valid value for a custom attribute, add a tag like this to the header.html file.. [ATTRIBUTE:Color]. Again, case-sensitive. At render time, this will display a drop down list of all the valid values and if the user seelctes one, the list will only show those items where that value is selected. If you have multiple custom attributes, the drop downs are cumulative so if you had Color and Model as custom attributes, you could have 2 drop downs and by selecting values in each one, filter the list to only show Red (color)  Fords (model )

I hope that makes it a little clearer. Let me know if you have any problems or further questions.

 
New Post
1/4/2007 9:14 PM
 
Thanks Steve this worked perfectly.

Do you use Oracle?  Then try GoldFish.Net

Get it from CNET Download.com! 

 
New Post
1/5/2007 12:35 PM
 

I'm adding [ATTRIBUTES] to the FileList Template and trying to use the Select MULTIPLE/SINGLE function to force Radio Buttons in Form.html.  When I added the 'Select' settings to Form.xml, the Attributes remained as Checkboxes.   For reasons I don't understand, adding the 'Select' settings to Header.xml caused the checkboxes in Form.html to change to the desired Radio Buttons.  However, the following error occurs during an Upload...

Method: DotNetNuke.Modules.Repository.Form.btnUpload_Click
StackTrace:
Message: DotNetNuke.Services.Exceptions.PageLoadException: Unable to cast object of type 'System.Web.UI.WebControls.RadioButtonList' to type 'System.Web.UI.WebControls.CheckBoxList'. ---> System.InvalidCastException: Unable to cast object of type 'System.Web.UI.WebControls.RadioButtonList' to type 'System.Web.UI.WebControls.CheckBoxList'. at DotNetNuke.Modules.Repository.Form.btnUpload_Click(Object sender, EventArgs e) at System.Web.UI.WebControls.Button.OnClick(EventArgs e) at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) at System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) --- End of inner exception stack trace ---

I have also been unsuccessful forcing [CATEGORIES] to display as Radio Buttons in my Form.html adding the settings to any of the *.xml files.  I can work around this but I do need to get the Upload error resolved.  Any takers?

 
New Post
1/5/2007 12:54 PM
 

Not sure why changes made to header.xml would affect the upload form, they're two entirely different controls....

In the header, categories and attributes can ONLY be displayed as dropdown lists.

In the form.xml file the following xml snippet should cause the attributes to be displayed as radio buttons. PLEASE NOTE: most of these settings are, unfortunately, case-sensitive.

 <Object>
  <Token>[ATTRIBUTES]</Token>
  <Settings>
   <Setting>
    <Name>Select</Name>
    <Value>SINGLE</Value>
   </Setting>
  </Settings>
 </Object>

 [CATEGORIES] controls the selection of categories within the input form... again, SINGLE will render radio buttons, and MULTIPLE will render checkboxes

 <Object>
  <Token>[CATEGORIES]</Token>
  <Settings>
   <Setting>
    <Name>Select</Name>
    <Value>SINGLE</Value>
   </Setting>
  </Settings>
 </Object>

So, make sure SINGLE and MULTIPLE are upper case and Select is mixed-case

 
New Post
1/5/2007 1:03 PM
 

My apologies .. I just looked at the code, and there are some bugs in the form.ascx.vb file that are causing you these issues.

When determining the settings for categories and attributes, form.ascx.vb is looking at the wrong .xml file ( it's looking at header.xml instead of form.xml ). So that explains why changing header.xml is affecting your input form.

Secondly, when you click on the UPLOAD button, the code does not correctly determine whether or not the category and attribute settings are for single or multiple selection. It always assumes that they are checkboxes which is why you're getting the error on upload.

Source code changes would be required to fix these issues:

These fixes will be in the next release, however I'll post the changes here in this thread later today in case you wish to make the changes yourself in the meantime.

Sorry for the inconvenience

 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsRepositoryRepositorySuggest A Link Template?Suggest A Link Template?


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out