Zishan Posted February 20, 2012 Report Posted February 20, 2012 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. Quote
Strider Posted February 20, 2012 Report Posted February 20, 2012 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 1 Quote
Zishan Posted February 21, 2012 Author Report Posted February 21, 2012 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? Quote
Strider Posted February 21, 2012 Report Posted February 21, 2012 <?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. Quote
HighFlyerPL185 Posted March 15, 2012 Report Posted March 15, 2012 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? Quote
Administrators simpilot Posted March 17, 2012 Administrators Report Posted March 17, 2012 This may help you out a little, I posted an example on how to do this here -> http://david-clark.net/phpvms-content-module/ 1 Quote
HighFlyerPL185 Posted March 17, 2012 Report Posted March 17, 2012 Thanks a lot. Quite a useful tutorial, well done on it. Quote
HighFlyerPL185 Posted March 24, 2012 Report Posted March 24, 2012 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... Quote
Jeff Posted March 24, 2012 Report Posted March 24, 2012 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. Quote
HighFlyerPL185 Posted March 24, 2012 Report Posted March 24, 2012 I have that already in the layout.tpl, and it works on all of the pages within the system, but on all of the pages I create outside the system, the page is titled "Content". Quote
Jeff Posted March 24, 2012 Report Posted March 24, 2012 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. Quote
Administrators simpilot Posted March 25, 2012 Administrators Report Posted March 25, 2012 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... Quote
Jeff Posted March 28, 2012 Report Posted March 28, 2012 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 Quote
Jeff Posted March 28, 2012 Report Posted March 28, 2012 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? Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.