Show or hide Attribute that is used in layered navigation based on category
By default, if an attribute is set to Use in Layered Navigation > Filterable
(with results), then this attribute will be shown on layered nav's of all categories /attribute-sets that use this attribute.
How do you control an attribute to Use in layered navigation, but only for certain categories or attributes sets where this attribute is used?
Any idea of an extension or mySql query that can manipulate this?
category attributes layered-navigation attribute-set
bumped to the homepage by Community♦ 10 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
add a comment |
By default, if an attribute is set to Use in Layered Navigation > Filterable
(with results), then this attribute will be shown on layered nav's of all categories /attribute-sets that use this attribute.
How do you control an attribute to Use in layered navigation, but only for certain categories or attributes sets where this attribute is used?
Any idea of an extension or mySql query that can manipulate this?
category attributes layered-navigation attribute-set
bumped to the homepage by Community♦ 10 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
add a comment |
By default, if an attribute is set to Use in Layered Navigation > Filterable
(with results), then this attribute will be shown on layered nav's of all categories /attribute-sets that use this attribute.
How do you control an attribute to Use in layered navigation, but only for certain categories or attributes sets where this attribute is used?
Any idea of an extension or mySql query that can manipulate this?
category attributes layered-navigation attribute-set
By default, if an attribute is set to Use in Layered Navigation > Filterable
(with results), then this attribute will be shown on layered nav's of all categories /attribute-sets that use this attribute.
How do you control an attribute to Use in layered navigation, but only for certain categories or attributes sets where this attribute is used?
Any idea of an extension or mySql query that can manipulate this?
category attributes layered-navigation attribute-set
category attributes layered-navigation attribute-set
edited Aug 14 '15 at 4:09
liyakat
3,59061933
3,59061933
asked Aug 14 '15 at 3:42
joelljoell
194
194
bumped to the homepage by Community♦ 10 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
bumped to the homepage by Community♦ 10 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
I had a similar problem and used this method to hide certain attributes on specific pages:
Open /app/design/frontend/base/default/template/catalog/layer/view.phtml
Find:
<dt><?php echo $this->__($_filter->getName()) ?></dt>
<dd><?php echo $_filter->getHtml() ?></dd>
Replace with:
<?php $tmpTitle = $this->htmlEscape($this->__($_filter->getName()));
$tmpTitle = strtolower($tmpTitle);
$tmpTitle = preg_replace("/[s]+/", "-", $tmpTitle);
$tmpTitle = str_replace("/", "-", $tmpTitle);
?>
<span class="<?=$tmpTitle?>">
<dt><?php echo $this->__($_filter->getName()) ?></dt>
<dd><?php echo $_filter->getHtml() ?></dd>
</span>
The first part takes the “title” of the attributes (set in the Manage Attributes section in the backend) and changes the “title” to lower case and places “-” in place of spaces (in case your attribute name is more than 1 word).
The second part then injects the $tmpTitle variable as a “class” tag for use with some CSS magic!
Add To you Category Description:
<style type="text/css">
.block-layered-nav .your-attribute-label { display: none; }
</style>
Hope this helps.
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "479"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f78676%2fshow-or-hide-attribute-that-is-used-in-layered-navigation-based-on-category%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
I had a similar problem and used this method to hide certain attributes on specific pages:
Open /app/design/frontend/base/default/template/catalog/layer/view.phtml
Find:
<dt><?php echo $this->__($_filter->getName()) ?></dt>
<dd><?php echo $_filter->getHtml() ?></dd>
Replace with:
<?php $tmpTitle = $this->htmlEscape($this->__($_filter->getName()));
$tmpTitle = strtolower($tmpTitle);
$tmpTitle = preg_replace("/[s]+/", "-", $tmpTitle);
$tmpTitle = str_replace("/", "-", $tmpTitle);
?>
<span class="<?=$tmpTitle?>">
<dt><?php echo $this->__($_filter->getName()) ?></dt>
<dd><?php echo $_filter->getHtml() ?></dd>
</span>
The first part takes the “title” of the attributes (set in the Manage Attributes section in the backend) and changes the “title” to lower case and places “-” in place of spaces (in case your attribute name is more than 1 word).
The second part then injects the $tmpTitle variable as a “class” tag for use with some CSS magic!
Add To you Category Description:
<style type="text/css">
.block-layered-nav .your-attribute-label { display: none; }
</style>
Hope this helps.
add a comment |
I had a similar problem and used this method to hide certain attributes on specific pages:
Open /app/design/frontend/base/default/template/catalog/layer/view.phtml
Find:
<dt><?php echo $this->__($_filter->getName()) ?></dt>
<dd><?php echo $_filter->getHtml() ?></dd>
Replace with:
<?php $tmpTitle = $this->htmlEscape($this->__($_filter->getName()));
$tmpTitle = strtolower($tmpTitle);
$tmpTitle = preg_replace("/[s]+/", "-", $tmpTitle);
$tmpTitle = str_replace("/", "-", $tmpTitle);
?>
<span class="<?=$tmpTitle?>">
<dt><?php echo $this->__($_filter->getName()) ?></dt>
<dd><?php echo $_filter->getHtml() ?></dd>
</span>
The first part takes the “title” of the attributes (set in the Manage Attributes section in the backend) and changes the “title” to lower case and places “-” in place of spaces (in case your attribute name is more than 1 word).
The second part then injects the $tmpTitle variable as a “class” tag for use with some CSS magic!
Add To you Category Description:
<style type="text/css">
.block-layered-nav .your-attribute-label { display: none; }
</style>
Hope this helps.
add a comment |
I had a similar problem and used this method to hide certain attributes on specific pages:
Open /app/design/frontend/base/default/template/catalog/layer/view.phtml
Find:
<dt><?php echo $this->__($_filter->getName()) ?></dt>
<dd><?php echo $_filter->getHtml() ?></dd>
Replace with:
<?php $tmpTitle = $this->htmlEscape($this->__($_filter->getName()));
$tmpTitle = strtolower($tmpTitle);
$tmpTitle = preg_replace("/[s]+/", "-", $tmpTitle);
$tmpTitle = str_replace("/", "-", $tmpTitle);
?>
<span class="<?=$tmpTitle?>">
<dt><?php echo $this->__($_filter->getName()) ?></dt>
<dd><?php echo $_filter->getHtml() ?></dd>
</span>
The first part takes the “title” of the attributes (set in the Manage Attributes section in the backend) and changes the “title” to lower case and places “-” in place of spaces (in case your attribute name is more than 1 word).
The second part then injects the $tmpTitle variable as a “class” tag for use with some CSS magic!
Add To you Category Description:
<style type="text/css">
.block-layered-nav .your-attribute-label { display: none; }
</style>
Hope this helps.
I had a similar problem and used this method to hide certain attributes on specific pages:
Open /app/design/frontend/base/default/template/catalog/layer/view.phtml
Find:
<dt><?php echo $this->__($_filter->getName()) ?></dt>
<dd><?php echo $_filter->getHtml() ?></dd>
Replace with:
<?php $tmpTitle = $this->htmlEscape($this->__($_filter->getName()));
$tmpTitle = strtolower($tmpTitle);
$tmpTitle = preg_replace("/[s]+/", "-", $tmpTitle);
$tmpTitle = str_replace("/", "-", $tmpTitle);
?>
<span class="<?=$tmpTitle?>">
<dt><?php echo $this->__($_filter->getName()) ?></dt>
<dd><?php echo $_filter->getHtml() ?></dd>
</span>
The first part takes the “title” of the attributes (set in the Manage Attributes section in the backend) and changes the “title” to lower case and places “-” in place of spaces (in case your attribute name is more than 1 word).
The second part then injects the $tmpTitle variable as a “class” tag for use with some CSS magic!
Add To you Category Description:
<style type="text/css">
.block-layered-nav .your-attribute-label { display: none; }
</style>
Hope this helps.
edited Oct 14 '15 at 10:11
7ochem
5,77293768
5,77293768
answered Oct 14 '15 at 10:08
WilliamWilliam
1
1
add a comment |
add a comment |
Thanks for contributing an answer to Magento Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f78676%2fshow-or-hide-attribute-that-is-used-in-layered-navigation-based-on-category%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown