Post by Qphoria » Wed Apr 07, 2010 3:11 am

I'd like things like "Latest Products" on the homepage to be more modular so that you can add more (Latest, Featured, Popular, Specials, etc) and enable, configure, etc them from the admin area. I'd also like to be able to use these modules on other pages aside from home so you can show things like Featured products on things like the cart page or any page you like which would be good for upselling.

So I'm wondering the best way.

Option 1: Create a new "Blocks" type which I believe is the term Dragonfly, phpnuke, etc use for centered modules. Then there would be its own catalog/controller/blocks/xxx.php path

Option 2: Use the current "module" area for these new "Content Modules" and just name them accordingly:
popular_center
latest_center
specials_center

I'm leaning towards option 1

For placement, the center would be the main idea, header and footer don't really have room unless the module is specifically designed for those locations, which would likely just be better off hardcoded in.

Thoughts?

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by i2Paq » Wed Apr 07, 2010 3:47 am

"blocks" is commonly used, so to be equal and recognizable in comparison with colleague carts I would use that name.

And I do like your idea about creating such blocks but I'm not sure why not use the module section as they are modules that contain content and will only show in the center of the store.
But on the other hand, the bestseller module is only showing content to, and that is called a module. Does this mean these will all be renamed so that it is clear that this "block" only show content?

So a module is named a module when it is used for: Payment, Shipping etc.
It is called a block when used for showing special content like: Specials, Infopages etc.
Makes sence to me.
Last edited by i2Paq on Wed Apr 07, 2010 3:55 am, edited 3 times in total.
Reason: changed

Norman in 't Veldt
Moderator OpenCart Forums

_________________ READ and Search BEFORE POSTING _________________

Our FREE search: Find your answer FAST!.

[How to] BTW + Verzend + betaal setup.


User avatar
Global Moderator

Posts

Joined
Mon Nov 09, 2009 7:00 pm
Location - Winkel - The Netherlands

Post by Qphoria » Wed Apr 07, 2010 4:08 am

Well let me clarify. by "Content" I mean the section of the template. Not what is inside of the box. The center area of a website is commonly called the "content" area or the "center"

And you use the term "module" too loosely.

a "module" in the terms of OpenCart is foremost a "Sidebox"

Extensions:
- Module - Sideboxes mostly
- Payment - payment integration options
- Shipping - shipping integration options
- Order Totals - Confirmation page totals
- Feeds - Product feeds
- Affiliates - tbd

Since the word "Module" is so ambiguous, I fear that putting "center" modules along with "sidebox" modules might be confusing, so I figured the name "Blocks" is a good differentiator. Although, "Blocks" is equally ambiguous and Joomla refers to "blocks" as sideboxes.. so its a mess either way. But focusing on OpenCart, should "Blocks" be used to define "center modules" ?

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by Xsecrets » Wed Apr 07, 2010 4:28 am

I really saw no problem with the way the homepage mod did it. It's pretty easy to write your modules so they change when homepage is selected to look proper in the content area. The only issue with that is it doesn't have the ability to put things on pages other than the homepage.

OpenCart commercial mods and development http://spotonsolutions.net
Layered Navigation
Shipment Tracking
Vehicle Year/Make/Model Filter


Guru Member

Posts

Joined
Sun Oct 25, 2009 3:51 am
Location - FL US

Post by i2Paq » Wed Apr 07, 2010 5:00 am

Qphoria wrote:a "module" in the terms of OpenCart is foremost a "Sidebox"

Extensions:
- Module - Sideboxes mostly
- Payment - payment integration options
- Shipping - shipping integration options
- Order Totals - Confirmation page totals
- Feeds - Product feeds
- Affiliates - tbd

Since the word "Module" is so ambiguous, I fear that putting "center" modules along with "sidebox" modules might be confusing, so I figured the name "Blocks" is a good differentiator. Although, "Blocks" is equally ambiguous and Joomla refers to "blocks" as sideboxes.. so its a mess either way. But focusing on OpenCart, should "Blocks" be used to define "center modules" ?
If you put it that way, Blocks would be a good choice.

Norman in 't Veldt
Moderator OpenCart Forums

