ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

EE and JS plugin error

March 29, 2011 9:04am

Subscribe [3]
  • #1 / Mar 29, 2011 9:04am

    variouspixels

    31 posts

    Hi all,

    Im building my first EE website and I am having problems loading the jQuery cycle plugin but only on my EE template pages.

    I have stripped the plugin files down to core code and added files to one embed/test template. When I embed the code into my working templates the code does not work and I get a “$(”.gallery”).cycle is not a function” error.

    When I embed the code in a blank template or plain HTML I get no problems at all.

    Can anyone think why this might be happening?

    thanks,

     

    gemmes

  • #2 / Mar 29, 2011 9:57am

    Cheif

    626 posts

    Post up some code, bit like finding a needle in a haystack :(

    Sounds like jquery isn’t loading, use the google function to load it (rules out a path issue) OR the plugin isn’t loading (favorite option)

    Use firebug for firefox to check what the paths are doing when rendered 😊

  • #3 / Mar 29, 2011 10:12am

    variouspixels

    31 posts

    EE CODE:

    {embed="includes/document_header"}
    {embed="includes/header"}
    
    <!-- ARTICLE -->
    <article class="journal">
    
        {exp:channel:entries channel="article" orderby="date" limit="1"}
        
            <h1>{title}</h1>
    
            {embed="includes/test"}
        
        {/exp:channel:entries}
        
    </article>
    <!-- ARTICLE -->
    
    {embed="includes/footer"}

    INCLUDES/TEST
    This code does not work in above template. Works everywhere else.
    <div class=“gallery”>
          http://cloud.github.com/downloads/malsup/cycle/beach1.jpg
          http://cloud.github.com/downloads/malsup/cycle/beach2.jpg
          http://cloud.github.com/downloads/malsup/cycle/beach3.jpg
          http://cloud.github.com/downloads/malsup/cycle/beach4.jpg
          http://cloud.github.com/downloads/malsup/cycle/beach5.jpg
      </div>
      [removed][removed]
      [removed][removed]
      [removed]
      $(document).ready(function() {
    $('.gallery').cycle({
    fx: 'fade' // choose your transition type, ex: fade, scrollUp, shuffle, etc…
    });
      });
      [removed]
      <style type=“text/css”>
      .gallery { height: 232px; width: 232px; }
      .gallery img { padding: 10px; border: 1px solid #ccc; background-color: #eee; }
      </style></code></pre>

  • #4 / Mar 29, 2011 10:15am

    variouspixels

    31 posts

    [removed][removed] = The cycle plugin from CDN and jQuery from CDN.

    I have used Firebug the jQuery and Cycle plugin code is loading.

  • #5 / Mar 29, 2011 10:24am

    variouspixels

    31 posts

    I just pasted the includes/test code into another EE site and it works perfectly there too. the page is built almost identically to this website. Also the code fails when placed outside of the channel:entries tag.

    Im guessing the Cycle plugin is breaking but what could be causing this? I have tried via CDN and via uploading required files.

  • #6 / Mar 29, 2011 6:12pm

    Brandon Jones

    5500 posts

    Hi gemmes,

    Which version and build of ExpressionEngine are you using? Can you double check that Debug Preference is set to “1” on this site?

  • #7 / Mar 30, 2011 5:05am

    variouspixels

    31 posts

    v2.1.3

    and Debug Preference is set to 1.

  • #8 / Mar 31, 2011 8:37am

    Sue Crocker

    26054 posts

    Hi, Gemmes. You said this code works on another EE site. Is it on the same server you’re on now? What differs between the two installations?

  • #9 / Mar 31, 2011 10:33am

    variouspixels

    31 posts

    The error is on a local version of my EE site via MAMP. The code works in MAMP via standard HTML PHP.

    The working EE site is on my server. I do not have another local EE site to test there though.

  • #10 / Mar 31, 2011 12:34pm

    Lisa Wess

    20502 posts

    Do you have a link to where you’re trying this? We’re going to need to be able to view source and see the issue for ourselves in order to help out.

    Thank you.