Page 1 of 1

HIding attributes

Posted: 14 Nov 2017, 22:30
by Doveman
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>

Re: HIding attributes

Posted: 15 Nov 2017, 22:08
by aimeos
Yes, the location is correct. Did you've cleared the aimeos content cache or configured to disable caching for development?

Re: HIding attributes

Posted: 16 Nov 2017, 03:04
by Doveman
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.

Re: HIding attributes

Posted: 16 Nov 2017, 21:30
by aimeos
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.

Re: HIding attributes

Posted: 17 Nov 2017, 04:46
by Doveman
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/

Re: HIding attributes

Posted: 18 Nov 2017, 11:24
by aimeos
Did you create your extension using the extension builder in the right version?
https://aimeos.org/developer/extensions/

Re: HIding attributes

Posted: 20 Nov 2017, 15:32
by Doveman
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.

Re: HIding attributes

Posted: 20 Nov 2017, 23:23
by aimeos
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

Re: HIding attributes

Posted: 24 Nov 2017, 16:42
by Doveman
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?

Re: HIding attributes

Posted: 24 Nov 2017, 20:41
by Doveman
This problem has been solved! I had to reload the entire extent. After doing so it is working.

Thanks