Showing posts with label Template. Show all posts
Showing posts with label Template. Show all posts

Friday 8 June 2018

Add Template ‘Empty Document’ Options in Right Click Context Menu in Ubuntu 18.04 | 17.10

New versions of Ubuntu 17.10 | 18.04 etc don’t give the option to create a new text document in right-click context menu anymore. Here is how to create new Empty Document like below image



I was trying to create a new text file in Ubuntu 18.04. I right clicked of the mouse but I didn’t see the option to create a new document. This option in the right-click context menu allowed creating an empty text file.


Step 1
Create " Empty Document " into /home/jaydip/Templates directory
Step 2
Open terminal and put following command
touch ~/Templates/Empty\ Document

Wednesday 21 September 2016

How to get value from controller to phtml / view / template file in magento

You can use magento registry for set and get values

Set a value (in controller)

Mage::register('variable_name', $variable_value);

Get a value (in phtml/view/template)

$var_value = Mage::registry('variable_name');

Monday 11 April 2016

Enable template path hint in admin Panel - Magento

There are two ways to enable admin panel path hints.

1.
You can enable template and block path hints in every store (including the admin store) by setting them in the Magento configuration. To do this, simply edit your module's configuration file app/etc/config.xml (which gets injected into Magento's global configuration).

To enable template and block path hints in the admin area add this to your app/etc/config.xml file
<config>

    ...

    <stores>
        <admin>
            <dev>
                <debug>
                    <template_hints>1</template_hints>
                    <template_hints_blocks>1</template_hints_blocks>
                </debug>
            </dev>
        </admin>
    </stores>
</config>
To disable path hints simply change to 0, or delete the node.

2.

You can do it by changing the database directly. If you have something like phpMyAdmin that is a good way to gain access. Enter this SQL.

INSERT INTO `core_config_data` (`scope`, `scope_id`, `path`, `value`)
       VALUES ('websites', '0', 'dev/debug/template_hints', '1');

When you are done with path hints just delete the matching record from core_config_data Or update the value field to 0 instead of deleting the whole record, it will probably be the last one since you've just added it.

Saturday 20 July 2013

Call Direct Template page from controller in magento.

Call Direct Template page from controller.

if ($this->getRequest()->getParam('result') > 0) {
$this->loadLayout();
            if((bool) $this->getRequest()->getParam('result')){
                $this->_initLayoutMessages('customer/session');
                $this->_initLayoutMessages('catalog/session');
                 if ($block = $this->getLayout()->getBlock('root')) {
                    $block->setRefererUrl($this->_getRefererUrl());
                }
                $this->getLayout()->getBlock('root')->setTemplate('quiz/result_rating.phtml'); //changes the root which if you want template.
            }
            $this->renderLayout();
            return $this;
}