Jump to content

Recommended Posts

Posted

How do I create pages such as index.php/____ So I want to make like a page not uses the admin tool on my site please help I'll give a rep to you.

Please give step by step as I am new in php.

Posted

You have to create a module, there is simple code on the forums somewhere on how to do it. you create the module, and the tpl file, and you will get the index.php/whatever

  • Like 1
Posted

You have to create a module, there is simple code on the forums somewhere on how to do it. you create the module, and the tpl file, and you will get the index.php/whatever

Do you know where that is?

Posted

<?php



class HubStats extends CodonModule

{

public function index()

{



	Template::Show('hubstats.tpl');



}





}

To create the page, the module has to have a similar name. The php file has to have the same name as the folder. Also the class. just change the class name and the tpl name and you are ready to go.

  • 4 weeks later...
Posted

If I understand correctly, would it work if I save it in the same folder as the skin templates, use the layout.tpl instead of hubstats.tpl in this instance, and just create a html page with content located in the appropriate div tags where I want them to be?

Posted

I have tried your tutorial and I found it very useful like I said, however I can't figure out how to change titles of each of the pages. I tried simply <title> tags at the top of the template, but I guess that it requires some more effort...

Posted

The original <title> can be found in your layout.tpl

If, by some chance, it is not there, you can add it there.

If you look in the crystal skin, and open the layout.tpl file, you will see

<title><?php echo $page_title; ?></title>

Just place this in your layout.tpl you are using, and it will give you the result you are looking for.

Posted

Not sure where the problem lies, as I use the exact same code I posted above, and I also use the same format Simpilot presented and it shows up correctly. For example on my Tour page, it is showing "Tour - Virtual Flight Zone" on the page tab and the bottom browser tag. Maybe you can post your Module code to see if there is something there that might be conflicting with it. You might also have another <title></title> somewhere in the layout.tpl that may be conflicting with it.

  • Administrators
Posted

The system uses the name of the module plus the name of your site for the page title unless you redeclare it in your module;

class Content extends CodonModule
{
public $title = 'Welcome';

public function index() {
etc...

Posted

I posted an example on how to do this here -> http://david-clark.n...content-module/

I am a little stuck with this. I am trying to add Hub pages. This is how I have it:

<?php

class Hubs extends CodonModule	 {

 function index()	 {

 $this->show('hubs');

 }

function atl()	 {

 $this->show('atl');

 }
function phx()	 {

 $this->show('phx');

}
}

How do I create it without it linking like www.mysite.com/index.php/hubs/atl/phx

because this is exactly what it is doing. I want to be able to link it like this:

www.mysite.com/index.php/hubs/atl

and

www.mysite.com/index.php/hubs/phx

Posted

I have been working on this all day, and cannot seem to get it to link correctly. Any ideas on what I might be doing wrong, or what I might need to change?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...