Our offices are located in downtown Champaign in the old Surface 51 building south of Champaign Surplus and just north of the intersection of Springfield and Neil:
Phone: (217) 531-2966 •
Fax: (866) 298-5499
General Inquiry: [email protected]
Support request: [email protected]
More info »
Wednesday, September 23, 2020
Author: Jeremy Farrance
You may not use or have any interest in DNN sites using multiple languages, but the Language editor is still very useful for a variety of site customizations.
Most people approach their needs with a specific question and having all this power under Site Settings / Languages can make it difficult to figure out where to go when the question in your head is:
So let's do the thing in steps, here is how to change one of the DNN 9+ core emails sent out to the site (portal) administrator when a user gets locked out for too many bad login attempts.
** in D (above), which you choose is beyond the scope (not a pun) of this article. But in general you just need to understand if you want the change you are making to be global to the DNN instance - meaning any/all portals - or just for one site (portal). For us and a lot of projects, the DNN instance just has 1 single portal and in that case it is convenient to just use Global.
That's it, but it's worth noting that after saving these resource files (*.resx) DNN (ASP.NET really) needs to do some recompiling and it may take your site 3 to 20 seconds or more to display the next page refresh or request.
The above PersonaBar UI works, and after a few repetitions, works well enough for an occasional one-off edit. But if your skill set makes you feel comfortable editing files in DNN "under-the-hood," read on for a more efficient approach.
I work at an agency and we host over 200 sites. In the last 2 years, we've migrated a lot of our DNN project work to GitHub Repositories (private) and use VS Code to do quite a bit of our DNN design and customization work. We call this Open Heart Surgery (OHS) and should probably give a call-out to 2sxc's Daniel Mettler for the terminology. :)
Before trying this, responsibility requires me to point out two very important things. 1) Always have backups (that you know you can restore by file, folder, or in full). 2) Using GitHub properly provides a wonderful level of history, revision details, and can make it fairly easy to confidently undo changes that have caused any type of unexpected results.
I'll have to leave getting VS Code setup to do OHS with a DNN site for another article. But the GIF below shows a fast and efficient way to edit, find, and update a value in resources. Click to zoom the GIF to full size in a new window/tab...
In the above GIF, one of our standard project edits is the SMTP Configuration Test email. It's nice when it shows up, but if you didn't initiate the test-send, how do you know which site it came from? Who sent it? In my world, it can waste a lot of time when one of those emails shows up and you don't know who sent it on your team (or maybe the client?). So in App_GlobalResources/GlobalResources.resx (or *.Portal-[#].resx) we simply add the token for the Portal Name, very helpful:
And now you get an informative email:
You can see (and search) the full default version of DNN's GlobalResources.resx file in the GitHub repository, which is also a fast way to search for stuff and quickly find the details and keys you are looking for.
One more tip? Above in the GIF, did you catch a glimpse of the encoded HTML in the key/value below the one we were editing? When working in a text editor (like vscode) for email body values that are in HTML, don't forget to encode (e.g. "<p>" needs to be stored as "<p>"). You can markup your HTML in any editor (VS Code is used in the example) and then easily convert it using an online tool. There are many, just search for "html encode online" or rephrase as you like until you find one that works well for you.
Thanks: Will Strohl, Daniel Mettler, and Brittani Musgrove
Read more DNN Details posts...
More about Accuraty...
And finally, a bonus shout out and thank you to the (unknown to me, but highly acclaimed) DNN developer who recently added the Host Email field - the email address the SMTP Configuration Test email (above) - to the PB/Settings, Server Settings tab, and SMTP Server sub-tab settings page!!
If you are using DNN 8.x or earlier, two things. 1) upgrade, upgrade now, please upgrade, just do it. 2) this article recaps the past fairly well, Localizing the User Interface Content.
Posted In: Technical | Comments (0)
Find out more about our services, or get started on your next project.