Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Conten type
hanoivatoi_1985
#1 Posted : Sunday, July 31, 2011 11:19:12 AM(UTC)
Rank: Advanced Member
Groups: Registered

Joined: 3/19/2011(UTC)
Posts: 123
Location: Mercedes C200
Content type -> Product -> Create Field: Province DropDownList style - >






The list of provinces in the product list:

<ul class="list">
@foreach (var item in ViewBag.List){
<li @ViewHelper.Edit(item)>
@item.Province
</li>
}
</ul>

I want to display automatically when not used if:
Item.provinces = 1 -> China
Item.provinces = 3 -> France
Item.provinces = 4 -> Singapore

jifeng
#2 Posted : Monday, August 01, 2011 3:16:37 AM(UTC)
Rank: Administration
Groups: Administrators, Registered

Joined: 9/3/2009(UTC)
Posts: 1,552
Location: Xiamen China
I am not very clear of your question.
Regards,

Jifeng Huang

Kooboo Team

Microsoft ASP.NET MVP
hanoivatoi_1985
#3 Posted : Monday, August 01, 2011 4:02:30 AM(UTC)
Rank: Advanced Member
Groups: Registered

Joined: 3/19/2011(UTC)
Posts: 123
Location: Mercedes C200
I want to show the value of the Text and Value in DropDownList.

Item.provinces = Value (Dropdownlist)

? = Text (Dropdownlist)
jifeng
#4 Posted : Monday, August 01, 2011 5:42:48 AM(UTC)
Rank: Administration
Groups: Administrators, Registered

Joined: 9/3/2009(UTC)
Posts: 1,552
Location: Xiamen China
HI

There is a property of "SelectionItems" in column. Get the column object like:

Code:


@using Kooboo.CMS.Content.Models;
@{
    var schema = Kooboo.CMS.Content.Services.ServiceFactory.SchemaManager.Get(Repository.Current, "News");
    var column = schema.Columns.Where(it => it.Name == "Province").First();    
 }

Regards,

Jifeng Huang

Kooboo Team

Microsoft ASP.NET MVP
hanoivatoi_1985
#5 Posted : Monday, August 01, 2011 6:43:52 AM(UTC)
Rank: Advanced Member
Groups: Registered

Joined: 3/19/2011(UTC)
Posts: 123
Location: Mercedes C200
@foreach (var item in ViewBag.Articles){
<div class="block" @ViewHelper.Edit(item)>
@item.Province
<h4 class="title"><a href='@Url.FrontUrl().PageUrl("Articles/detail", new { UserKey = item.UserKey})'@ViewHelper.Edit(item,"Title") >@item.Title</a></h4>
<span class="date">@ViewHelper.DateTimeToString(item.UtcCreationDate,"yyyy-MM-dd")</span>
<p @ViewHelper.Edit(item,"Summary")>@Html.Raw(item.Summary)</p>
<a class="comment" href="@Url.FrontUrl().PageUrl("Articles/detail", new { UserKey = item.UserKey})#comments">@(((Kooboo.CMS.Content.Models.TextContent)item).Children("Comment").Count()) Comments</a>
</div>
}




I want instead of 1, 2 as the corresponding picture is China, Spain (Text of the DropDownList, not the value of the DropDownList) ?
jifeng
#6 Posted : Monday, August 01, 2011 7:14:15 AM(UTC)
Rank: Administration
Groups: Administrators, Registered

Joined: 9/3/2009(UTC)
Posts: 1,552
Location: Xiamen China
Quick solution, let the value equals text.
Regards,

Jifeng Huang

Kooboo Team

Microsoft ASP.NET MVP
hanoivatoi_1985
#7 Posted : Monday, August 01, 2011 7:34:42 AM(UTC)
Rank: Advanced Member
Groups: Registered

Joined: 3/19/2011(UTC)
Posts: 123
Location: Mercedes C200
I want instead of 1, 2 as the corresponding picture is China, Spain (Text of the DropDownList, not the value of the DropDownList) ?
jifeng
#8 Posted : Tuesday, August 02, 2011 4:11:36 AM(UTC)
Rank: Administration
Groups: Administrators, Registered

Joined: 9/3/2009(UTC)
Posts: 1,552
Location: Xiamen China

two options:

1. Set the value as same as the text. e.g: Text:China, Value:China.

2. Change the picture name as the number value: e.g: 1.jpg, 2.jpg.
Regards,

Jifeng Huang

Kooboo Team

Microsoft ASP.NET MVP
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF 1.9.5.5 | YAF © 2003-2011, Yet Another Forum.NET
This page was generated in 0.090 seconds.