ahughes3 Posted April 20, 2015 Report Share Posted April 20, 2015 I have created a module called "Vatspy.php" inside a folder called "Vatspy" the code of the file is below: <?php class Vatspy extends CodonModule //Name can be any names. { public function index() { $this->render('vat-spy.php'); } } ?> I have then created a template page called "vat-spy.php" which has the following code: <!-- Flightboards Tables --> <h3 class="classic-title"><span>Flight Boards</span></h3> <!-- Start Content --> <div class="call-action call-action-boxed call-action-style2 no-descripton clearfix"> <div class="row blog-page"> <!-- Start Blog Posts --> <div class="col-md-12 blog-box"> <!-- Start Post --> <div class="blog-post image-post"> <!-- Post Thumb --> <div class="post-head"> <a class="lightbox" href="<?php echo SITE_URL; ?>/lib/skins/margo-full-width/images/tools/test1.jpg" title="This is an image title"><img alt="" src="<?php echo SITE_URL; ?>/lib/skins/margo-full-width/images/tools/test1.jpg" /> </a> </div> <!-- Post Content --> <div class="post-content"> <h2> <a href="#">Image Box With Nice Lightbox</a></h2> <ul class="post-meta"> <li> By <a href="#">iThemesLab</a></li> <li> December 30, 2013</li> <li> <a href="#">WordPress</a>, <a href="#">Graphic</a></li> <li> <a href="#">4 Comments</a></li> </ul> <p> Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt.</p> <a class="main-button" href="#">Read More</a> </div> </div> <!-- End Post --> </div> <!-- End Blog Posts --> </div> </div> <!-- End Content --> I want to basically call the template as a page from the nav menu so I have set up a link on my navbar that looks like: <li><a href="<?php echo url('/Vatspy.php'); ?>">Vatspy</a></li> When I click on the link it then brings up the "VATSPY.PHP" module does not exist. What I am trying to do is to create a page with details on Vatspy and just have it load as a page from the navbar. I do not want to create a page using the admin centre because as and when phpvms gets updated I will lose all those pages I'm assuming? Plus coding in the editor on phpvms is poor. So can anyone spot my obvious mistake? Because I can't, but then that's not saying much! Quote Link to comment Share on other sites More sharing options...
Members Vangelis Posted April 20, 2015 Members Report Share Posted April 20, 2015 the corect link to call a module is <li><a href="<?php echo url('/Vatspy'); ?>">Vatspy</a></li> And i would loose the "-" in the template name Quote Link to comment Share on other sites More sharing options...
ahughes3 Posted April 20, 2015 Author Report Share Posted April 20, 2015 Thanks Vangelis as always, you came up trumps. I dropped the .php and changed the template name, now it works a treat. Sometimes you just can't see what's staring you in the face Quote Link to comment Share on other sites More sharing options...
ahughes3 Posted April 21, 2015 Author Report Share Posted April 21, 2015 If I create a module to go with a template, at the moment I am placing it in core/modules but I am conscious that if there is an update to phpvms these will be overwritten. If I create a module folder in my skins folder, would that work or does it not check in the same way as it does for skins? Quote Link to comment Share on other sites More sharing options...
Members Vangelis Posted April 21, 2015 Members Report Share Posted April 21, 2015 The files in core/modules wont get overwriten during an update Quote Link to comment Share on other sites More sharing options...
ahughes3 Posted April 21, 2015 Author Report Share Posted April 21, 2015 The files in core/modules wont get overwriten during an update Awesome, thanks Quote Link to comment Share on other sites More sharing options...
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.