Jump to content

Seek for help


Guofu

Recommended Posts

I got a problem with how to create a new web page when I click a button

 

Here is my steps to do it

 

1. create a controller file, I save it in controllers/front/, and call it publications.php

 

<?php
 
class icpgpublicationsModuleFrontController extends ModuleFrontController
{   
    public function setMedia() {
        parent::setMedia();
        $this->addCSS($this->module->getPath().'css/grabgodealer.css');      
        $this->addJS($this->module->getPath().'js/fliphtml5-light-box-api-min.js');
    }
    public function initContent()
    {
        parent::initContent();
        $this->context->smarty->assign("path", 'publications');
        $this->context->smarty->assign("imgpath", $this->module->getPath().'/img/catalogs');
        $this->setTemplate('publications.tpl');
    }
}
 
?>

 

 

 

2. create a template file, I save it in views/templates/front, and call it publications.tpl

 

<div class="container">
 
    <div id="dealer">
        <h1>THE PUBLICATIONS ZONE</h1>  
 
    </div>
 
</div>
 
3. create a link from current page to the new page. I call it grabgo.tpl and grabgo.php
 
this is tpl file code 
 
            <div class="col-md-6 col-sm-6">
                <div class="bottom-text">
                    <a href="/publications" target="_blank">catalog >>> </a>
                </div>  
            </div>
 
So when all of these are done, I click the "catalog" link, it goes to .com/publications link, but it shows "the link is not available". 
 
Does anybody know how to make the page show the title "THE PUBLICATIONS ZONE" ?
 
Thank you!
 
 
 

post-908246-0-04596700-1423087082.txt

Link to comment
Share on other sites

 

I got a problem with how to create a new web page when I click a button

 

Here is my steps to do it

 

1. create a controller file, I save it in controllers/front/, and call it publications.php

 

<?php
 
class icpgpublicationsModuleFrontController extends ModuleFrontController
{   
    public function setMedia() {
        parent::setMedia();
        $this->addCSS($this->module->getPath().'css/grabgodealer.css');      
        $this->addJS($this->module->getPath().'js/fliphtml5-light-box-api-min.js');
    }
    public function initContent()
    {
        parent::initContent();
        $this->context->smarty->assign("path", 'publications');
        $this->context->smarty->assign("imgpath", $this->module->getPath().'/img/catalogs');
        $this->setTemplate('publications.tpl');
    }
}
 
?>

 

 

 

2. create a template file, I save it in views/templates/front, and call it publications.tpl

 

<div class="container">
 
    <div id="dealer">
        <h1>THE PUBLICATIONS ZONE</h1>  
 
    </div>
 
</div>
 
3. create a link from current page to the new page. I call it grabgo.tpl and grabgo.php
 
this is tpl file code 
 
            <div class="col-md-6 col-sm-6">
                <div class="bottom-text">
                    <a href="/publications" target="_blank">catalog >>> </a>
                </div>  
            </div>
 
So when all of these are done, I click the "catalog" link, it goes to .com/publications link, but it shows "the link is not available". 
 
Does anybody know how to make the page show the title "THE PUBLICATIONS ZONE" ?
 
Thank you!

 

 

you can also try to add this page under preferences > seo & urls (click on add, fill out form, select your module)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...