R2i DotNetNuke® Forum

R2i wants you to have the opportunity to ask questions, post reviews, help others or just rant and rave about DotNetNuke® or any of the R2i Modules and Skins. Our team spends hour upon hour, day after day, working on custom DotNetNuke® modules and services; please feel free to ask us anything.
 
How To Utilize myvar = [ModuleId,System] in a NON-ListX Module
Last Post 01 Jan 1900 05:00 AM by . 0 Replies.
Printer Friendly
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages Informative
pauldesUser is Offline
Veteran Member
Veteran Member
Posts:1392

--
14 Aug 2007 10:01 PM  
Compliments of the brain of Kevin Schreiner.....

Change the first line of your container to:

<%@ Control AutoEventWireup="false" Explicit="True" Inherits="DotNetNuke.UI.Containers.Container" %>

then - add this block into your page

<script language="VB" runat="server">

Private Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

Dim myObj As DotNetNuke.Entities.Modules.PortalModuleBase

myObj = GetPortalModuleBase(Me)

If myObj.Settings.ContainsKey("Generate") Then
Me.Response.Write(myObj.Settings("Generate").ToString.Replace("[ModuleID,System]", myObj.ModuleId.ToString))

End If

End Sub

</script>

Okay - now what this will do is add the generated code into your page - you should probably only use this for script values until i discover how to replace the header and footer. Once that is in your container execute this:

nsert into modulesettings select 13615,'Generate','<script language=javascript>var myTest=[ModuleID,System]</script>'

only - 13615 should be YOUR module id.

You then end up with myTest=xxxx for your module
ListX....makes you look brilliant, even though you're not.
You are not authorized to post a reply.

Active Forums 4.1
 

New York, NY • Baltimore, MD • Vienna, VA • St. Louis, MO • Seatle, WA • 410.327.0007 • info@R2Integrated.com

Bookmark & Share Bookmark and Share