Magento query language in a cms page - magento

I want to display a text only for a specific language in a cms page which contains a placeholder. So I cannot use the way with the translate.csv. (see http://jagdeepbanga.com/blog/magento_how_add_translation_ability_into_cms_page_or_static_block.html) It would just display the placeholder in plane text. And since it's a CMS-Page from an plugin I can't change to a specific store view.
Is it possible to do an if query in the cms page like displayed below? (Or sort of) It should work in the cms page without the need to use or editing a phtml template.
if (store view = norsk)
{
<p>bla...</p>
{{some placeholder}}
};

I made an extension with this topic, feel free to use it or modify it!
https://github.com/miguelbalparda/MB_Translate

You can use a CMS block with a different version for each store view, and include it in your CMS page with {{block type="cms/block" block_id="your_block_id"}}

Related

Product Slide show in Magento

Hi i have tried to add a product in slide show on magento home page but it not working can you please give suggestion for How to add a product on slide show in magento?
What you need to do is :
Create a static block (something/filename.phtml).
Load product collection in the static block and filter the products which you would want to see on the slider.
Create appropriate HTML markup for the section of the page.
Use a suitable jQuery / JavaScript plugin to render the slider.
Call the static block that was created in step 1, from the CMS Page meant for homepage. This can be done using Layout Updates Section.

Magento: Insert CMS Page inside the product description

By using this code in the product description WYSIWYG editor, you can display a CMS block
{{widget type="cms/widget_block" template="cms/widget/static_block/default.phtml" block_id="01"}}
I am wondering, is there any way i can do the same with a CMS Page ?
Can i display a CMS page inside the product description from the WYSIWYG editor?
This will not work, since the product description is not passing the magento template filter system!
You could create your own widget, see Creating a Magento Widget
Then implement your logic to get cms content
protected function _toHtml()
{
//get cms content from db
}
there is a work around for it..you can try to pull the content of the cms page in your product view template file... ie in catalog/product/view.phtml file
refer here (How to call a cms page in a phtml file in magento?)

Magento dynamic block adding contents

I am new to Magento CMS, i have configured products using admin panel, at the home page
I want to list down random famous
products from different categories
dynamically.
When i list the products they appear
in the menu by their categories,
when i chose page type 3 columns
where are the source files for
column 1 and 3 how can i
change/configure them.
I installed Magento with sample data
from home page when i click upon any
item it does not display data.
I see default home page using
dynamic contents block from where to
create it and how to see it ?
I think it's better to split questions into individuals one, in order to get more accurate answers. Anyway:
1. Yoast Landing Pages allows you to create products listings of any attribute you want
2. I'm not sure to understand you, but I think what you're looking for is in app/design/frontend/[package]/[template]/layout/catalog.xml. Inside <block type="catalog/product_list" name="product_list" template="catalog/product/list.phtml"> add/modify <action method="setColumnCount"><columns>2</columns></action>
3. It seems you don't have mod_rewrite enabled in your server
4. If you're using Magento's sampla data, it is not dynamic content: check in your admin CMS -> Pages -> (Title) Home Page
Strategy for you:
make a new extension with a block and a layout file
have your layout file define the block output and use the product list template and your block
in your block make a query to magento popular products report to get the popular stuff you need
design the hell out of it and $$$$

How to Retrieve Magento Core Variables in CMS Blocks or Pages?

Changing templates isn't an option in my situation and even so if I make a full HTML page with just two integrated "product blocks: (product name, product image, product price, buy me)", it seems easier to just call the two products you need and insert them directly.
So I'm curious to know if I can retrieve Magento {{variables}} such as product names, images, prices,... . I'm perfectly happy to use Magento Custom Variables to create functions to retrieve these, but I have no idea as to where to start. Any ideas would be appreciated.
As far as I know, it's not possible, nor is it sensible, to do this all from the CMS page.
You're best bet would be to create a widget. Widgets are reusable template tags that are very similar to the blocks used in the Magento layout system.
Once your widget is made, you can then call the widget in the CMS page with a product option, {{widget type="mywidgets/productname" product_id="1"}}, and modify the widget's output based on the product id entered.
The tutorial I've linked to is very good, and should be a great starting point.

magento - add links to footer but not to top navigational menu

I want to add links to the footer - such as Customer service etc.. I do this by editing the CMS static block, footer links. However when I do this, they also appear in the very top menu.
Anyone know how to add links to the footer without them appearing in the top navigational menu?
Regards and thanks,
Fiona
Adding links to the static block will not show them on the top of the site, unless you have repeated the Block at the top of the template.
The footer links are controlled through XML and the Static Block.
There are multiple ways to achieve your need. You can include a custom block and create your own links under the CMS static blocks.
Could you expand on what exactly you are trying to achieve?
<?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('your_cms_block_identifier')->toHtml() ?>
Insert the above into the template. Create a CMS Static block with 'your_cms_block_identifier' and create your links

Resources