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

HomeHomeUsing DNN Platf...Using DNN Platf...Using Modules a...Using Modules a...Load txt file content in a module or the html moduleLoad txt file content in a module or the html module
Previous
 
Next
New Post
1/28/2015 3:58 AM
 

Hello

I want to know if its possible to load the content of a text file into my website. Either to the html module or if there is any module that can load txt file contents.

I have a text file in my website thats its updated regularly and id like to show its contents in my side without having to change anything, or manage the website each time there is an update.

I made a little search but with no luck.

Thank you for your time

Antonis

 
New Post
1/28/2015 5:51 AM
 

Hi Antonis,

I don't think you'll be able to read a text file in the text/html but what you could try is to use the Razor Host module and code it so that it reads the text file into the module.

That's the way I would think about doing it.

Search for Razor code that read text files.

Hope this helps,

Regards,

Geoff


      
 
New Post
1/28/2015 5:59 AM
 

You could do this like this

Add an html module  to the page and add this in html view

<div id="txt">Loading content ....</div>

Now in the module settings for the module footer you add the following code

<script>
$( document ).ready(function() {

$.get("http://www.yourdomain.com/import.txt", function(data) {
   $("#txt").html(data.replace("n","<br />"));
});

 
});

</script>

 

This will only work if your txt file is on the same domain as your website 

 
New Post
1/28/2015 6:08 AM
 

Yes this works m8. 

Thank you very much:)

 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Using Modules a...Using Modules a...Load txt file content in a module or the html moduleLoad txt file content in a module or the html module


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