|
|
| Body Template maxLength ? (Australia) |
|
|
Hey,
I'm am tring to put in a email template however when I save it some of the template gets removed. I have gone into the Settings.ascx and set
<dnn:texteditor id="txtBodyTemplate" ChooseMode="true" Runat="server" MaxLength="2000" Height="200" width="400"></dnn:texteditor>
Where initially MaxLength was set to 1000, however this hasn't allowed me to input a larger template?
In the install .zip there is no sql and therefore I believe there is no tables contected to this module?
Could you tell me how this body template is stored after I put the text in, or any other help to fix this problem would be great.
Thanks
Nathan
|
|
|
|
 |  |
|
|
| Re: Body Template maxLength ? (Australia) |
|
|
To Fix this problem I had to go into the moduleSettings table and change SettingValue to nvarchar(4000), and go into the stored procedures updatemodulesettings and addmodulesettings. However this does leave very big limits on the module itself :( |
|
|
|
 |  |
|
|
| Re: Body Template maxLength ? (N/A) |
|
|
Hi Nathan,
Yes, this is a limitation in the DNN core - settings are limited to 1000, which I think is too small. What I do in the UserProfile module is parse together multiple settings, eg:
private string LoadTemplate()
{
//a setting only holds 1000, so chop it up to allow 6000 max - load the default from the language string if it is the first time
string profileBodyTemplate = Settings["ProfileBodyTemplate"] == null ? Localization.GetString("BodyTemplateDefault.Text", LocalResourceFile) : Settings["ProfileBodyTemplate"].ToString();
profileBodyTemplate += Settings["ProfileBodyTemplate2"] == null ? "" : Settings["ProfileBodyTemplate2"].ToString();
profileBodyTemplate += Settings["ProfileBodyTemplate3"] == null ? "" : Settings["ProfileBodyTemplate3"].ToString();
profileBodyTemplate += Settings["ProfileBodyTemplate4"] == null ? "" : Settings["ProfileBodyTemplate4"].ToString();
profileBodyTemplate += Settings["ProfileBodyTemplate5"] == null ? "" : Settings["ProfileBodyTemplate5"].ToString();
profileBodyTemplate += Settings["ProfileBodyTemplate6"] == null ? "" : Settings["ProfileBodyTemplate6"].ToString();
return Server.HtmlDecode(profileBodyTemplate);
} Thanks
Rodney
See our modules in action on PokerDIY, a social network for home poker players
 |
|
|
|
 |  |
|
|
| Re: Body Template maxLength ? (Poland) |
|
|
I'd really like to know what Nathan actually did (I can't see SettingsValue in the ModuleSettings table) as I'd rather have limits that are too large than too small... unless this is really not recommended.
As a non-programmer Rod's solution is just beyond my current abilities. |
|
|
|
 |  |
|
|
| Re: Body Template maxLength ? (N/A) |
|
|
The problem with Nathan's solution is that it is adjusting the core Module Setting stored procedures (ie. changing the core) as the setting limitation comes from the core.
I would not recommend this unless you knew/understood the implications of tinkering with the core and had a good upgrade process in place.
Thanks
Rodney
See our modules in action on PokerDIY, a social network for home poker players
 |
|
|
|
 |  |
|
|
| Re: Body Template maxLength ? (Poland) |
|
|
| rod wrote
Hi Nathan,
Yes, this is a limitation in the DNN core - settings are limited to 1000, which I think is too small. What I do in the UserProfile module is parse together multiple settings, eg:
private string LoadTemplate()
{
//a setting only holds 1000, so chop it up to allow 6000 max - load the default from the language string if it is the first time
string profileBodyTemplate = Settings["ProfileBodyTemplate"] == null ? Localization.GetString("BodyTemplateDefault.Text", LocalResourceFile) : Settings["ProfileBodyTemplate"].ToString();
profileBodyTemplate += Settings["ProfileBodyTemplate2"] == null ? "" : Settings["ProfileBodyTemplate2"].ToString();
profileBodyTemplate += Settings["ProfileBodyTemplate3"] == null ? "" : Settings["ProfileBodyTemplate3"].ToString();
profileBodyTemplate += Settings["ProfileBodyTemplate4"] == null ? "" : Settings["ProfileBodyTemplate4"].ToString();
profileBodyTemplate += Settings["ProfileBodyTemplate5"] == null ? "" : Settings["ProfileBodyTemplate5"].ToString();
profileBodyTemplate += Settings["ProfileBodyTemplate6"] == null ? "" : Settings["ProfileBodyTemplate6"].ToString();
return Server.HtmlDecode(profileBodyTemplate);
}
|
Hi Rod
i do pop back here regularly, for whatever reason I just don't get the notifications but not to worry... i know where you are & I know you respond quite quickly.
I understand it is probably best not to mess with the core, but I don't know enough to implement your method above. Is there somewhere I could learn how to do something like this?
There is another module (to do with RSS Feeds, using tab menus etc - comes with DNN) that i would like to be able to do this for also, if it is possible.
Thanks
David |
|
|
|
 |  |
|
|
| Re: Body Template maxLength ? (N/A) |
|
|
Hi David,
I'm afraid not - you either need to be able to understand and change the core to handle larger settings, or you need to be able to work out what each module is doing (the ones you mentioned may use a different method to mine - I just thought mine was one of the quickest/easiest and still uses the basic Settings framework) and modify each individually. I will be extending the ST UP to support another 4 * 1000 (ie. 10 settings for the template) shortly. Thanks
Rodney
See our modules in action on PokerDIY, a social network for home poker players
 |
|
|
|
 |  |
