Post by filippo » Wed Sep 09, 2009 5:19 pm

Hello!
First of all thanks for great CMS ! Everything is fine, but one thing that imho should be added in next releases is support for custom pages. I can do it via Information Module and then link the page with heading menu but then that page will be also visible in Information box. What I am trying to acomplish is to create new custom page and link it with head menu (custom page with breadcumb and box with title, not entirely new page). Is there some fast way to do this ?

http://www.krakers.pl


Newbie

Posts

Joined
Wed Sep 09, 2009 4:52 pm


Post by filippo » Wed Sep 09, 2009 7:05 pm

OK, I think I found solution. If anybody had similar problem here is the answer (only front-end):

Step 1:
Create folder structure for Controller, View and Language layer

Controller: catalog/controller/custom
View: catalog/view/theme/default/template/custom
Language: catalog/language/custom

Step 2:
Put files with desired name to each folder, in my example it is 'serwis'

Controller: catalog/controller/custom/serwis.php

Code: Select all

<?php  
class ControllerCustomSerwis extends Controller {
	public function index() {
		$this->language->load('custom/serwis');
		
		$this->document->title 			= $this->language->get('heading_title');
		
		$this->document->breadcrumbs = array();

   		$this->document->breadcrumbs[] = array(
       		'href'      => $this->url->http('common/home'),
       		'text'      => $this->language->get('text_home'),
      		'separator' => FALSE
   		);
		
		$url = '';
				
		if (isset($this->request->get['page'])) {
			$url .= '&page=' . $this->request->get['page'];
		}	
			
   		$this->document->breadcrumbs[] = array(
       		'href'      => $this->url->http('custom/serwis' . $url),
       		'text'      => $this->language->get('heading_title'),
      		'separator' => $this->language->get('text_separator')
   		);
		
		$this->data['heading_title'] 	= $this->language->get('heading_title');
		$this->data['heading_text']		= $this->language->get('heading_text');
		$this->id       				= 'content';
		$this->template 				= $this->config->get('config_template') . 'custom/serwis.tpl';
		$this->layout   				= 'common/layout';
		
		$this->render();
	}
}
?>
View: catalog/view/theme/default/template/custom/serwis.tpl:

Code: Select all

<div class="top">
  <h1><?php echo $heading_title; ?></h1>
</div>
<div class="middle">
  <div><?php echo $heading_text; ?></div>
  
</div>
<div class="bottom">&nbsp;</div>
Language: catalog/language/english/custom/serwis.php:

Code: Select all

<?php
// Heading 
$_['heading_title'] = 'Serwis i usługi';

//Content
$_['heading_text'] = 'Welcomeeee';
?>
Step 3:
Change 'serwis' to desired name (filename and inside files), 'default' to your template name and 'english' to your language folder.

Step 4:
Modify variable 'heading_title in language file to set title of page and box.
Modify variable 'heading_text' in language file and put heading content for your custom page.
You can easly create new variables and put more content.

Step 5:
Put link to your new custom page anywhere you want, in my example it will be: index.php?route=custom/serwis

Thats all.
Last edited by filippo on Wed Sep 09, 2009 8:34 pm, edited 1 time in total.

http://www.krakers.pl


Newbie

Posts

Joined
Wed Sep 09, 2009 4:52 pm


Post by Qphoria » Wed Sep 09, 2009 7:53 pm

I created a CMS System addon for OpenCart that will do a bit more
- Categorized Topics
- Custom Sidebox module
- Categories can be external links
- Articles are displayed CMS style with read more for full story
- Enable/Disable Categories
- Custom SEO controller
- Related Articles

DEMO: http://unbannable.com/v132/index.php?ro ... ory&path=2
DOWNLOAD: http://www.unbannable.com/ocstore/cms

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by ameisez » Mon Feb 01, 2010 7:54 am

Qphoria wrote:I created a CMS System addon for OpenCart that will do a bit more
- Categorized Topics
- Custom Sidebox module
- Categories can be external links
- Articles are displayed CMS style with read more for full story
- Enable/Disable Categories
- Custom SEO controller
- Related Articles

DEMO: http://unbannable.com/v132/index.php?ro ... ory&path=2
DOWNLOAD: http://www.unbannable.com/ocstore/cms
Is this available/compatible with the new version (1.4.0)

Newbie

Posts

Joined
Sat Jan 30, 2010 7:45 pm

Post by ameliaa » Mon Feb 01, 2010 9:09 am

I would like to purchase this but I am using version 1.4 of opencart. Qphoria, are you going to update the CMS system addon for the new version?

New member

Posts

Joined
Fri Jan 29, 2010 6:31 pm

Post by amelie » Sat May 07, 2011 5:54 am

Hello,

Thanks for the post. I know it's been a while since the original post was created, but I'm attempting creating a custom page in 1.4.9.4. I tried using the code provided, but I get the following error:

Code: Select all

Fatal error: Call to a member function http() on a non-object in /home/clover13/public_html/store/catalog/controller/custom/help.php on line 11
line 11:

Code: Select all

'href'      => $this->url->http('common/home'),
catalog/controller/custom/help.php:

Code: Select all

