Magento - How do you return results of unlimited CMS Static blocks (with certain quot;Identifierquot;) to a CMS Page(Magento - 您如何將無限 CMS 靜態塊(具有特定“標識符)的結果返回到 CMS 頁面) - IT屋-程序員軟件開發
Quick Overview: I am trying to return results from a specific set of static blocks to a phtml file (which is then called on from a cms page) in Magento.
Note: I've been searching all over google and some answers get me closer than others but nothing I've tried seems to work 100%?
Details:
I already have a set of specific static blocks that all start with an identifier of testimonial-. For example, each static block is like this: testimonial-1, testimonial-2, testimonial-3 and so on. I have a total of 5 on my dev site (more on live site but that is no consequence here).
I have a CMS Page with code pulling in the name.phtml file (location of my phtml file is here: app/design/frontend/[package]/[template]/template/page/):
However, the only block that is echoed is the last block (testimonial-5). Since I'm trying to list out all the testimonial blocks, how can I echo out each block id to the page?
Go easy on me, I'm a beginner at php.
解決方案
You are not printing block inside foreach loop.
Solution: move } parenthesis to the end of pasted code
I think that on Magento Connect are some Testimonial Modules, that are doing job you want.
On the other hand, if you are looking for 'simple' solution or if you are trying to play with Magento, is this approach ok.