|
|
| Re: Body Template maxLength ? (Poland) |
|
|
Hi Rod
Although it would be good to adjust other modules, the main one I really would like to increase is the Smart-Thinker Referral module... but is there any sort of tutorial, or step by step instructions on how to use your method with this module?
And how are things treating you down in Aus now?
Cheers
David |
|
|
|
 |  |
|
|
| Re: Body Template maxLength ? (Australia) |
|
|
Hi David,
I have not done this before, but I would try Nathan's solution – I can’t guarantee it would work as you will need to test all your module settings again as your are editing the core. Nathan - was there anything other than this that you did? Care to share your solution with David?
The problem is the limitation in the core with the length of system settings - the hack I did in the UP module was to get around this limitation, but ideally the core would be expanded to allow bigger settings (I think there is a valid need) - so perhaps you should request that this gets looked at in a future version (either mention it in the forums or raise it in Gemini).
Aus – good thanks – I am still looking for accommodation, so I am living out of suitcases, but my PC is up and running and slowly but surely getting bank accounts/drivers license/cell phones etc. it’s a long, slow process but I am loving Australia to be honest!
Thanks
Rodney
See our modules in action on PokerDIY, a social network for home poker players
 |
|
|
|
 |  |
|
|
| Re: Body Template maxLength ? (Poland) |
|
|
Hi Rodney
I am still stuck on this actually... as you said, better not to mess with the core at all so I woudl like to look at your method below.
Sorry, I am a bit of a dimwit with this stuff at the moment but are you able to explain easily how this method is done?
Enjoy the Rugby? I was in Poznan, couldn't help but support South Africa although mostly Brits in there... was a great game to watch!
Thanks
David
| rod wrote
Hi Nathan,
Yes, this is a limitation in the DNN core - settings are limited to 1000, which I think is too small. What I do in the UserProfile module is parse together multiple settings, eg:
private string LoadTemplate()
{
//a setting only holds 1000, so chop it up to allow 6000 max - load the default from the language string if it is the first time
string profileBodyTemplate = Settings["ProfileBodyTemplate"] == null ? Localization.GetString("BodyTemplateDefault.Text", LocalResourceFile) : Settings["ProfileBodyTemplate"].ToString();
profileBodyTemplate += Settings["ProfileBodyTemplate2"] == null ? "" : Settings["ProfileBodyTemplate2"].ToString();
profileBodyTemplate += Settings["ProfileBodyTemplate3"] == null ? "" : Settings["ProfileBodyTemplate3"].ToString();
profileBodyTemplate += Settings["ProfileBodyTemplate4"] == null ? "" : Settings["ProfileBodyTemplate4"].ToString();
profileBodyTemplate += Settings["ProfileBodyTemplate5"] == null ? "" : Settings["ProfileBodyTemplate5"].ToString();
profileBodyTemplate += Settings["ProfileBodyTemplate6"] == null ? "" : Settings["ProfileBodyTemplate6"].ToString();
return Server.HtmlDecode(profileBodyTemplate);
}
|
|
|
|
|
 |  |
|
|
| Re: Body Template maxLength ? (Australia) |
|
|
Hi David,
Yes, the rugby was awesome ;) Nice to get the trophy again!
Ok, so in the source, whereever it references the setting in question, you are going to have to implement the function above, so that it breaks up the text and stores it in chunks of 1000 in each setting. Thanks
Rodney
See our modules in action on PokerDIY, a social network for home poker players
 |
|
|
|
 |  |
|
|
| Re: Body Template maxLength ? (Poland) |
|
|
Hey Rod
No desire yet to head back to the UK? Miss London? Will be home (Brisbane) in a few weeks myself... first time in nearly 6 years.
On this... is it correct that I would need the source code to do this (as you mention source) or can it just be edited with what I would have? I think I understand it now, to replace the single body template section with the code you have, so that a few boxes appear in the settings of the module.
I am mostly interested in the Referral Module myself, for expanding the body. I am possibly looking at getting a coder to add cookie tracking in the near future too, let you know more with what happens on that.
Cheers
David
|
|
|
|
 |  |
|
|
| Re: Body Template maxLength ? (Australia) |
|
|
Hi David,
I do miss London (especially the public transport - almost non-existant in Aus!) but I am not coming back ;) I love it too much here...
Yes, for a change of this magnitude you would need to edit the source. The UI will remain the same (ie. one box) but in the backend it will split and concat the settings into 1000 chunks.
If this is the only module you need the source for, send me an email and I will send it to you (one of the lesser modules, and not worth buying the complete source package for). Thanks
Rodney
See our modules in action on PokerDIY, a social network for home poker players
 |
|
|
|
 |  |
|
|
| Re: Body Template maxLength ? (Poland) |
|
|
Hi Rodney
Did you get my message I sent via the website? I couldn't find your email, although I am sure I have it somewhere (auto-archived by Outlook I expect).
Yes, just this one... for making a referal 'look good' I need more than DNN's 1000 character limit!
Cheers
David |
|
|
|
 |  |
|
| |
 |  |
|
|
| Re: Body Template maxLength ? (Poland) |
|
|
I have tried to "parse together multiple settings" but am having no luck at all :-(
Unfortunately I do have limited knowledge in programming, and had thought there might be an obivous file in the source that simply needed changes along the lines of your sample. Is it supposed to be that simple?
Might it be possible to make the changes to allow a 'reasonable' body text to be used for referrals?
Would appreciate seeing just a minor update.
Thanks
David |
|
|
|
 |  |
|
|
| Re: Body Template maxLength ? (Australia) |
|
|
Hello David,
It is a fairly simple change, IF you knew what you were looking for - unfortunately it is not the coding that takes up the time, it is the testing and release process that can turn a simple 1 hour change into half a days work. I'll reply to your email now to see if we can work something out. Thanks
Rodney
See our modules in action on PokerDIY, a social network for home poker players
 |
|
|
|