Post by Continuous » Fri Oct 07, 2016 10:07 pm

Since OpenCart v2.3.x the Design > Layout architecture is changed.

How can I create a new position in a layout? Like positions as 'Content top' and 'Content bottom'?
I copied the files 'content_top[.tpl/.php]' that are placed in the folders: controller, language and view. I saved this copies under another name. Changed the controller headers etc.

But at the end, I can't get it work.

Discover our first class OpenCart extensions.
Request price / Quote | Negotiated Rates UPS | Modal popup | Full width slider | Free Quote Shipping Method


User avatar
Newbie

Posts

Joined
Tue Jun 28, 2016 3:02 pm

Post by harnishdesign » Mon Oct 17, 2016 12:29 pm

Have you which name set for your new position? Will need to situation as the new file name length reduce possible. Please try to your new position file name with small name. because, if, Name length will long. So, it will create issue in generate table in DB.

For example:
col_full.tpl
col_full.php

OpenCart themes: Marketshop Theme | Bigshop Theme | Moderns Theme

www.harnishdesign.net - OpenCart News, Themes and Tutorials.


User avatar
New member

Posts

Joined
Thu Jan 26, 2012 12:39 am
Location - India

Post by fido-x » Mon Oct 17, 2016 2:17 pm

This is a massive task, as it involves modifications to just about every controller and template file on the front-end. For example, you would need to add:

Code: Select all

$data['new_position'] = $this->load->controller('common/new_position');
to almost every controller in the front-end, and then "echo" that in the associated template files:

Code: Select all

<?php echo $new_position; ?>
In the back-end, you will need to add in the language entries into the design/layout controller:

Code: Select all

$data['new_position_name'] = $this->language->get('new_position_name');
Probably a few other things in there as well.

In the admin language file, you will need to add:

Code: Select all

$_['new_position_name'] = 'New Position Name';
Which you will then need to add to the layout_form.tpl file. You'll also need to edit the javascript in that file.

That's just the basics. There's probably quite a bit more that would need to be done to achieve the result you want.

Image
Modules for OpenCart 2.3.0.2
Homepage Module [Free - since OpenCart 0.7.7]
Multistore Extensions
Store Manager Multi-Vendor/Multi-Store management tool

If you're not living on the edge ... you're taking up too much space!


User avatar
Expert Member

Posts

Joined
Sat Jun 28, 2008 1:09 am
Location - Tasmania, Australia

Post by Johnathan » Mon Oct 17, 2016 10:24 pm

Rather than modify OpenCart core files, you might be interested in using Infinite Module Positions if you want to place your modules in non-standard locations. Because it uses HTML elements to hook the module onto something else on the page, it shouldn't have any limitations for positioning, and doesn't require modifying any core files.

Feel free to take a look at the screenshots and demo site, and if you're interested let me know at www.getclearthinking.com/contact if you have any further questions.

Image
Image Image Image Image


User avatar
Global Moderator

Posts

Joined
Fri Dec 18, 2009 3:08 am


Post by Continuous » Tue Oct 18, 2016 5:07 am

All steps above I made already.

In Layouts > Home (Edit)
When I select and add a module to the newly created position it look just fine.
After saving, I go to Layout > Home (Edit): the module is not added to the new position.

I think this cannot be caused thru the count of characters. I use 'content_fullwidth' instead of for example 'content_bottom'.

Discover our first class OpenCart extensions.
Request price / Quote | Negotiated Rates UPS | Modal popup | Full width slider | Free Quote Shipping Method


User avatar
Newbie

Posts

Joined
Tue Jun 28, 2016 3:02 pm

Post by Continuous » Tue Oct 18, 2016 5:14 am

I see that it may be caused because the count of characters.

Discover our first class OpenCart extensions.
Request price / Quote | Negotiated Rates UPS | Modal popup | Full width slider | Free Quote Shipping Method


User avatar
Newbie

Posts

Joined
Tue Jun 28, 2016 3:02 pm

Post by Continuous » Tue Oct 18, 2016 5:23 am

harnishdesign wrote:Have you which name set for your new position? Will need to situation as the new file name length reduce possible. Please try to your new position file name with small name. because, if, Name length will long. So, it will create issue in generate table in DB.

For example:
col_full.tpl
col_full.php
This was the solution for me. I had to change 'content_fullwidth' to 'content_fullw'.

Thank you!

Discover our first class OpenCart extensions.
Request price / Quote | Negotiated Rates UPS | Modal popup | Full width slider | Free Quote Shipping Method


User avatar
Newbie

Posts

Joined
Tue Jun 28, 2016 3:02 pm
Who is online

Users browsing this forum: No registered users and 27 guests