3

So I have found a very simple news ticker that I would like to add to the top of my website. The installation instructions aren't very clear, all they say is:

Set Up
Just go to this file:
frontend/base/default/template/page/html/breadcrumbs.phtml and call the "newsticker" block in the file after the license and the newsticker will be displayed based on settings in admin.

I just wondered if anybody here can provide clearer instructions, so I can get this up and running?

1
  • J Granty, has the answer provided by Siarhey solved your problem? Please mark the answer as the accepted answer.
    – 7ochem
    Mar 29, 2016 at 18:50

1 Answer 1

2

Open frontend/{your_package}/{your_theme}/template/page/html/breadcrumbs.phtml and insert the code at the top of the template:

<?php echo $this->getChildHtml('newsticker'); ?>

Here is my template (base/default):

<?php
/**
 * Magento
 *
 * NOTICE OF LICENSE
 * .....
 * @category    design
 * @package     base_default
 * @copyright   Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com)
 * @license     http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
 */
?>
<?php
if (Mage::getStoreConfigFlag('yantrakaar_newsticker/yantrakaar_newsticker_settings/enabled')) {
    echo $this->getChildHtml('newsticker');
}
?>
<?php if($crumbs && is_array($crumbs)): ?>
<div class="breadcrumbs">
    <ul>
        <?php foreach($crumbs as $_crumbName=>$_crumbInfo): ?>
            <li class="<?php echo $_crumbName ?>">
            <?php if($_crumbInfo['link']): ?>
                <a href="<?php echo $_crumbInfo['link'] ?>" title="<?php echo $this->escapeHtml($_crumbInfo['title']) ?>"><?php echo $this->escapeHtml($_crumbInfo['label']) ?></a>
            <?php elseif($_crumbInfo['last']): ?>
                <strong><?php echo $this->escapeHtml($_crumbInfo['label']) ?></strong>
            <?php else: ?>
                <?php echo $this->escapeHtml($_crumbInfo['label']) ?>
            <?php endif; ?>
            <?php if(!$_crumbInfo['last']): ?>
                <span>/ </span>
            <?php endif; ?>
            </li>
        <?php endforeach; ?>
    </ul>
</div>
<?php endif; ?>

Result:

Result on homepage

My Tickertext:

Settings

Possible, some js files was missed in the package:

enter image description here

If you has similar errors, just add files:

  1. jQuery
  2. jquery.easing.1.3.js
  3. FitVids.js
  4. bxslider

Structure

Result after:

enter image description here

In addition, I have added the jQuery.noConflict script to the layout (app/design/frontend/base/default/layout/newsticker.xml).

Layout:

    <?xml version="1.0" encoding="UTF-8"?>
<layout version="0.1.0">
    <default>
        <reference name="head">
            <action method="addItem">
                <type>skin_css</type>
                <name>css/jquery.bxslider.css</name>
            </action>
            <action method="addItem" ifconfig="yantrakaar_newsticker/yantrakaar_newsticker_settings/jquery">
                <type>skin_js</type>
                <name>js/newsticker/jquery-1.11.0.min.js</name>
            </action>
            <action method="addItem" ifconfig="yantrakaar_newsticker/yantrakaar_newsticker_easing/enabled">
                <type>skin_js</type>
                <name>js/newsticker/jquery.easing.1.3.js</name>
            </action>
            <action method="addItem" ifconfig="yantrakaar_newsticker/yantrakaar_newsticker_vids/enabled">
                <type>skin_js</type>
                <name>js/newsticker/jquery.fitvids.js</name>
            </action>
            <action method="addItem">
                <type>skin_js</type>
                <name>js/newsticker/jquery.bxslider.min.js</name>
            </action>
            <action method="addItem">
                <type>skin_js</type>
                <name>js/newsticker/jquery.noconflict.js</name>
            </action>
        </reference>
        <reference name="breadcrumbs">
            <block name="newsticker" type="newsticker/newsticker" template="newsticker/newsticker.phtml" />
        </reference>        
    </default>
</layout>

Script (skin/frontend/base/default/js/newsticker/jquery.noconflict.js):

$.noConflict();

I hope it will help you.

PS: If you got an error: "Uncaught SyntaxError: Unexpected token ILLEGAL" you can try the following

7
  • Thank you for the detailed answer! I will give this a try...
    – j_granty
    Mar 28, 2016 at 18:22
  • @j_granty Good luck! :) If you have any questions, let me know, I will be glad to help you Mar 28, 2016 at 18:31
  • I have managed to carry out your instructions and the news ticker now works! So thank you. The only problem is that I get a banner saying "Please stop hotlinking my easing script — use a real CDN instead." the link goes to: [link] (github.com/gdsmith/jquery.easing). Do I need to copy the contents of their "jquery.easing.js" file and overwrite my current copy?
    – j_granty
    Mar 28, 2016 at 21:02
  • Yes link Mar 29, 2016 at 5:17
  • @j_granty I have updated a link to the jQuery.easing file Mar 29, 2016 at 6:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.