HIding attributes

How to configure and adapt Aimeos based shops as developer
Forum rules
Always add your Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Doveman
Posts: 23
Joined: 06 Nov 2017, 20:59

HIding attributes

Post by Doveman » 14 Nov 2017, 22:30

I Add the following line at the bottom of "/client/html/templates/catalog/lists/body-default.php" file as was suggested by Metalics in an earlier post to suppress attributes that do no apply to poducts in the current category but it is not working and I am thinking I've missed something. Any ideas?

I have the override templates located in ./ext/zlcproject/client/... Do I have them in the correct location?

<script type="text/javascript">
$('.attribute-lists fieldset').hide();
$(function(){
$(".attr-count").each(function(){
$(this).parents('.attribute-lists fieldset').show();
});
});
</script>

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

Re: HIding attributes

Post by aimeos » 15 Nov 2017, 22:08

Yes, the location is correct. Did you've cleared the aimeos content cache or configured to disable caching for development?
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Doveman
Posts: 23
Joined: 06 Nov 2017, 20:59

Re: HIding attributes

Post by Doveman » 16 Nov 2017, 03:04

I double checked and cache is disabled in the config.yml with
aimeos_shop:
madmin:
cache:
manager:
name: None
but looking at it I think it should have the something for mshop as well as madmin but I didn't find any docs on that.

I also did a bin/console aimeos:cache

the attributes still show.

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

Re: HIding attributes

Post by aimeos » 16 Nov 2017, 21:30

The configuration is OK, as long as the indentions are correct for YAML (2 spaces for each level).
Is the Javascript available in the template? If yes, maybe it doesn't work with the HTML structure generated by the template.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Doveman
Posts: 23
Joined: 06 Nov 2017, 20:59

Re: HIding attributes

Post by Doveman » 17 Nov 2017, 04:46

It turns out that the body-default.php in my extension is not being executed. I named the extension zlcsymfony which is what the symfony install was named and is the name of the top level directory. Do I need to make some other changes to have my extensions override the aimeos extension?

The path to my body-default.php is ext/zlcsymfony/client/html/templates/catatlog/lists/

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

Re: HIding attributes

Post by aimeos » 18 Nov 2017, 11:24

Did you create your extension using the extension builder in the right version?
https://aimeos.org/developer/extensions/
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Doveman
Posts: 23
Joined: 06 Nov 2017, 20:59

Re: HIding attributes

Post by Doveman » 20 Nov 2017, 15:32

Yes I Did. I am running Aimeos Version 2017.10 with Symfony 3.3.11 on a debian linux server. I built the extension with builder 2017.x and unzipped the folder directly into the ext directory. I then copied the desired templates from ai-client-html/client/html/templates/[domain] and placed them in the appropriate directory at zlcsymfony/client/html/templates/[domain] and made my modifications there.

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

Re: HIding attributes

Post by aimeos » 20 Nov 2017, 23:23

Works as expected if you save your modifed file as
./ext/zlcsymfony/client/html/templates/catalog/lists/body-default.php

But the suggested config for disabling the cache was wrong. It must be four spaces per level in the ./app/config/config_dev.yml file (development context only):

Code: Select all

aimeos_shop:
    madmin:
        cache:
            manager:
                name: None
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Doveman
Posts: 23
Joined: 06 Nov 2017, 20:59

Re: HIding attributes

Post by Doveman » 24 Nov 2017, 16:42

Well it is still not working.
I put 2 modified files in at
./ext/zlcsymfony/client/html/templates/catalog/lists/body-default.php
and
./ext/zlcsymfony/client/html/templates/catalog/detail/body-default.php
I also fixed the /app/config/config_dev.yml file.

For debugging purposes I put in a line of code indicating core file in each of the core versions to verify which version was executing.

My only thought is I must have a typo in the extent name. Where can I find the code to verify that the name in correct and matches the configuration? Is there anything else that could be causing this?

Doveman
Posts: 23
Joined: 06 Nov 2017, 20:59

Re: HIding attributes

Post by Doveman » 24 Nov 2017, 20:41

This problem has been solved! I had to reload the entire extent. After doing so it is working.

Thanks

Post Reply