Adding modules/pages to Emoncms

Hi OEM forum.

 

I want to add so extra pages and a homepage to the existing econcms source code, but im a little confused as to how to do it.

I see that everything is redirected through the index page, and requires 3 parameters to specifiy location and type.

Can someone please assist me with a sample of how to integrate pages into the econcms webpage code?

Regards

Paul Reed's picture

Re: Adding modules/pages to Emoncms

If you add a text field to a dashboard, you can insert HTML into the field, including links across to other pages (standard HTML web pages) so you can for example switch from your 'emoncms' page to other custom web pages at will. 

I created a folder under emoncms to hold all of my own HTML pages, and you can even add a small php code to redirect visitors to your own new 'home page', I can't check now as the site is down, but it's emoncms.org and it's at the bottom of the 'build from scratch' guide. 

Paul

XaroRSA's picture

Re: Adding modules/pages to Emoncms

Hi Paul.

Would you mind sharing with me a example of how you added the html code wise?

I want to make a homepage, that later goes to the login screen, and once logged in I want the users not to have all the tabs, only the visuals that I will create using an admin account.

Thanks for the quick response!

Regards

Paul Reed's picture

Re: Adding modules/pages to Emoncms

I'm out for the day, but will post again tonight with some examples.

Paul

XaroRSA's picture

Re: Adding modules/pages to Emoncms

Great!

Thanks Paul!

Cant wait to contribute to this Project, i already have a ardunio shield that I will post once its been perfected.

Paul Reed's picture

Re: Adding modules/pages to Emoncms

I'm assuming that you are hosting emoncms on your own server ( as you mentioned emoncms source code above).

But in either case you can add html elements to a dashboard using normal HTML rules. For example visit this sample emoncms page.

I have added HTML code via the text boxes as follows;

If you want to learn more about HTML, then <a href="http://www.w3schools.com/">visit W3Schools</a>
<img alt="" height="259" src="http://openenergymonitor.org/emon/sites/default/files/emoncms_devices.jpg" width="400">
<a href="http://openenergymonitor.org/emon/node/2723#comment-14510">Return back to the forum</a>

So you could host your other website pages elsewhere and use links to join the website together.

If you are running emoncms on your own server, you could create a directory for example /var/www/mysite and in there put a index.html and your other website pages which link across to your emoncms dashboards. In /var/www , add a index.php redirect file as follows;

<?php header('Location: ../mysite'); ?>

<html><body><h1>Welcome</h1>
<p><a href="mysite" >Goto Mysite</a></p>
</body></html>

...which will direct visitors to your own landing page.

Paul

XaroRSA's picture

Re: Adding modules/pages to Emoncms

great!

Ill have a look at it the weekend.

Also gonna try to embed google charts and a extra widgets for a nicer dashboard!

Thanks Paul

Priya's picture

Re: Adding modules/pages to Emoncms

Hi everyone:

I want to create a new webpage in feeds and show menu bar on it that is index.php.  Can you please tell me tha way to do it..??

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.