Custom Module Setting File Browser

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

Please do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.

This forum is for discussing mojoPortal development

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

You can monitor commits to the repository from this page. We also recommend developers to subscribe to email notifications in the developer forum as occasionally important things are announced.

Before posting questions here you might want to review the developer documentation.

Do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.
This thread is closed to new posts. You must sign in to post in the forums.
6/29/2022 12:22:41 PM
Gravatar
Total Posts 221

Custom Module Setting File Browser

I have a simple module that only runs off of a few module settings. It's a site alert bar which has copy, url and display status (true/false). I'm trying to make the URL field popup the file manager so I can browse and select a page.

Has anyone put something together that would easily work for this without a lot of messing around? I know I need to use the isettingcontrol type. I copied something from superflexi that sorta works, but it isn't putting the selected page into my field. Plus it's tapping into superflexi which isn't ideal, I'd rather this be more self-contained and not hacked together.

6/29/2022 2:33:12 PM
Gravatar
Total Posts 221

Re: Custom Module Setting File Browser

Making progress. For my isettingcontrol I have this code and it works to browse and select a file or page. Awesome! However: It's relying on the Inherits="SuperFlexiUI.FeaturedImageSetting" to read the field value back into the imageUrl textbox. Not sure if there's an easy way to get that value. This will be a nice little filebrowser example if this last detail is nailed down. I'll keep playing.

<%@ Control Language="C#" AutoEventWireup="true" Inherits="SuperFlexiUI.FeaturedImageSetting" %>

<script type="text/c#" runat="server">
    protected void Page_Load(object sender, EventArgs e)
        {    
        browse.Text = "Browse";
        browse.TextBoxClientId = imageUrl.ClientID;     
       }  
</script>

<asp:TextBox ID="imageUrl" CssClass="forminput" runat="server" style="width:260px" />
<portal:FileBrowserTextBoxExtender ID="browse" BrowserType="file" runat="server" CssClass="btn btn-link"/>

You must sign in to post in the forums. This thread is closed to new posts.