I am using Umbraco 4.5.2 and .Net framework 3.5, I have a situtation in which i need to use a star rating component in my project.i have several memebers in my project and I need to create several datatypes for each member with the star rating control and need to give rating to each member and i need to displa them on the webpage.
Do you want a star rating dataype for use in the admin backend? Or just have a star rating functionality on the frontend? For the latter, you may find some interesting jquery implementations on the interweb.
Not saying this is the perfect solution but from i understand you are trying to do i came up with this solution , you will have to adjust to your needs but might give you a starting point ...i runnign in .net framework 4 and umbraco 4.7.1
First
I created VS project in which i created two usercontrols
Star rating Component
Hi,
I am using Umbraco 4.5.2 and .Net framework 3.5, I have a situtation in which i need to use a star rating component in my project.i have several memebers in my project and I need to create several datatypes for each member with the star rating control and need to give rating to each member and i need to displa them on the webpage.
Can anyone help me how can i acehive this.
Thanks
Bobby
Hi,
Do you want a star rating dataype for use in the admin backend? Or just have a star rating functionality on the frontend? For the latter, you may find some interesting jquery implementations on the interweb.
Cheers,
/Dirk
Hi drik,
I want to use a star rating datatype.
Thanks
Bobby
Hi Bobby
Not saying this is the perfect solution but from i understand you are trying to do i came up with this solution , you will have to adjust to your needs but might give you a starting point ...i runnign in .net framework 4 and umbraco 4.7.1
First
I created VS project in which i created two usercontrols
1. A simple dropdownlist control for rating 1-5
Ratingcontrol.ascx
<asp:DropDownList ID="dp_ratings" runat="server" >
<asp:ListItem Text="Please choose..." Value="0"></asp:ListItem>
<asp:ListItem Text="1" Value="1"></asp:ListItem>
<asp:ListItem Text="2" Value="2"></asp:ListItem>
<asp:ListItem Text="3" Value="3"></asp:ListItem>
<asp:ListItem Text="4" Value="4"></asp:ListItem>
<asp:ListItem Text="5" Value="5"></asp:ListItem>
</asp:DropDownList>
RatingControl.ascx.cs
using System;
using System.Web.UI.WebControls;
using umbraco.editorControls.userControlGrapper;
public partial class Ratings : System.Web.UI.UserControl, IUsercontrolDataEditor
{
public object value
{
get { return dp_ratings.SelectedValue; }
set { dp_ratings.SelectedValue = value.ToString(); }
}
}
2. A repeater control to list out Members and properties.
MemberList.ascx
Member List
<asp:Repeater ID="rp_membersList" runat="server">
<ItemTemplate>
<div class="border">
Member Name: <%# ((dynamic) Container.DataItem).LoginName %>
<br />
Rating:
<div class='rating-<%# ((dynamic) Container.DataItem).getProperty("rateMember").Value %>'>
<%# ((dynamic)Container.DataItem).getProperty("rateMember").Value%>
</div>
Rating 2:
<div class='rating-<%# ((dynamic) Container.DataItem).getProperty("nextRating").Value %>'>
<%# ((dynamic)Container.DataItem).getProperty("nextRating").Value%>
</div>
</div>
</ItemTemplate>
<HeaderTemplate><ul></HeaderTemplate>
<FooterTemplate></ul></FooterTemplate>
</asp:Repeater>
public partial class MembersList : System.Web.UI.UserControl
{
protected void Page_Load(object sender, EventArgs e)
{
var memberGroup = MemberGroup.GetByName("Rate Member");
rp_membersList.DataSource = memberGroup.GetMembers();
rp_membersList.DataBind();
}
}
Built and transfer relevant files.
Second
Created new DataType "Umbraco Usercontrol wrapper " selecting rating dropdownlist user control.
Created new Macro from Member listing usercontrol
Third
Created new Member Type and added new rating control control times to in my case generic tab.
Fourth
Created new members selecting new Member type and so allowing in to set variuos rating.
Lastly
Created new content form with Member list macro embedded to list out members and ratings.
Giving the following output
Hi Anothny,
Thanks for your solution, I will try this out.As i am using .Net 3.5 framework and Umbraco 4.5.2
Thanks
Bobby
your welcome let me know how you get on
Hi, Star Rating Property Editor can help.
is working on a reply...