Small width layout Medium width layout Maximum width layout Small text Medium text Large text
     Search
Downloads Downloads Directory Directory Forums Forums Forge Forge Blogs Blogs        Marketplace Marketplace Careers Program Careers
Community › Forums Register  |  

PortalWebHosting
  Ads  
Aspose - The .NET & Java component publisher
 


  Sponsors  

Meet Our Sponsors

R2integrated - formerly bi4ce
Jango Studios - Skins, Modules and Hosting for DotNetNuke
eUKhost.com is commited to offer exceptional UK Windows Web Hosting solutions with quality 24x7 technical support.Our plans support ASP.Net, ASP, ASP.NET Ajax extensions, XML, MSSQL, MySQL, PHP,DNN, multiple domains and Shared SSL as standard.
SmarterTools
The Official Microsoft ASP.NET Website
Portal Webhosting - Hosting For Developers
 


DotNetNuke Forums
 
  Forum  DotNetNuke® Pro...  Repository Modu...  Attributes Walk-Through
Previous Previous
 
Next Next
New Post 1/10/2007 8:27 AM
User is offline Mike Horton
3163 posts
dnn.gmss.org
4th Ranked






Attributes Walk-Through 

The question of how to get attributes to show up has come up quite often so below is a copy and paste of Steve's explanation to another user:

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 )

 
New Post 1/21/2007 10:40 PM
User is offline JHB
33 posts
10th Ranked


Re: Attributes Walk-Through 
Supposed to be like this? I can't seem to get it to work. From the code, it appears it's supposed to be able to parse it attribute by attribute. How would that work in the xml?

<Object>
        <Token>[ATTRIBUTES]</Token>
        <Settings>
            <Setting>
                <Name>CssClass</Name>
                <Value>normal</Value>
            </Setting>
            <Setting>
                <Name>Select</Name>
                <Value>SINGLE</Value>
            </Setting>
        </Settings>
    </Object>
 
Thanks,
jb
 
New Post 1/22/2007 10:12 AM
User is offline Mike Horton
3163 posts
dnn.gmss.org
4th Ranked






Re: Attributes Walk-Through 
I just stepped through the code and it looks like it might be a bug. The code is pulling its xml information from the header.xml so if you put what you posted into the header.xml file it'll work. Steve, could you verify that this is a bug and not by design?
 
New Post 1/22/2007 11:43 AM
User is offline Tim Workman
41 posts
10th Ranked


Re: Attributes Walk-Through 
Its a bug...

http://www.dotnetnuke.com/DotNetNukeProjects/ModuleRepository/Forums/tabid/905/forumid/54/threadid/95485/threadpage/2/scope/posts/Default.aspx
 
New Post 1/22/2007 12:14 PM
User is offline Mike Horton
3163 posts
dnn.gmss.org
4th Ranked






Re: Attributes Walk-Through 
Doh!!! Right from the same thread I copied and pasted from.
 
Previous Previous
 
Next Next
  Forum  DotNetNuke® Pro...  Repository Modu...  Attributes Walk-Through
 


Forum Policy

These Discussion Forums are dedicated to the discussion of the DotNetNuke Web Application Framework.

For the benefit of the community and to protect the integrity of the project, 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 DotNetNuke.
2. Discussion or promotion of DotNetNuke product releases under a different brand name are strictly prohibited.
3. No Flaming or Trolling.
4. No Profanity, Racism, or Prejudice.
5. Site Moderators have the final word on approving/removing a thread or post or comment.
6. English language posting only, please.

 


Adaptive InfoSystems, Inc.
We provide custom programming and various levels of support for DotNetNuke and the .Net framework.
www.aisysweb.com
Multipartner Virtual Data Rooms
The Virtual Data Rooms (VDR) provided by an expert advisor, far from any ordinary software company!, supporting the sellers and their consultants. Multipartner builds and services higly professional Virtual Data Rooms (VDR) specifically tailored to M&A, Real Estate and NPL deals.
www.multipartner.com
DNN SEO
Seablick Consulting specializes in DNN search engine optimization (SEO), DNN consulting, as well as support & training.
seablick.com

DotNetNuke Corporation   Terms Of Use  Privacy Statement
DotNetNuke®, DNN®, and the DotNetNuke logo are trademarks of DotNetNuke Corporation
Hosted by MaximumASP