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

HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...Select images in moduleSelect images in module
Previous
 
Next
New Post
7/14/2006 7:25 AM
 
This may be a common request but I couldn't find anything in a search.

I'm creating a custom module to manage case studies and want to provide  ability to 'attach' one or more images (including alt and title text)  to a case study. This will be outside of any HTML text.

Is there support in the core for doing this? The functionality I need is much like that of the media module but with the ability to add multiple images, each with their own alt text and, obviously, included within the editing interface of my own module.

Thanks,

    Rob.

 
New Post
7/14/2006 8:36 AM
 
I did something similar for a combination of a html/image box w/ the images in standard placement.  Its not that hard.  Use the ASP.NET image control for the image, the dnn URL control like this.

<dnn:URL id="urlImage" runat="server" width="225" shownone="true" showtabs="False" showfiles="True" showUrls="True" urltype="F" showlog="False" shownewwindow="False" showtrack="False" />

You will have to do something like this for the loading of the image.  There maybe a better way but I dunno how yet.

If ImageValFromDB.StartsWith("FileID=") Then
Dim _FileCont As New DotNetNuke.Services.FileSystem.FileController
Dim _FileInfo As DotNetNuke.Services.FileSystem.FileInfo
Dim _Id As Integer = CInt(Strings.Replace(ImageValFromDB, "FileID=", ""))
_FileInfo = _FileCont.GetFileById(_Id, Me.PortalId)
imgImage.ImageUrl = DotNetNuke.Common.ResolveUrl(Me.PortalSettings.HomeDirectory & _FileInfo.Folder & _FileInfo.FileName)
Else
imgImage.ImageUrl = ImageValFromDB
End If

If ImageValFromDB is empty, just set the visibility to false of the image control.  Hope this helps.

 
New Post
7/14/2006 9:00 AM
 
Thanks for that info but if I understand correctly your example is for displaying the image from the database in the View control.  I'd like to know if there is standard code for selecting images that have been previously uploaded using the File manager that I can use in my Edit control.

Examples I have seen such as the media module and advanced announcements module have very similar looking code and I wondered if there were standard components available to do this.

I guess my next step is to download the source for the media module and see how it is done there.

Thanks,

Rob.


 
New Post
7/14/2006 9:41 AM
 

Well no.  As i see it dnn stores the file id in the db for images that are from the url control.  Thats what the if is checking for in the main part.  It checks to see if its a reference with an id number and looks up the real path.  Hopefully that clears this up.

 
New Post
7/14/2006 9:43 AM
 

> I guess my next step is to download the source for the media module and see how it is done there.

thats always a good start ;)


Erik van Ballegoij, Former DNN Corp. Employee and DNN Expert

DNN Blog | Twitter: @erikvb | LinkedIn: Erik van Ballegoij on LinkedIn

 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...Select images in moduleSelect images in module


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