Skip to content

Instantly share code, notes, and snippets.

@ElectricMaxxx
Created August 8, 2014 11:26
Show Gist options
  • Save ElectricMaxxx/38107471b08cdab421ab to your computer and use it in GitHub Desktop.
Save ElectricMaxxx/38107471b08cdab421ab to your computer and use it in GitHub Desktop.
problem to fetch the node

Got problems with that code:

<div class="carousel-wrapper">
   <h3>{{ title }}</h3>
    <div class="carousel">
        <a class="left"></a>
        {% if list|length > 0 %}
            <ul id="carousel-list">
                {% for key, value in list %}
                    <li class="accordion-item">
                        <div>
                            <div class="img-wrapper">
                                <a href="{{ value.href }}" title="{{ value.title }}">
                                {% image '@BobbProjectxPoiBundle/Resources/public/images/neckartalradweg-teaser.jpg' %}
                                <img src="{{ asset_url }}" alt="{{ value.title }}" />
                                {% endimage %}
                                </a>
                            </div>
                            <div class="text-wrapper">
                                <a class="move-on" href="{{ value.href }}" title="{{ value.title }}">
                                    {% trans %}
                                    move_on  »
                                    {% endtrans %}
                                </a>
                                <h5>{{ value.title }}</h5>
                                <p>
                                    {{ value.description|length > 130 ? value.description|slice(0, 130) ~ ' ...' : value.description  }}
                                </p>
                            </div>
                        </div>
                    </li>
                {% endfor %}
            </ul>
        {% endif %}
        <a class="right"></a>
    </div>
    {% javascripts
        '@BoBBProjectXFrontendBundle/Resources/public/js/jquery.js'
        '@BoBBProjectXFrontendBundle/Resources/public/js/jquery-ui.js'
        '@BoBBProjectXFrontendBundle/Resources/public/js/jquery.cycle.all.js'
        '@BoBBProjectXFrontendBundle/Resources/public/js/jquery.jcarousel.js'
    %}
        <script type="text/javascript" src="{{ asset_url }}"></script>
    {% endjavascripts %}
    <script type="text/javascript">
        $(document).ready(function() {
            $("#carousel-list").jcarousel({
                wrap: "circular",
                scroll: 1,
                auto: 4,
                visible: 3,
                initCallback: function(carousel) {
                    $(".carousel .left").bind("click", function() {
                        carousel.prev();
                        return false;
                    });
                    $(".carousel .right").bind("click", function() {
                        carousel.next();
                        return false;
                    });
                }
            });
        });
    </script>
</div>

got an error:

Uncaught TypeError: undefined is not a function 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment