Magento category description - magento

I have the following problem.
My category description above (before the goods).
I wish to change the location of the category description. This should be at the bottom (after the goods).
I am using magento commerce 1.9

You need to find the category template, which should be in your theme directory here;
app/design/frontend/XXX/YYY/template/catalog/category/view.phtml
Where XXX YYY is the directory of the template you are using. If there is no view.phtml file in there, magento will fall back to the base version here;
app/design/frontend/base/default/template/catalog/category/view.phtml
I suggest you copy it to your theme directory if it wasnt there.
Now, open that file and find this;
<?php if($_description=$this->getCurrentCategory()->getDescription()): ?>
<div class="category-description std">
<?php echo $_helper->categoryAttribute($_category, $_description, 'description') ?>
</div>
<?php endif; ?>
And simply move it to the end of the file.

Related

How to call a static block of magento extension in .phtml file?

I have installed an extension for slider on my home page. It has given me a static block code.
Call via block:
{{block type="responsivebannerslider/index" name="responsivebannerslider_index" template="responsivebannerslider/index.phtml"}}
Dont know how call it in .phtml file?
You can call it from your template by creating a block on the layout directly in the phtml template file:
<?php echo $this->getLayout()->createBlock('responsivebannerslider/index')->setTemplate('responsivebannerslider/index.phtml')->toHtml(); ?>
Or if the block is listed in the extensions layout XML file, (which would be nested within a reference node), and would look something like:
<block type="responsivebannerslider/index" name="responsivebannerslider_index" as="an_alias" template="responsivebannerslider/index.phtml">
<label>Responsive banner</label>
</block>
And you'd call that in your template file like:
<?php echo $this->getChildHtml('an_alias'); ?>
<?php echo $this->getLayout()->createBlock('responsivebannerslider/index')->setTemplate('responsivebannerslider/index.phtml')->toHtml(); ?>

Img Src path adding / when using .SVG in Cakephp

For some reason unknown to me when I try to use a .svg file in the image src path cakephp adds an additional / to the file path which shows the image as missing.
example:
<img src="<?php e($html->url('/img/mobile/shark.svg')); ?>"
outputs:
<img src="host/img/mobile/shark.svg/"
It then thinks the file is not there. But when I remove the / in chrome inspect the file appears. Anyone see this issue before?
Update 5/1
On Cake 1.3, and beyond our control at the moment to update. These helpers just break the page =( and after looking at the documentation for 1.3 it looks like it should not.
Create a image tag using cakephp helper,
<?php echo $this->Html->image('example.svg', array('alt' => 'CakePHP')); ?>
Output will be
<img src="/img/example.svg" alt="CakePHP" />
Look HtmlHelper::image(string $path, array $options = array())
You should use the CakePhp HTML helper.
<?php echo $this->Html->image('image.svg', array('alt' => 'image')) ?>

How do I link to a pdf using CodeIgniter?

this is such a simple task, yet I can't seem to get it to load a pdf.
I have a simple link on my view that links to a pdf stored in a downloads folder.
Is there something I'm missing about doing this in CodeIgniter?
<div class="node_title_grant">
<a href="<?php echo base_url();?>index.php/downloads/grant.pdf" target="_blank">
Grant
</a>
</div>
then I have grant.pdf stored in a downloads folder in my application folder.
thanks in advance
Simply do the normal path ...
href="<?php echo base_url(); ?>application/downloads/grant.pdf"
Or:
href="/application/downloads/grant.pdf"
Edit:
I believe .htaccess was the problem. Moving the downloads folder from inside applications to the root directory solved the issue.
You want to use the anchor function here:
<div class="node_title_grant">
<?php echo anchor('downloads/grant.pdf', 'Grant', 'target="_blank"); ?>
</div>
Or, you can pass the filename to base_url:
<div class="node_title_grant">
<a href="<?php echo base_url('downloads/grant.pdf');?>" target="_blank">
Grant
</a>
</div>

Codeigniter base_url() in whack?

I was trying to set up a basic log in form with a following code:
<?=form_open(base_url() . 'main/login'); ?>
However after submitting the form the url shows this:
example.com/main/http//example.com/http//example.com/main/login
So I guess in essence for some reason the base-url is printed twice before the controller/method declaration. If I clear the base url value in my config file then the application works normally. I am however curious on what could cause this. For additional information I am working on xampp with a virtualhost and I have mod-rewrite on with a .htaccess file located at the document root.
CodeIgniter automatically adds the base_url to the action of the form when you use the form helper.
For example, you can use:
<?=form_open('main/login'); ?>
which will produce:
http//example.com/main/login
And a correct URL! Pretty simple! :D
More information at:
http://codeigniter.com/user_guide/helpers/form_helper.html
The file config.php under application/config has the setting:
$config['base_url'] = '';
Give it the folder/directory path. For example:
$config['base_url'] = 'http://localhost/ci_test/';
Don't forget to mention the protocol (http://). Alternatively try the site_url() method instead of base_url() for form opening. Skip it if using the form_open() function:
<form action="<?php echo site_url('main/login'); ?>"> ... </form>
Or
<?php form_open('main/login'); ?>
For more help: http://codeigniter.com/user_guide/helpers/url_helper.html
Not sure about the .htaccess file you have used. But this might be the answer codeigniter: why is that when i echo base_url() in an href attribute of an anchor tag, it echoes twice
Try it by parameter:
<?=form_open(base_url('main/login')); ?>
or
<?=form_open site_url('main/login')); ?>
In order to append the prefix also
You can Use
<?php echo form_open(base_url(main/login)); ?>
You have to use "echo" rather than because it not works in some browsers....

how can I change the header logo to link to an external website in magento?

I'm trying to achieve the following:
our client needs the header logo of his magento site to take him to another website (different domain).. I have tried to alter header.phtml but the link is becoming: www.websitedomain.com/index.php/www.otherdomain.com
what I want is simply to navigate to www.otherdomain.com
how is that possible?
You will want to change the link in the image to go to the appropriate location.
I believe the file should be located in:
/app/design/frontend/yourtemplate/yourtemplate/page/html/header.phtml
use http:// like bellow
http://www.otherdomain.com in your anchor tag
Just in case someone else comes here looking for the answer, in the file named above, at line 105 (v1.9.2) -
Add the url as below
<h1 class="logo"><strong class="no-display"><?php echo $this->getLogoAlt() ?></strong><img src="<?php echo $logo_src ?>" alt="<?php echo $this->getLogoAlt() ?>" /></h1>

Resources