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

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Email template in module settingsEmail template in module settings
Previous
 
Next
New Post
8/13/2008 2:53 PM
 

I'm building a module that puts a template for an email in the Module Settings.

I now see that this limits the template to 2000 characters (the limit in the TabModuleSettings table).

So ... is there a recommended way around this?




Joe Craig
Patapsco Research Group, Ellicott City, MD
DotNetNuke Development and Services (http://patapscorg.com)
 
New Post
8/13/2008 4:16 PM
 

Hi Joe,

I don't know if this is a recommended way for doing it or not but this is how I handled the ability to have templates saved in the settings for a module.  What I have done is created an index setting that stores the number of times that I will be adding content to the settings table for my template.  The example below is in C# but is the same in VB.  If you need it for VB I have that code as well somewhere.

The loadsettings function contains the following:

if

 

((Settings["Index"] != null

))

{

strTemp =

 

""

;

index = (

 

int)Settings["Index"

];

 

 

for

(x = 1; x <= index; x++)

{

strTemp = strTemp + (

 

string)Settings["ExamMessage"

+ x.ToString()];

}

txtMessage.Text = Server.HtmlDecode(strTemp);

}

This is in the UpdateSettings() function:

string

 

 

strTemp = Server.HtmlDecode(txtMessage.Text);

strTemp = strTemp.Trim();

 

{

index = index + 1;

 

{

strTemp2 = strTemp.Substring(0, 1950);

strTemp = strTemp.Substring(1951);

}

 

strTemp = null;string strTemp2 = null;int index = 0;while (strTemp.Length > 0)if (strTemp.Length > 1950)else

{

strTemp2 = strTemp;

strTemp =

}

objModules.UpdateModuleSetting(ModuleId,

}

objModules.UpdateModuleSetting(ModuleId,

"";"ExamMessage" + index.ToString(), strTemp2);"Index", index.ToString());

 

 

 

 

 

Hope this helps you with your request:

Sam


Sam
http://www.learnmsnet.com/ - Blog about ASP.NET and DotNetNuke
http://www.shancer.com/ - Building modules for DotNetNuke
 
New Post
8/13/2008 4:42 PM
 

Hi Joe,

1) Make your own table

2) Save settings like "TemplateCount" = number of 2000 byte chunks of the template.  Then "Template1" bytes 0 to 1999, "Template2" bytes 2000 to 3999 , etc..

Thanks,

Mike

 
New Post
8/13/2008 7:02 PM
 

other options are:

  • save template in a text file
  • use multiple (nested) templates for header, footer, ...

Cheers from Germany,
Sebastian Leupold

dnnWerk - The DotNetNuke Experts   German Spoken DotNetNuke User Group

Speed up your DNN Websites with TurboDNN
 
New Post
8/14/2008 9:20 AM
 

I think if the template is larger than 2000 characters, then you don’t want to put it in the template.

Dnn loops through the properties of the module object and does a replace on it. This is done for each module in each page, do you really want to put such a burden on the host server?

Additional options

  • break off the static portion of the template and try to get the character count as small as possible.
  • hard code the static portion of the template and insert it using variables.
  • add a property at the end of the module object  to store the major chuck of the template and add that filed to the template.

The idea here is to prevent dnn from looping though a large chcuk of text doing string replace (matching).

 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Email template in module settingsEmail template in module settings


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