_________________ READ and Search BEFORE POSTING _________________

Our FREE search: Find your answer FAST!.

[How to] BTW + Verzend + betaal setup.


User avatar
Global Moderator

Posts

Joined
Mon Nov 09, 2009 7:00 pm
Location - Winkel - The Netherlands

Post by Qphoria » Wed Apr 07, 2010 5:30 am

Xsecrets wrote:I really saw no problem with the way the homepage mod did it. It's pretty easy to write your modules so they change when homepage is selected to look proper in the content area. The only issue with that is it doesn't have the ability to put things on pages other than the homepage.
I was torn on that too. Homepage mod added a third option to position. But what if you want Featured sidebox to show 10 items always but also featured on the homepage to show only 4 at the top of the homepage. Again, as you said, what if you want it somewhere else besides the homepage. That is why I thought blocks may be better.

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by OSWorX » Wed Apr 14, 2010 12:49 am

From my point of view, this is the wrong approach.

1. A module is something which displays existing data
2. A module should be displayed anywhere - no matter which position YOU prefer!
3. Template designers should be able to define positions THEY like (or the users - see #6)
4. Positions (for modules) could be everywhere: top, banner, left, right, footer, etc.
5. Module positions should be not fixed (as they are now) - the positions should be read from the template and dynamically selectable (admin)
6. Finally OC should be able to let the admin define their own position (names) like Joomla does (if you call Joomla as reference)
7. No matter where a 'Module' is displayed, renaming some to a 'Block' which will be only displayed in the center (which one and what for ??) will confuse the people more

btw: could you point me please where Joomla use 'blocks' or 'sideboxes' as official term?

Full Stack Web Developer :: Dedicated OpenCart Development & Support DACH Region
Contact for Custom Work / Fast Support.


User avatar
Administrator

Posts

Joined
Mon Jan 11, 2010 10:52 pm
Location - Austria

Post by Qphoria » Wed Apr 14, 2010 1:15 am

OSWorX wrote:From my point of view, this is the wrong approach.

1. A module is something which displays existing data
2. A module should be displayed anywhere - no matter which position YOU prefer!
3. Template designers should be able to define positions THEY like (or the users - see #6)
4. Positions (for modules) could be everywhere: top, banner, left, right, footer, etc.
5. Module positions should be not fixed (as they are now) - the positions should be read from the template and dynamically selectable (admin)
6. Finally OC should be able to let the admin define their own position (names) like Joomla does (if you call Joomla as reference)
7. No matter where a 'Module' is displayed, renaming some to a 'Block' which will be only displayed in the center (which one and what for ??) will confuse the people more
You may be right. I guess the point then is that modules will need to have different tpl files for their positions. Or the tpl file will have some conditionals based on its position to determine which html to display.

btw: could you point me please where Joomla use 'blocks' or 'sideboxes' as official term?
Highly irrelevant but surmised from: http://www.google.com/search?q=joomla+b ... =firefox-a

I originally got the "blocks" term from phpnuke and DragonflyCMS

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by vimal » Wed Apr 14, 2010 3:38 am

I think it will look quite pretty in the footer. See example that I am working on...Btw I need help too with it..Link here..

http://forum.opencart.com/viewtopic.php?f=21&t=13311

Image
Qphoria wrote:For placement, the center would be the main idea, header and footer don't really have room unless the module is specifically designed for those locations, which would likely just be better off hardcoded in.

www.beeshop.se
Starta webbshop, Starta e-butik, Starta e-handel


Active Member

Posts

Joined
Wed Aug 26, 2009 8:54 am
Location - Sweden

Post by Qphoria » Wed Apr 14, 2010 3:59 am

Yea I guess in your example it does, but thats a custom job to have a footer that tall. I guess I'll leave it up to the theme maker to handle it tho

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by gocreative » Wed Apr 14, 2010 7:28 am

As a designer, to me this discussion raises the question of how the HTML/CSS is coded in OpenCart. I don't find it to be particularly flexible. It can be modified as much as I like, but the way some of it is coded doesn't allow for dynamically displaying what you're referring to here as "blocks".

For example, I recently added some additional content to the header of an OpenCart installation and had to re-work the entire header section to accommodate this in all browsers.

From a user standpoint, I would like to be able to activate/install any "block" that I like, and then choose where it is displayed (header, footer, content, left column, right column) as well as its priority (i.e. order that the blocks appear).

Perhaps it might be best to have some standard blocks that are not simply enabled/disabled, but installed as a new instance. For example, a block called "Most viewed products" could be installed in the content area and assigned a priority etc, then another instance of this block could be installed in the right column with its own settings.

User avatar
Active Member

Posts

Joined
Tue Jan 12, 2010 5:46 pm

Post by Qphoria » Wed Apr 14, 2010 10:27 am

Well that goes without saying. Its a simple forloop. Check the catalog/view/theme/default/template/common/column_left.php file. Its a simple 5 lines of code so there is no problem there.
That isn't an issue. That would obviously be added to each section

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by vimal » Wed Apr 14, 2010 10:25 pm

Sorry to divert...
Q, the tpl files have the same code for all modules. Even though I add the required code in the controller file, since the template file has same code for all module it only picks up the 1st module code in the controller file. Is there a smart way to handle this? As you can see in my pic, all the module boxes have come up to be bestsellers.
Qphoria wrote:Yea I guess in your example it does, but thats a custom job to have a footer that tall. I guess I'll leave it up to the theme maker to handle it tho

www.beeshop.se
Starta webbshop, Starta e-butik, Starta e-handel


Active Member

Posts

Joined
Wed Aug 26, 2009 8:54 am
Location - Sweden

Post by Qphoria » Wed Apr 14, 2010 11:18 pm

Your example is based on a custom theme. The default theme doesn't have that much height to put a box so it would need to have its own tpl.

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by Qphoria » Thu Apr 15, 2010 7:21 pm

I think I will stick with the term "module" for all and add position code for all places:
header, banner, left, right, center, footer

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by Xsecrets » Thu Apr 15, 2010 9:32 pm

so are you going to give up on the idea of being able to choose pages?

OpenCart commercial mods and development http://spotonsolutions.net
Layered Navigation
Shipment Tracking
Vehicle Year/Make/Model Filter


Guru Member

Posts

Joined
Sun Oct 25, 2009 3:51 am
Location - FL US

Post by Qphoria » Fri Apr 16, 2010 12:01 am

Xsecrets wrote:so are you going to give up on the idea of being able to choose pages?
Which idea?
my plan in my head is:
- Add additional positions
- Figure out how to handle the tpl for those different positions
- Add a list of the main controller pages that these will show on. Which means I will probably have to do this "per-position" which adds some complexity.
- Add some backwards compatibility for 3rd party modules that don't have these new features.

I guess something like this:

Image

Unless someone has a better idea

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by i2Paq » Fri Apr 16, 2010 1:30 am

Qphoria wrote:
I guess something like this:

*knip*

Unless someone has a better idea
Looking good!

Norman in 't Veldt
Moderator OpenCart Forums

_________________ READ and Search BEFORE POSTING _________________

Our FREE search: Find your answer FAST!.

[How to] BTW + Verzend + betaal setup.


User avatar
Global Moderator

Posts

Joined
Mon Nov 09, 2009 7:00 pm
Location - Winkel - The Netherlands

Post by datacon » Mon Apr 19, 2010 9:58 am

I like it Q!

New member

Posts

Joined
Tue Nov 17, 2009 11:10 am

Post by Qphoria » Mon Apr 19, 2010 11:01 am

Ok so the question is.
How to handle templates?
I could do
1 tpl file with If/Else statements:

Code: Select all

if ($position == 'header' ) {
  // header module tpl code here
} elseif ($position == 'center') {
  // center module tpl code here
} elseif ($position == 'footer') {
  // footer module tpl code here
} else {
  //left or right module code here
}
OR

1 tpl for each position:
cart_header.tpl
cart_center.tpl
cart_footer.tpl
cart.tpl (left or right)

I'm leaning towards the first one, tho I think the second way is more proper, but there are so many more files that it can get unruly and harder to maintain

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am
Who is online

Users browsing this forum: No registered users and 6 guests