Where can we modify the default links of the footer in Magento? - magento

I want to get rid of the links in the footer of my website, someone started the dev of that website and left, now I can't modify it, because when I'm in the footer.phtml i can see that code :
<!-- Footer -->
<div id="footer">
<ul>
<li><?php echo $this->getCopyright(); ?></li>
</ul>
<?php echo Mage::getModel('core/variable')->loadByCode('footer_navigation')->getValue('html'); ?>
<div class="cl"> </div>
</div>
<!-- /Footer -->
I can't find the place where that class is looking for the links Mage::getModel('core/variable')->loadByCode('footer_navigation')->getValue('html')
I've been looking in catalog.xml where I found <reference name="footer_links"> but if I delet the code inside, nothing happen, it doesn't seem to be linked in any way with that.
I got the same problem in my menu where I see that class I don't understand : $categories = $this->renderCategoriesMenuHtmlCustom2(0, 'level-top'); Where does that refer too ?
Thanks :)

Login to your admin panel and go to System->Custom Variables. You should find the footer links there. You can remove the links through here (by deleting the HTML and plain-text fields), or by taking out the piece of code that loads the footer links variable (the line that calls loadByCode('footer_navigation')).
You can also delete the variable through the admin panel, but if you do this, you should also remove the code that calls it; it won't crash, but it can lead to confusion down the road.

Related

Custom option is broken my magento theme, how can i fix?

when i add a custom option in my magento product, im using magento 1.7.02 my theme broken for some reason, i tried change something in the view.phtml (template/catalog/product) but without success...
i dont know where i can change there to fix, i tried change the position from the custom option, but nothing worked
Some ideas please?
Product With Custom Option
Product without Custom Option
*the code in view.phtml
<!-- AddThis Button END -->
</div>
</div>
<div class="clearer"></div>
</form>
I can see a solution for that two tabs Product Description and Product tags are showing well
open http://www.boutiquekawaii.com/corsets/corset-test.html
go to inspect by right click and select Inspect
Now down there in Elements tab search for this class product-shop span8
you will find a div like this
<div class="product-shop span8">
....
<div class="clearer"></div> <!-- you need to move this -->
</div>
and in that div there is a div like this <div class="clearer"></div> which should not be there.That div should be after
like this
<div class="product-shop span8">
....
</div>
<div class="clearer"></div> <!-- and place it here before </form> tag -->
</form>
And you will have this result. Just like your other page.
So open that file template/catalog/product/view.phtml find <div class="clearer"></div> and change it like i said.

Get rid of additional text in footer

I can't seem to figure out out to get rid of the additional text in Magento 1.9 next to the subscribe button. Pic is attached. It's our website but don't know how it got there. Please help.
Sample
In magento Newsletter block called in this phtml file.
Path of file is :
app\design\frontend\[YOUR THEME]\template\newsletter\subscribe.phtml
In that file, the code for button is this,
<div class="actions">
<button type="submit" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Subscribe')) ?>" class="button"><span><span><?php echo $this->__('Subscribe') ?></span></span></button>
</div>
You can put your code after this, so it will appear there.
Turn ON the developers options from the admin side and referesh your page.. From there you will know from which phtml this content is loaded. go to that phtml and remove the code. If you want to remove a phtml file then you can do this from local.xml.

Magento product overview and detail separated view

I want to handle the product overivew separataly to the product detail view. I want to add additional text right behind the price in the product deatil view.
I tried to edit the view.phtml in path app/design/frontend/mytheme/default/template/catalog/product/view.phtml, refreshed caches and so on, but nothing changed.
In catalog.xml view.phtml will be load. So its seems correct.
But even when I try to echo "test" it doesnt show anything.
<?php if ($_product->getShortDescription()):?>
<div class="short-description">
<div class="std"><h2><?php echo $this->__('Details:') ?></h2>
</div>
</div>
<?php echo "test";
endif;?>
Do you have any hint?
Regards
Matt
You should enable template path hints in the backend to check which template file is used to render product page. Make sure that the cache is also disabled.

Using Laravel Blades

