[Adaptable 1.6.1] Custom html page

[Adaptable 1.6.1] Custom html page

by Gary Lynch -
Number of replies: 5

Hi

I have created a custom html/php/sql page (simple version) but i would like to include the header and footer.php from the theme

I have looked at the layout files in the theme for a clue but i think its that i don'tquite understand enough of the moodle php formatting..

Could someone explain it to me please just use one example smile

Thanks in advance for help 

PS im more html/css than php but learning smile

Gary smile

PPS this link doesn't help as it refers to 2.0

Average of ratings: -
In reply to Gary Lynch

Re: [Adaptable 1.6.1] Custom html page

by Mary Evans -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

Hi Gary,

Where is this new page going to be seen and by whom?

The basic three column page in most Bootstrapbase themes looks like this:

https://github.com/moodle/moodle/blob/master/theme/bootstrapbase/layout/columns3.php

So depending on what you are hoping to add to that page or one of the other layout pages, using HTML, PHP and SQL will depend largely on what your code looks like.

The HTML & PHP is not that hard to master in the layout stage as most of the PHP arrives in the layout via the main content token and the block regions and renderers.

So what you add outside of these areas is up to you.

It would be good to have a general outline of the code you are working on now, what it is and how you want it to work.

Hope this helps?

Mary

In reply to Mary Evans

Re: [Adaptable 1.6.1] Custom html page

by Gary Lynch -

Hi Mary

attached my test file.

This file will sit in a separate read only file on my server.

Basically what i would like to do is bring in the theme header and footer into the page then i will tidy a lot of the code up (sorry its messy :P)

do i just call the header.php as a 'require'?

or do i need to include 'define?

Thanks

Gary smile

In reply to Gary Lynch

Re: [Adaptable 1.6.1] Custom html page

by Mary Evans -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

Hi Gary,

Having created a similar search/query type database some years ago, (I presume that is what you are creating?). Mine had a few smaller php pages that all linked together. I wonder sometimes how I actually managed to make it work, but it did and looked fantastic. The styling I created myself which had its own CSS stylesheet and the layout was pure HTML within a PHP file, similar to how Moodle works.

I had it on my website for a while until it got hacked. At the time I did not know enough about security issues. So I learned the hard way.  Lets face it anything on a server on the web is a target for hackers!

If all you want to add is the Header and Footer from the Adaptable theme, then I would be tempted to add the same php/html code as you find in the theme/adaptable/layout/columns1.php of your Moodle site.

That said, the Adaptable layout page I have just mentioned will only work inside Moodle, so if your SQL/PHP file is outside Moodle then you only need to copy the HTML for the header and footer and copy the CSS for those elements to get it to look like part of the site.

Does that make sense?

Mary

Average of ratings: Useful (1)