Static block not showing up in CMS page - magento

I just started working on magento/admin. I am trying to show my static block in one of my CMS pages, but it is not working. I tried to find out answer in google and stack exchange but no luck! Can anyone please help.Thanks.
Below are details:
This is my static block
This is my CMS page: I am able to see the text "Yes!" though.
Final output: That blue box is my CSS. (jfyi).

If you use the latest Magento version 1.9.2.2 that includes the latest patches, then you need to add first the block to Magento white list in teh backend: System->Permissions->Block.
See this article: http://www.dudesquare.nl/blog/2015/10/31/static-block-shortcodes-not-working-1-9-2-2/

Please set different identifier in static block than CMS page. I think CMS page and block identifier same so may be block not display on CMS page.
Also select all store views in static block may be your store is wrong.
And finally remove all cache and refresh all index.

Please check following:
Whether you had editor enabled, while calling static block. If yes, please click on Show/Hide Editor button and check what code is there in text area while editor mode off.
If above does not work, then go to System >> Configuration >> Advanced (Developer) and under Log Settings, Enable Logs. Then refresh cms page in frontend.
I hope this will help you resolve your issue. Please let me know if you find any problem.

Try to add static blocks through Layout Update XML in CMS Pages use something like this code. Add this code in your CMS page design tab.
<reference name="content">
<block type="cms/block" name="block.name">
<action method="setBlockId">
<block_id>block_id</block_id>
</action>
</block>
</reference>

Solution:
Step 1)Go to admin.
Step 2)Open Top menu System->Permissions->Blocks.
Step 3)click "Add New Block".
write your "Block Name" and Is Allowed "Yes".
Note: Block Name is type of your block for example "cms/block"
after Save Block.
Step 4)Clear cache and refresh front page. Now Block is showing.
Done.

Related

Facing cache issue on CMS page

I'm facing one issue on magento2.
I have created one CMS page and want to display current CART items on cms page.
So i have created on test.phtml file and call from CMS page.
{{block class="Magento\Framework\View\Element\Template" cacheable="false" template="Magento_Theme::test.phtml"}}
Whatever i have written in test.phtml file will only display if i'll clean my cache. It's not display directly if i'll update anything.
I have already written cacheable="false" but it's not working.
Can anyone please help.
Thanks in advance.
Thanks,

Unable to get category products on home page

We are using a buyshop theme from magento and trying to list a few products from every category on the home page by the following code:
{{block type="catalog/product_list" category_id="2" block_name="Bestsellers" template="izotope/products_from_category.phtml"}}
The category above has more than 2000 products, however, nothing comes up. The normal category view via the menu works perfectly fine.
Also, tried using the default magento (1.9.2.2) code as shown below with no success
{block type="catalog/product_list" category_id="your_category_id" template="catalog/product/list.phtml"}}
The same thing works perfectly fine on the localhost, however, we are unable to figure out any reason for such behavior.
We believe that it has nothing to do with the theme, it is something we are just not aware of or is probably disabled. We have tried everything including:
a. Clearing the cache
b. Checking the product status whether enabled and whether product is in stock
c. Checking whether the product is inside the category and the default store view
.....and many more small things but with no success.
Any help would really be appreciated.
Try this
{{block type="catalog/product_list" column_count="4" category_id="2" block_name="home.catalog.product.list" template="izotope/products_from_category.phtml"}}
You have to set permission for that block
Open Admin >> System >> Permissions >> Blocks >> Click on Add New Block Button
after that in Block Name filed add your block name = catalog/product_list
and set Is Allowed = Yes
click on save block button.
after that
add your cms code in cms page or static block it work fine
If it work for you then vote it up
It seems that it was because of some theme based element. I deleted the theme and tried the default theme and was working as intended.
Just finished re-installing the theme and that worked. I got a newer version from the website, probably they might have fixed it.
Thank you again for the contribution everyone. Really appreciate it.

adding slider in magento to cms page

{{block type="bannerslider/default" name="bannerslider.bannerslider" template="bannerslider/bannerslider.phtml" bannerslider_id="your_bannerslider_id"}}
I am trying to add a slider using the above code, to a cms page in Magento.
My banner id is called mySlider, so have done:
{{block type="bannerslider/default" name="bannerslider.bannerslider" template="bannerslider/bannerslider.phtml" bannerslider_id="mySlider"}}
Nothing shows.
I saw that someone recommended setting each banner to the day before it was creating but that didn't work either.
You should copy module files to your current template files. So that you have bannerslider/bannerslider.phtml in your templates folder.
Also look if slider is active and with slider content.
You should use the banner ID which is the number in the first column in the admin panel (under the section for managing the slider). What you are using now is simply the title.

Change what appears when i click on a product

i need to know how i can change the behavour of the "click event" on magento when i click on a product. Like, instead of showing its details, do somethign else. Going to page x or alert soemting, i dont care, just need some starting help on that. :) in details, i need to get lightbox instead of the details page. but imn new to magento and dont know where to start.
thanks :)
It looks like you want to execute something on the existing page, as opposed to redirecting the page to some alternative location. To do that, just add some JS to the page that intercepts the click event and performs whatever action you want. You could put this into your own JS file and load it on the product list page like this (local.xml):
<catalog_product_list>
<reference name="head">
<action method="addJs"><script>path/to/your/script.js</script></action>
</reference>
</catalog_product_list>
Hope that helps!
Thanks,
Joe

Custom block in magento

I have added this block in checkout.xml:
<block type="checkout/cart_shipping" name="checkout.cart.shipping" as="shipping" template="checkout/cart/shipping.phtml"/>
Then, I have shown this in cart.phtml:
echo $this->getChildHtml('shipping');
Then, I have made a page as shipping.phtml file in cart folder. This is working on my local PC, but when I follow this path on the server no block is showing. There is one difference between the two environments: on local I am doing all this step in the base folder, but on the server there is a customized theme folder in the default folder.
Can anyone tell me where I am wrong?
Thanks in advance.
Check design's configuration on server, is this theme really loaded.
Make sure that you added the XML correctly (without any typos). A typo in the XML would probably cause Magento to load the default checkout.xml instead of your custom one, losing your block changes.

Resources