i have started working in Laravel, and working with .blade.php templates, but am not able to understand the benefit for using blad.php and also while having a master page, why we put our code in some other pages with #sections and #yeild
like
masterpage.blade.php
<div>
#yeild(section)
</div>
index.balde.php
#section
Hellow world
#endsection
why i need to do it like that? why we can't just put our Text in the same page instead of doing this method, what are the benefits if we code like that.
There are lot of benefits in using Blade with Laravel, please read it here
http://culttt.com/2013/09/02/using-blade-laravel-4/
The short answer for you questions is we do not need Blade engine in any project. However, using it brings many benefits.
Simplify script file
Like other templating engine, Blade engine simplify your PHP scripts by some replacement such as :
<?php echo $foo ?> changed to {{ $foo }} (reduce 8 characters)
<?php if ($condition): ?> changed to #if ($condition) (reduce 6 characters)
<?php echo trans('lang.key') ?> changed to #lang('lang.key') (reduce 11 characters)
...
Try to calculate how many character you can save if using Blade engine in your script.
Another thing I love in Blade engine is that we can create our own custom control structure. If you are tired of typing $var->format('Y-m-d H:i:s') every time you need to output a DateTime object. You can create custom matcher with Blade
Blade::extend(function($view, $compiler)
{
$pattern = $compiler->createMatcher('datetime');
return preg_replace($pattern, '$1<?php echo $2->format('m/d/Y H:i'); ?>', $view);
});
Now, all you need to to is replace $var->format('Y-m-d H:i:s') by #datetime($var).
View inheritant
By supporting section, Blade engine help developer organize their view file in a hierarchical and logical way. Imagine that you have HTML code for some pages of your website: a home page, a category archive page and a single post page. All there page have the same header, footer and sidebar. If we " put our Text in the same page instead of doing this method", the content of there files have a large amount of similarities, which cause any changes in the future very painful.
With Blade sections, create a simple master layout file like that
<html>
<body>
#section('sidebar')
<!-- this is header code -->
#show
#section('sidebar')
<!-- this is sidebar code -->
#show
<div class="container">
#yield('content')
</div>
#section('footer')
<!-- this is footer code -->
#show
</body>
</html>
In the view file for each page, you only need to take care of the main content of the page, instead of other parts.

How to add topLinks to a cms page in magento

The answer is probably out there as a combination of several posts but I am not very good at Magento yet so I have to ask anyway:
I would like to have the topLinks inserted into a cms page.
I tried <?php echo $this->getChildHtml('topLinks') ?> but that does not work, it just shows the code as text on the page.
I tried {{block type="core/template" name="top.Links" as="topLinks" template="page/template/links.phtml"}} but nothing shows up.
I did successfully add the search form to the cms page with {{block type="core/template" name="top.search" as="topSearch" template="catalogsearch/form.mini.phtml"}} so I figured I probably just have the block type wrong or something.
What did I do wrong?
TL;DR: Well...You can't.
Why?:The topLinks block is a "container" block of type page/template_links. This is just added in the layout, but other layout handles or blocks add links to it. For example this part of xml in the customer.xml layout file
<reference name="top.links">
<action method="addLink" translate="label title" module="customer"><label>My Account</label><url helper="customer/getAccountUrl"/><title>My Account</title><prepare/><urlParams/><position>10</position></action>
</reference>
adds the My account link to it. There are others.
In conclusion the topLinks block does not have meaning on it's own. It is just a placeholder that can e modified by other blocks.
When a cms page is rendered the layout is already loaded parsed, so the block you add cannot be modified anymore by other blocks or layout files.
You can hardcode put top links in your cms pages like this..
<ul id="nav">
<li class="level0 parent"><span>My Account</span></li>
<li class="level0 parent"><span>My Wishlist</span></li>
<li class="level0 parent"><span>My Cart</span></li>
<li class="level0 parent"><span>Checkout</span></li>
<li class="level0 parent"><span>Log In</span></li>
</ul>
#Marius Thanks, I learned something new there. I am still struggling with understanding the intricate details of Magento's structure but I'm working on it.
#chirag I tried that but php does not work directly in cms pages so it tries to link to http://mymagentopage/<?php echo $this->getUrl('customer/account')?>. I can of course link directly to http://mymagentopage/customer/account but for a few links I would miss functionality:
"Login" changing to "Logout" when logged in and logging the customer out instead of going to the account screen.
"Cart" changing to "Cart(2)" when product is added to the cart.
etc (I don't use wishlist)
Is there a way to regain this functionality?
I found this snippet that does it but it's php which won't work in cms pages:
<?php if (Mage::getSingleton('customer/session')->isLoggedIn()==0): ?>
<?php echo $this->__('Log In') ?>
<?php else: ?>
<?php echo $this->__('Log Out') ?>
<?php endif ?>I would also be happy with a solution to enable me to use php in cms pages, I am the only admin anyway.
EDIT
I found a working solution:
I created a new phtml file containing the above mentioned snippet. I created a new folder 'customphp' in my template folder and saved it there as test.phtml.
In the cms page I added a block: {{block type="core/template" name="whatever_unique-name-i-want" template="customphp/test.phtml"}}
Tada!
This is where I got the idea: http://www.magentocommerce.com/boards/viewthread/439880/

Resources