Overwrite existing templates (Laravel)

Help for integrating the Laravel package
Forum rules
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Yvler
Posts: 33
Joined: 04 Jun 2015, 10:15

Overwrite existing templates (Laravel)

Post by Yvler » 04 Jun 2015, 10:19

First: thank you for the magnificent shop pack :) Good work

We're trying to change the existing html-templates via an extension. We downloaded the extension via your website (extension builder) and named the dir "ai-optiphar" and placed it in the "ext" dir in our laravel installation.
In the "client/html/layouts" dir we created a dir "catalog/list" with a copy of the "items-body-default.html" file, which we renamed to "items-body-optiphar.html"

But.. still we don't see any difference when we change the text in this HTML file.
Is there an autoloader for these extended layout files, or do we have to change a config file first?
It's pretty vague in the documentation.

User avatar
aimeos
Administrator
Posts: 3097
Joined: 01 Jan 1970, 00:00

Re: Overwrite existing templates (Laravel)

Post by aimeos » 04 Jun 2015, 10:36

Yvler wrote:First: thank you for the magnificent shop pack :) Good work
Thank you very much! That's always nice to hear :-)
Yvler wrote: We're trying to change the existing html-templates via an extension. We downloaded the extension via your website (extension builder) and named the dir "ai-optiphar" and placed it in the "ext" dir in our laravel installation.
In the "client/html/layouts" dir we created a dir "catalog/list" with a copy of the "items-body-default.html" file, which we renamed to "items-body-optiphar.html"
You have two options:
- Either leave the name the same (items-body-default.html) and the extension template will be automatically used instead
- Configure your new template if you still want to use the old one somewhere (details are available in http://aimeos.org/docs/Configuration/Co ... oduct_list)

Yvler
Posts: 33
Joined: 04 Jun 2015, 10:15

Re: Overwrite existing templates (Laravel)

Post by Yvler » 04 Jun 2015, 11:04

Got i!
Thanks

anilsharma
Posts: 5
Joined: 19 Jan 2016, 19:45
Contact:

Re: Overwrite existing templates (Laravel)

Post by anilsharma » 19 Jan 2016, 20:06

Hi guys , I am also following the same process . I have renamed extention folder in ext folder as ai-templates and copied all html files from vendor folder to this ext file . But does not looks like working . After copying also have done composer autoload but same thing , even had flushed cache too (from shop admin). So am i missing something :?:

User avatar
aimeos
Administrator
Posts: 3097
Joined: 01 Jan 1970, 00:00

Re: Overwrite existing templates (Laravel)

Post by aimeos » 19 Jan 2016, 21:27

anilsharma wrote:Hi guys , I am also following the same process . I have renamed extention folder in ext folder as ai-templates and copied all html files from vendor folder to this ext file . But does not looks like working . After copying also have done composer autoload but same thing , even had flushed cache too (from shop admin). So am i missing something :?:
What files did you copy and to what path?
It's hard to say what's wrong without more details.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

anilsharma
Posts: 5
Joined: 19 Jan 2016, 19:45
Contact:

Re: Overwrite existing templates (Laravel)

Post by anilsharma » 20 Jan 2016, 09:30

Ah sorry for the confusion :? , This is how i have proceeded so far :

I created a aimeos extension from your site link and pasted whole folder to ext folder in path laravel-folder/ext .

Inside extension folder which is ai-templates : path ai-templates/client/html/layouts , i have copied all html core files from vendor/aimeos/aimeos-core/client/html/layouts/* to ai-templates/client/html/layouts .

So while testing i can see that still it is calling files from my vendor core folder . Am i missing something ? How these core templates will be overwritten ? Let me know if you need more info .

Thanks.

User avatar
aimeos
Administrator
Posts: 3097
Joined: 01 Jan 1970, 00:00

Re: Overwrite existing templates (Laravel)

Post by aimeos » 20 Jan 2016, 12:29

anilsharma wrote: Inside extension folder which is ai-templates : path ai-templates/client/html/layouts , i have copied all html core files from vendor/aimeos/aimeos-core/client/html/layouts/* to ai-templates/client/html/layouts .
You should only copy the template files you want to change so the others will get updated if necessary.
anilsharma wrote:So while testing i can see that still it is calling files from my vendor core folder . Am i missing something ? How these core templates will be overwritten ? Let me know if you need more info .
Did you've deactivated caching for development?
https://github.com/aimeos/aimeos-laravel#hints
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

anilsharma
Posts: 5
Joined: 19 Jan 2016, 19:45
Contact:

Re: Overwrite existing templates (Laravel)

Post by anilsharma » 20 Jan 2016, 18:57

Yes i have disabled it . But same problem .

Am i following correct process , First just copy dowloaded extension to laravel ext folder and then just put templates inside layouts folder . Do we need to do something else apart from this ?

User avatar
aimeos
Administrator
Posts: 3097
Joined: 01 Jan 1970, 00:00

Re: Overwrite existing templates (Laravel)

Post by aimeos » 25 Jan 2016, 10:00

anilsharma wrote: Am i following correct process , First just copy dowloaded extension to laravel ext folder and then just put templates inside layouts folder . Do we need to do something else apart from this ?
No, normally not. Can you make your Aimeos extension available somewhere?
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

User avatar
aimeos
Administrator
Posts: 3097
Joined: 01 Jan 1970, 00:00

Re: Overwrite existing templates (Laravel)

Post by aimeos » 25 Jan 2016, 21:37

Please clear the cache with

Code: Select all

./artisan aimeos:cache
If it works now, the configuration is wrong. If not then there's something wrong in the extension.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply