thirtybees / niara

Niara, thirty bees default theme since v1.1.0.
https://thirtybees.com
9 stars 26 forks source link

No comments, very confusing, user and dev unfriendly #51

Closed CasualRascal closed 2 years ago

CasualRascal commented 2 years ago

Hi I am here to complain about the theme having no comments.

I find it extremely difficult to understand what is going on.

I've been spending hours in the order-opc-new-account.tpl trying to understand all the smarty tags being used, many of which seem to be specific to prestashop/thirty bees which also lack documentation.

In some templates there are hooks called with {hook h=', here there is {$HOOK_CREATE_ACCOUNT_TOP}. Manually searching code it points to controllers/front/AuthController.php which executes displayCustomerAccountFormTop aliased to createAccountTop. I can't understand what this hook calls and the fact that the file is devoid of comments makes it all the more frustrating.

The CSS calls for a max width of 280px on each input field, but all the input fields are left-aligned. On a 4k display this looks absolutely ridiculous. Editing the template is then necessary for acceptable user experience except that the sheer amount of code with no explanation makes is intimidating to edit.

getdatakick commented 2 years ago

I've been spending hours in the order-opc-new-account.tpl trying to understand all the smarty tags being used, many of which seem to be specific to prestashop/thirty bees which also lack documentation. In some templates there are hooks called with {hook h=', here there is {$HOOK_CREATE_ACCOUNT_TOP}. Manually searching code it points to controllers/front/AuthController.php which executes displayCustomerAccountFormTop aliased to createAccountTop. I can't understand what this hook calls and the fact that the file is devoid of comments makes it all the more frustrating.

Seems to be that you don't have good understanding what hooks are used for. They are basically a placeholder in template. Any module developer can inject any html code into this placeholder.

Hooks are either called explicitly from template using {hook h='hookName'} syntax. Alternatively, they can be called from php, and hook output (potentially transformed) assigned to some variable (like HOOK_CREATE_ACCOUNT_TOP) passed to templating engine.

Core/Theme does not have any expectation about hook content.

The CSS calls for a max width of 280px on each input field, but all the input fields are left-aligned. On a 4k display this looks absolutely ridiculous. Editing the template is then necessary for acceptable user experience except that the sheer amount of code with no explanation makes is intimidating to edit.

Not sure what to tell you here. Templates can indeed be complicated.

On a related note - why do you have a need to modify template? The problem you are describing calls for css modification.

CasualRascal commented 2 years ago

Seems to be that you don't have good understanding what hooks are used for. They are basically a placeholder in template. Any module developer can inject any html code into this placeholder.

Thanks for the explanations, however I already knew that.

Hooks are either called explicitly from template using {hook h='hookName'} syntax. Alternatively, they can be called from php, and hook output (potentially transformed) assigned to some variable (like HOOK_CREATE_ACCOUNT_TOP) passed to templating engine.

This is something I did not know, and I could not find this information anywhere. When that hook is called there is no way of knowing from the template what exactly the hook is. This is important because one needs to know what code is injected when developing a theme.

Not sure what to tell you here. Templates can indeed be complicated.

They sure are complicated when there are no comments in them

There is no list of what templates are called by core, and when. There are several template files with similar names some with even almost identical content with no information on what the difference between them is.

On a related note - why do you have a need to modify template? The problem you are describing calls for css modification.

No, it doesn't just require CSS modification. The input fields are all in the same column so they all stack on each other. They have to be split into different columns if you want them to be on different columns, and the template is a mess with no spacing nor comments, it is really awful to work with the way it is now.

Coachonko commented 2 years ago

See line 121-123 of shopping-cart-product-line.tpl. I would like to add a comment right there expressing my regret accepting a job with thirty bees.

      {else}

      {/if}

This shopping cart is built for thirty bees developers and nobody else

getdatakick commented 2 years ago

See line 121-123 of shopping-cart-product-line.tpl. I would like to add a comment right there expressing my regret accepting a job with thirty bees.

      {else}

      {/if}

This shopping cart is built for thirty bees developers and nobody else

Well, actually this theme is descendent of comunity-theme-default, which is a descendent of ps16 theme-default. This particular code exists even in that theme:

https://github.com/PrestaShop/community-theme-16/blob/283d448e9d5b7ed8f8ae0376ce5edc58c55dbd52/themes/community-theme-16/shopping-cart-product-line.tpl#L95

So this shopping cart is built not only for tb developers, but also all ps16 developers as well.

I'm quite sure that if you look into any premium themes, you will find this code there as well. The curse of code sharing...

Coachonko commented 2 years ago

Well, actually this theme is descendent of comunity-theme-default, which is a descendent of ps16 theme-default. This particular code exists even in that theme:

I owe you my apologies.

Also ouch.