jquery+concrete5: I'm completely clueless.
PermalinkI'm trying to design a website using concrete5, css, and jquery, despite never having used any of these. This is both the fault of my ambition and the company that I work for (and being the only designer employed here). So I'm scrambling to learn everything on the fly, and I'm having a lot of issues trying to figure out how to implement a lot of things.
My major concern, at the moment, is getting the following to work when built into the backbone of default.php:
http://www.sohtanaka.com/web-design/automatic-image-slider-w-css-jq...
I'm not exactly sure what I'm doing wrong. I put all the pieces where they're supposed to be, but nothing works (images don't even pull in, bizarrely). I've tried a similar (but different) set up and had similar problems. I figure it's just something fundamental that I don't understand in regards to how concrete5 handles its theme files, or possibly how concrete5 manages jquery. I've tried to hunt down solutions but I haven't been able to locate clear answers. Any and all help will be appreciated.
Thank you!
http://wireless101.org/concrete5/...
I've also attached the CSS for the theme.
I'll run the site through Firebug now.
So first, remove the reference to jquery-1.4.2.min.js at the top. Then make sure the inline JS loads after C5 loads jQuery, and then go from there.
EDIT: It appears there's also some malformed HTML.
-Steve
Where is the malformed HTML, and how do I fix it?
Once again, thank you very much!
<script type="text/javascript" src="<?=$this->getThemePath();?>/js/your-jquery.js"></script>
This is just like you would do for a static HTML site. The only difference is the php snippet in the middle: $this->getThemePath();
That literally gets your theme's path in the website (like it says), and spits it out. It's often used for relative links to things like stylesheets, images, and javascript.
When you use that PHP snippet, just make sure you put a slash right after it (like in the code above), because it doesn't build the slash right after the last directory. Your code would look like yoursite/themes/yourthemejs/your-jquery.js when it should be
yoursite/themes/yourtheme/js/your-jquery.js.
So just keep that in mind—it tripped me up early on.
I've attached the CSS, and you can view the page at www.www.wireless101.org/concrete5... and the JS file at www.www.wireless101.org/concrete5/js/sequence.html.glimmer.js...
Thanks again!
/concrete5/themes/101real/js/jquery-1.3.2.min.js
...can't be found. But as I say, you don't need to load it. It's difficult to assist further without the actual PHP theme files.
-Steve
A good way to test for malformed mark-up is to run it through a validator.
http://validator.w3.org/
-Steve
Shotster, you told me that I needed to fix the double <head> tag, but Proteus tells me to reference the jQuery file in the head. The double <head> comes from me putting a head in the php file to stick the jQuery reference into--and it takes both the reference to sequence.html.glimmer.js AND jquery-1.3.2.min.js to make the script work.
This would almost be semi-workable if doubling up on the script didn't cripple the Edit Mode. What are my options from here? I've tried calling directly to jquery.js, but that only works if I've put that file into the js folder in my theme's directory. So how do I link all these pieces together to work? o_o
Again, here are the files:
www.www.wireless101.org/concrete5...
http://www.wireless101.org/concrete5/themes/101real/js/sequence.htm...
Another pre-emptive thank you to all of you!
#3 use $this->addheaderitem('');
#2) Did it.
#3) Not sure if I implemented that right...have a look and let me know...either way, it's not working. =(
Also, it probably makes more sense to include the JS from your header.php file (assuming your theme has one and that you need the JS for most pages in the site).
Lastly, your site tracking (Google Analytics) code should also be in the document head, but worry about that last.
-Steve
Also, are you using the built-in Slideshow block?
-Steve
Which file, exactly, are you editing to add the reference to your JS file?
-Steve
http://www.filedropper.com/default_16...
That's the one I'm editing the references to the .js.
<?php
$this->addHeaderItem('<script type="text/javascript" src="<"<?=$this->getThemePath();?>/js/sequence.html.glimmer.js"></script>');
?>
On top of that, <?=$this->getThemePath();?> doesn't seem to work at ALL, nor does pointing it to the exact spot on the server.
I'm not using the Slideshow block, I'm using some jQuery I found on the internet to get the specific interface I needed.
-Steve