How can i add static block in magento on category page?
I want to add a static block on my website Category page. This is the link of that page.
https://flowerportal.in/online-flower-delivery/all-cities/bangalore
I have just created some banners for Bangalore product page but I don't know how to add a static block here. If you guys can help me regarding this then I will be really happy.
magento-1.9 cms static-block
migrated from serverfault.com Aug 9 '18 at 13:53
This question came from our site for system and network administrators.
add a comment |
I want to add a static block on my website Category page. This is the link of that page.
https://flowerportal.in/online-flower-delivery/all-cities/bangalore
I have just created some banners for Bangalore product page but I don't know how to add a static block here. If you guys can help me regarding this then I will be really happy.
magento-1.9 cms static-block
migrated from serverfault.com Aug 9 '18 at 13:53
This question came from our site for system and network administrators.
This is more of a programming question than a sysadmin question. Ideally, it'll be moved to a place where it's more likely to get good answers. You could expedite that process by clicking the "flag" option on the post and asking for a migration to Stack Overflow.
– TRiG
Aug 9 '18 at 13:22
or to Magento, if such questions are on topic there. In the current state it would be off topic on SO as well.
– Gerald Schneider
Aug 9 '18 at 13:39
add a comment |
I want to add a static block on my website Category page. This is the link of that page.
https://flowerportal.in/online-flower-delivery/all-cities/bangalore
I have just created some banners for Bangalore product page but I don't know how to add a static block here. If you guys can help me regarding this then I will be really happy.
magento-1.9 cms static-block
I want to add a static block on my website Category page. This is the link of that page.
https://flowerportal.in/online-flower-delivery/all-cities/bangalore
I have just created some banners for Bangalore product page but I don't know how to add a static block here. If you guys can help me regarding this then I will be really happy.
magento-1.9 cms static-block
magento-1.9 cms static-block
edited Aug 10 '18 at 5:51
Ravi Varma
18413
18413
asked Aug 9 '18 at 13:13
piyush arorapiyush arora
11
11
migrated from serverfault.com Aug 9 '18 at 13:53
This question came from our site for system and network administrators.
migrated from serverfault.com Aug 9 '18 at 13:53
This question came from our site for system and network administrators.
This is more of a programming question than a sysadmin question. Ideally, it'll be moved to a place where it's more likely to get good answers. You could expedite that process by clicking the "flag" option on the post and asking for a migration to Stack Overflow.
– TRiG
Aug 9 '18 at 13:22
or to Magento, if such questions are on topic there. In the current state it would be off topic on SO as well.
– Gerald Schneider
Aug 9 '18 at 13:39
add a comment |
This is more of a programming question than a sysadmin question. Ideally, it'll be moved to a place where it's more likely to get good answers. You could expedite that process by clicking the "flag" option on the post and asking for a migration to Stack Overflow.
– TRiG
Aug 9 '18 at 13:22
or to Magento, if such questions are on topic there. In the current state it would be off topic on SO as well.
– Gerald Schneider
Aug 9 '18 at 13:39
This is more of a programming question than a sysadmin question. Ideally, it'll be moved to a place where it's more likely to get good answers. You could expedite that process by clicking the "flag" option on the post and asking for a migration to Stack Overflow.
– TRiG
Aug 9 '18 at 13:22
This is more of a programming question than a sysadmin question. Ideally, it'll be moved to a place where it's more likely to get good answers. You could expedite that process by clicking the "flag" option on the post and asking for a migration to Stack Overflow.
– TRiG
Aug 9 '18 at 13:22
or to Magento, if such questions are on topic there. In the current state it would be off topic on SO as well.
– Gerald Schneider
Aug 9 '18 at 13:39
or to Magento, if such questions are on topic there. In the current state it would be off topic on SO as well.
– Gerald Schneider
Aug 9 '18 at 13:39
add a comment |
3 Answers
3
active
oldest
votes
You need to add the below code to your catalog/product/view.phtml
according to your requirement and change the block_identifier with your identifier which includes the banners:
<?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('block_identifier')->toHtml(); ?>
add a comment |
Since the product page is built with the help of PHTML and XML files, you can call a static block from the layout XML file or directly from the phtml file.
Since you want to call the static block for the particular condition, I would recommend calling the block from the phtml file.
To do so, open the phtml file and call
<?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('block_identifier')->toHtml(); ?>
add a comment |
In category a page add an image above product list by follow below steps,
Admin panel
Step 1: Go to admin menu -> Product -> Categories.
Step 2: Select the category that you required.
Step 3: After upload a image click save button.
In code
Step 1: Go to app/code/Vendor/Modulename/view/frontend/layout/catalog_category_view.xml
change
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
to
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="2columns-left" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
change the layout 1column to 2columns-left
Step 2: In app/code/Vendor/Modulename/view/frontend/layout/catalog_category_view.xml
Add below line
<move element="category.image" destination="content" before="category.products" />
<move element="category.description" destination="content" after="category.image" />
Final output:
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%2f237835%2fhow-can-i-add-static-block-in-magento-on-category-page%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
You need to add the below code to your catalog/product/view.phtml
according to your requirement and change the block_identifier with your identifier which includes the banners:
<?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('block_identifier')->toHtml(); ?>
add a comment |
You need to add the below code to your catalog/product/view.phtml
according to your requirement and change the block_identifier with your identifier which includes the banners:
<?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('block_identifier')->toHtml(); ?>
add a comment |
You need to add the below code to your catalog/product/view.phtml
according to your requirement and change the block_identifier with your identifier which includes the banners:
<?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('block_identifier')->toHtml(); ?>
You need to add the below code to your catalog/product/view.phtml
according to your requirement and change the block_identifier with your identifier which includes the banners:
<?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('block_identifier')->toHtml(); ?>
answered Aug 9 '18 at 14:03
Sukumar GoraiSukumar Gorai
6,5303528
6,5303528
add a comment |
add a comment |
Since the product page is built with the help of PHTML and XML files, you can call a static block from the layout XML file or directly from the phtml file.
Since you want to call the static block for the particular condition, I would recommend calling the block from the phtml file.
To do so, open the phtml file and call
<?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('block_identifier')->toHtml(); ?>
add a comment |
Since the product page is built with the help of PHTML and XML files, you can call a static block from the layout XML file or directly from the phtml file.
Since you want to call the static block for the particular condition, I would recommend calling the block from the phtml file.
To do so, open the phtml file and call
<?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('block_identifier')->toHtml(); ?>
add a comment |
Since the product page is built with the help of PHTML and XML files, you can call a static block from the layout XML file or directly from the phtml file.
Since you want to call the static block for the particular condition, I would recommend calling the block from the phtml file.
To do so, open the phtml file and call
<?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('block_identifier')->toHtml(); ?>
Since the product page is built with the help of PHTML and XML files, you can call a static block from the layout XML file or directly from the phtml file.
Since you want to call the static block for the particular condition, I would recommend calling the block from the phtml file.
To do so, open the phtml file and call
<?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('block_identifier')->toHtml(); ?>
answered Aug 9 '18 at 14:19
Mohit Kumar AroraMohit Kumar Arora
6,51841632
6,51841632
add a comment |
add a comment |
In category a page add an image above product list by follow below steps,
Admin panel
Step 1: Go to admin menu -> Product -> Categories.
Step 2: Select the category that you required.
Step 3: After upload a image click save button.
In code
Step 1: Go to app/code/Vendor/Modulename/view/frontend/layout/catalog_category_view.xml
change
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
to
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="2columns-left" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
change the layout 1column to 2columns-left
Step 2: In app/code/Vendor/Modulename/view/frontend/layout/catalog_category_view.xml
Add below line
<move element="category.image" destination="content" before="category.products" />
<move element="category.description" destination="content" after="category.image" />
Final output:
add a comment |
In category a page add an image above product list by follow below steps,
Admin panel
Step 1: Go to admin menu -> Product -> Categories.
Step 2: Select the category that you required.
Step 3: After upload a image click save button.
In code
Step 1: Go to app/code/Vendor/Modulename/view/frontend/layout/catalog_category_view.xml
change
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
to
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="2columns-left" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
change the layout 1column to 2columns-left
Step 2: In app/code/Vendor/Modulename/view/frontend/layout/catalog_category_view.xml
Add below line
<move element="category.image" destination="content" before="category.products" />
<move element="category.description" destination="content" after="category.image" />
Final output:
add a comment |
In category a page add an image above product list by follow below steps,
Admin panel
Step 1: Go to admin menu -> Product -> Categories.
Step 2: Select the category that you required.
Step 3: After upload a image click save button.
In code
Step 1: Go to app/code/Vendor/Modulename/view/frontend/layout/catalog_category_view.xml
change
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
to
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="2columns-left" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
change the layout 1column to 2columns-left
Step 2: In app/code/Vendor/Modulename/view/frontend/layout/catalog_category_view.xml
Add below line
<move element="category.image" destination="content" before="category.products" />
<move element="category.description" destination="content" after="category.image" />
Final output:
In category a page add an image above product list by follow below steps,
Admin panel
Step 1: Go to admin menu -> Product -> Categories.
Step 2: Select the category that you required.
Step 3: After upload a image click save button.
In code
Step 1: Go to app/code/Vendor/Modulename/view/frontend/layout/catalog_category_view.xml
change
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
to
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="2columns-left" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
change the layout 1column to 2columns-left
Step 2: In app/code/Vendor/Modulename/view/frontend/layout/catalog_category_view.xml
Add below line
<move element="category.image" destination="content" before="category.products" />
<move element="category.description" destination="content" after="category.image" />
Final output:
answered 13 mins ago
divya sekardivya sekar
12010
12010
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%2f237835%2fhow-can-i-add-static-block-in-magento-on-category-page%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
This is more of a programming question than a sysadmin question. Ideally, it'll be moved to a place where it's more likely to get good answers. You could expedite that process by clicking the "flag" option on the post and asking for a migration to Stack Overflow.
– TRiG
Aug 9 '18 at 13:22
or to Magento, if such questions are on topic there. In the current state it would be off topic on SO as well.
– Gerald Schneider
Aug 9 '18 at 13:39