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

Notification

Icon
Error

Gallery for news items
JamesStuddart
#1 Posted : Tuesday, January 31, 2012 9:36:39 AM(UTC)
Rank: Newbie
Groups: Registered

Joined: 1/20/2012(UTC)
Posts: 7
Location: UK
Hi all,

I am currently developing a site using Kooboo, and I have to say its spot on! great flexibility.

I created a new section in the site based on the one shown in the 'sample site' and it works great.
I have created galleries which I can add to pages too. The problem is this is that adding a gallery to a page requires some technical knowledge and the guy I am making the site for doesnt have any technical ability when it come to computers.

What I want to achieve it the ability to create a new gallery and attach it to a new article.

My news items and Galleries are both content types, is there a way for me to define in the News Content type a drop down which display which Gallery to use?

many thanks
NjayWu
#2 Posted : Tuesday, January 31, 2012 2:28:00 PM(UTC)
Rank: Advanced Member
Groups: Registered

Joined: 3/14/2011(UTC)
Posts: 34
Location: XM
Maybe you can define a field in the News Content type. The field's control type must be dropdownlist and then you can click the last tab to select the gallery's folder.
Regards,

NJ Wu

Kooboo3 Fans

http://www.qiyeqiye.com
JamesStuddart
#3 Posted : Tuesday, January 31, 2012 6:22:09 PM(UTC)
Rank: Newbie
Groups: Registered

Joined: 1/20/2012(UTC)
Posts: 7
Location: UK
This is what I want to do, any help on how I so this.
JamesStuddart
#4 Posted : Wednesday, February 01, 2012 11:12:54 AM(UTC)
Rank: Newbie
Groups: Registered

Joined: 1/20/2012(UTC)
Posts: 7
Location: UK
I have just re-read your post and understand what you meant now.

I have done this, and under the folder I have created another folder, these folders are of the type Gallery, but they do not show in the dropdownlist :(
If I select the gallery folder and not the new galleries parent folder I have the choice of choosing a picture
NjayWu
#5 Posted : Wednesday, February 01, 2012 2:35:49 PM(UTC)
Rank: Advanced Member
Groups: Registered

Joined: 3/14/2011(UTC)
Posts: 34
Location: XM
Yes, the control type "dropdownlist"'s items can be only from one single folder. If you just want select images to attach each article, you can use the controltype called "MultiFiles" instead of "dropdownlist". With the control, you can select pictures from MediaLibarary and also you can upload a new image.
Regards,

NJ Wu

Kooboo3 Fans

http://www.qiyeqiye.com
JamesStuddart
#6 Posted : Thursday, February 02, 2012 9:23:16 AM(UTC)
Rank: Newbie
Groups: Registered

Joined: 1/20/2012(UTC)
Posts: 7
Location: UK
Thanks again,

I managed to achieve what I needed in a bit of a hacky way, but it works nicely.
I added a textbox that the user can enter the name of the NewsGallery s/he wishes to have attached to the News article.

I then use the following code to produce the image gallery (I have dumbed this down a little for the example)

Code:
@if(!String.IsNullOrEmpty(ViewBag.News.NewsGallery))
{
    String folderName = "newsgalleries/" + ViewBag.News.NewsGallery.ToString();

    @foreach(dynamic item in ContentHelper.TextFolder(folderName).CreateQuery())
    { 
         <img src="@item.Image" />
    } 
}


As you can see I have put the directory name in to a string first, because putting it directly in the statement causes the code to bomb out and proclaim CreateQuery() is not a method on TextFolder.

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.111 seconds.