General developer forum

how to create new page(custom) in moodle

 
Picture of Jyoti Kashid
how to create new page(custom) in moodle
 

how to create new page(custom) in moodle

 
Average of ratings: -
Rosario playing soccer
Re: how to create new page(custom) in moodle
Plugin developers

What kind of page?? Course-Page-Display? The overall display is ruled by themes and CSS Files in it. Anything else would require more work, e.g. displaying the course-page not as long long vertical page, but in shorter pages that fit into a screen and scrollable like the pages of a book.

Rosario

 
Average of ratings: -
Picture of Jyoti Kashid
Re: how to create new page(custom) in moodle
 

i want to create my own page in moodle 2.0

 
Average of ratings: -
Rosario playing soccer
Re: how to create new page(custom) in moodle
Plugin developers

WHAT PAGE??

 
Average of ratings: -
Picture of Siddharth Patel
Re: how to create new page(custom) in moodle
 

A page which is containing a moodle environment (like the apperance, header, footer and connection to the moodle config) but the middle portion of the page contain the programmer's code in his independate page.

Like, http://localhost/moodle/mypage.php

 
Average of ratings: Useful (1)
Picture of Mark Nelson
Re: how to create new page(custom) in moodle
Core developersDocumentation writersMoodle HQParticularly helpful MoodlersPlugin developersTesters

I am going to assume this is for Moodle 2.0.

When creating the page, simply include the config.php file. Once included, set the $PAGE parameters, and then call $OUTPUT->header and $OUTPUT->footer.

I have attached a very simple example, which does not make use of any language file etc. Please note, you may want to change the pagelayout from admin depending on who will be viewing this screen.

Is there a reason why you do not want to create this as a plugin?

 
Average of ratings: Useful (6)
Anne Krijger
Re: how to create new page(custom) in moodle
 

And if not a module or a block, place the code in /local/<mycustomstuffname>/mypage.php

Anne.

 
Average of ratings: -
Picture of Siddharth Patel
Re: how to create new page(custom) in moodle add navbar
 

Hi Mark,

That was very useful.
I wanted to create a custom independent page, which could not be made as a plugin.

Your answer and the attached file were very helpful, but it is not showing the navbar in the page.

Can you please tell that how we can allow to arrange the navbar in the page?

TIA

Regards..

Sid

 
Average of ratings: -
Picture of Troy Fennell
Re: how to create new page(custom) in moodle
 

AHHHHHHHHHHHHHHH!!!!!!!!!!!!!

Thanks for that, Mr. Nelson. smile

You just made my new contact page.

May you have nothing but blondes in your life.Yes

 
Average of ratings: -
Picture of Rajakumar Jillella
Re: how to create new page(custom) in moodle
 

Custom pages are displaying before login,

And custom pages are not displaying once the user logged in.


How do we display custom pages after logged in too?

 
Average of ratings: -
Picture of Richard Oelmann
Re: how to create new page(custom) in moodle
Core developersParticularly helpful MoodlersPlugin developersTesters

Check the code of your page, there must be a loggedin check somewhere in your code, or in the link to the custom page. Get rid of it.

 
Average of ratings: -
Picture of John Lu
Re: how to create new page(custom) in moodle
 

Remember to add a lib.php file in your directory, otherwise the content won't load up. 

 
Average of ratings: -
Picture of anita bankar
Re: how to create new page(custom) in moodle
 

Hi,

I am also using moodle2.9,I want to access student name,emailid  or  other details in newly added custom page ,So How I can access it here

 
Average of ratings: -
Picture of Mitja Decman
Odg: Re: how to create new page(custom) in moodle
 

Soooooo happy that this is still her.

Thanks. smile

 
Average of ratings: -
Picture of Mihir J
Re: Odg: Re: how to create new page(custom) in moodle
 

Hi

You should check the page api  https://docs.moodle.org/dev/Page_API

Usually you will have all information available of a user in the global $USER variable.

Thanks!

 
Average of ratings: -
Picture of Mamun Laz
Re: how to create new page(custom) in moodle
 

I want to create a page in the site that will have all the names of the teachers

 
Average of ratings: -
Picture of Richard Jones
Re: how to create new page(custom) in moodle
 

Hi Mamun

My suggestion would be to look at the coding in the online users block and modify a copy of that:

1) To limit users to specific roles

2) To list offline as well as online users

At the worst you will have learned a lot about the way Moodle coding works.

As an alternative to coding you could install the configurable reports block and create an SQL report modifying the queries you can find in fetcher.php in that block.


 
Average of ratings: -