<?php 
class ControllerCustomHelp extends Controller {
   public function index() {
      $this->language->load('custom/help');
      
      $this->document->title          = $this->language->get('heading_title');
      
      $this->document->breadcrumbs = array();

         $this->document->breadcrumbs[] = array(
             'href'      => $this->url->http('common/home'),
             'text'      => $this->language->get('text_home'),
            'separator' => FALSE
         );
      
      $url = '';
            
      if (isset($this->request->get['page'])) {
         $url .= '&page=' . $this->request->get['page'];
      }   
         
         $this->document->breadcrumbs[] = array(
             'href'      => $this->url->http('custom/help' . $url),
             'text'      => $this->language->get('heading_title'),
            'separator' => $this->language->get('text_separator')
         );
      
      $this->data['heading_title']    = $this->language->get('heading_title');
      $this->data['heading_text']      = $this->language->get('heading_text');
      $this->id                   = 'content';
      $this->template             = $this->config->get('config_template') . 'custom/help.tpl';
      $this->layout               = 'common/layout';
      
      $this->render();
   }
}
?>
Any insight would be greatly appreciated.

Active Member

Posts

Joined
Sat Feb 05, 2011 4:15 am

Post by philbydevil » Sat May 07, 2011 6:42 am

If you just want to create a page you could always make a new "Information" page in Admin and then set the sort order to -1 so it doesn't show up the the Information box (if this is what you want).

I heart cmd-f, cmd-c, cmd-v, cmd-z + vQmod.
My favourite page...
v1.5.4.1


User avatar
Active Member

Posts

Joined
Fri Dec 03, 2010 5:20 am

Post by sunriser » Mon Feb 13, 2012 7:23 pm

Great, I've never noticed!
Thanks Phil!

http://www.buddhalife.nl


New member

Posts

Joined
Sun Dec 18, 2011 8:03 pm


Post by chrisiiv » Sun Mar 25, 2012 2:13 pm

I get also error message
Fatal error: Call to undefined method Url::http() in /catalog/controller/ on line 10

Code: Select all

'href'      => $this->url->http('common/home'),
How can I fix it?

Bert regards,
Chris

Newbie

Posts

Joined
Sun Mar 25, 2012 2:04 pm

Post by perltk » Mon May 21, 2012 11:50 am

For the opencart 1.5.2.1... I fixed some problem
catalog\controller\custom\serwis.php change to as follow...

Code: Select all

<?php  
class ControllerCustomSerwis extends Controller {
   public function index() {
      $this->language->load('custom/serwis');
      
      $this->document->setTitle($this->language->get('heading_title'));
      
      $this->document->breadcrumbs = array();

         $this->document->breadcrumbs[] = array(
             'href'      => $this->url->link('common/home'),
             'text'      => $this->language->get('text_home'),
            'separator' => FALSE
         );
     
      $url = '';
            
      if (isset($this->request->get['page'])) {
         $url .= '&page=' . $this->request->get['page'];
      }   
         
         $this->document->breadcrumbs[] = array(
             'href'      => $this->url->link('custom/serwis' . $url),
             'text'      => $this->language->get('heading_title'),
            'separator' => $this->language->get('text_separator')
         );
      
      $this->data['heading_title']    = $this->language->get('heading_title');
      $this->data['heading_text']      = $this->language->get('heading_text');
      $this->id                   = 'content';
      $this->template             = $this->config->get('config_template') . '/template/custom/serwis.tpl';
      $this->layout               = 'common/layout';
      
     $this->response->setOutput($this->render());
   }
}
?>

Newbie

Posts

Joined
Mon May 21, 2012 11:48 am

Post by mercep » Fri Jun 29, 2012 6:39 am

Thanks for these tips. I successfully created a new page...

Newbie

Posts

Joined
Fri Jun 29, 2012 6:38 am

Post by JAY6390 » Sat Jun 30, 2012 9:09 pm

I wrote a pretty comprehensive answer on SO about this for 1.5.x
http://stackoverflow.com/questions/9490 ... 28#9491028

Image


User avatar
Guru Member

Posts

Joined
Wed May 26, 2010 11:47 pm
Location - United Kingdom

User avatar
Guru Member

Posts

Joined
Wed Nov 16, 2011 11:53 am
Location - Singapore

Post by jonah » Fri Feb 15, 2013 4:20 pm

Hi I'm also setting this up but receive this error:

Code: Select all

 Fatal error: Class 'Controllerlandingpagewty' not found in /home/www/public_html/websitename/vqmod/vqcache/vq2-system_engine_front.php on line 45
Can anybody help with this. Thanks.

Website Design, hosting, seo and online marketing visit: http://www.yorkcreative.co.uk


New member

Posts

Joined
Sun Feb 19, 2012 12:54 am

User avatar
Guru Member

Posts

Joined
Wed Nov 16, 2011 11:53 am
Location - Singapore

Post by jonah » Sat Feb 16, 2013 5:49 pm

Thanks for the fix! :)

Website Design, hosting, seo and online marketing visit: http://www.yorkcreative.co.uk


New member

Posts

Joined
Sun Feb 19, 2012 12:54 am

Post by jonah » Sat Feb 16, 2013 5:55 pm

Hi does anyone know hot to add a rewrite to the .htaccess file to direct a forward slash domain address to redirect to the ?route=landingpage/wty address so I can simplify the custom page link for publications/advertising etc?

Thanks for your help.

Website Design, hosting, seo and online marketing visit: http://www.yorkcreative.co.uk


New member

Posts

Joined
Sun Feb 19, 2012 12:54 am
Who is online

Users browsing this forum: No registered users and 41 guests