Jump to content

Add new element inside product new


Recommended Posts

Hello @FrediKa,

 

I think you have miss something when ou read the documentation :

Quote

if you need more informations, you must create a new template and use this syntax

 

In this case, it's recommended to create a new template and to include your modification, but not inside the original template.

I suppose this approach is made if there is an update about this template.

Link to post

You have 2 choice

1 - Create a new template inside template_html directory and call after across the options

2 - Create a new products_new.php with your option and call your template if the first doesn't allow you to make what you want.

Link to post

@FrediKa,

There an example.

 

the process:

edit

fp_new_products.php

rename in

fp_my_file.php

 

Inside
replace

 fp_new_product

by

fp_my_file

replace :

front_page_new_products 

by

front_page_my_file

replace :

FRONT_PAGE_NEW_PRODUCTS

by

FRONT_PAGE_MY_FILE

 

eventually you can change the template directory :

'/template_html/' . MODULE_FRONT_PAGE_NEW_PRODUCTS_TEMPLATE 

by

 '/template_html/' . MODULE_FRONT_PAGE_MY_TEMPLATE_DIRECTORY

 

Do not forget to change the language
Do not forget to change the css


Now you are ready to implement your code.

 

This is a short cut to help you how to make a new template_html with a template directory but you can use also the default template_html

 

Now do not forget to include your new contribution inside the Default template and also in your new template directory. Like that you can change everything without to change anything inside the default template directory.

Why you must include your new contribution in the Default directory and not only the new template directory ?
It's the DB initialization is made by default inside the  Default directory.
Like all the module are overridden in function the Default Directory, you have no choice to include the new element inside the Default directory.

It's the limitation.
I hope it's not little too complex, but after one or to test, you will understand the process.

 

 

 

 

  • Thanks 3
Link to post
3 minutes ago, FrediKa said:

Ok, it's a little complex for a newbie like me, I must practice a little. As you said, it's better to create another file and change why we need inside

 

As I understand, yes it's better, and you reduce the maintenance. But I want to say, if there an upgrade, your file can be impacted if there is inside the core an evolution.

But it's the same for all software.

I suppose we will have a note if something happens to let the time to take this in consideration.

Link to post

Hello,

Looking a little the code after my first installation.
I think you can choose only the files like you want to insert a new template. but about the css, you must copy all inside the new template.

But like it's my first reaction, I forgot something. Maybe someone has more knowledge can write more about that.

Link to post

@Ronaldo

Yes, you have right, some files can be overridden inside a new template. But all the modules must be also in the default template because the system read in first the default template and install the element in the bd.

 

  • Thanks 2
Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use