problems with Javascrict and footer

Permalink
Hi all, I'm just a newbie and I'm having some problem with my first C5 site. The problems are two: 1- When I'm not in edit mode the javascript function doesn't work; 2- on one page when I'm in view mode, the footer is missing, while when I'm in edit mode also the edit toolbar is missing.
The site url ishttp://www.alletamerici.it and the page without the footer iswww.www.alletamerici.it/ristorazione....
Can anyone help me?

Thank you in advance

adwlabs
View Replies: View Best Answer
goutnet replied on at Permalink Reply
Javascript works on both pages for me.

The footer is not showing in the second page, as you said, could you post you/send me theme code so I can have a look ?, it's hard to tell where is the problem by just looking.
adwlabs replied on at Permalink Reply
adwlabs
Thanks a lot to your quickly response. I can post/send all code, you just tell me which pages you need. Do you want only the page type code or you need also all the files (header.php-footer.php etc)? Moreover, in the "gallery" page doesn't work the lightbox effect by clicking on a thumb image.
Thanks again
goutnet replied on at Permalink Reply
it greatly depends on the way you built your site :

- Did you build a theme and installed it in themes ? in that case, zip up that directory and attach it here
- Did you prepare a package and bundled things it it ? in that case, zip that package up
- Did you use overrides to customize your site ? in that case, attach those
adwlabs replied on at Permalink Reply
adwlabs
Hi, here some informations: - I started to develop my site with bootstrap theme (I added 1 .css file and I created some pages type); - I added also 4 blocks: designer_content-flexislider-maintenance_editor-flexybox gallery. Here you can find my packages folderhttps://www.dropbox.com/s/honiw5uh0hgxng4/packages.rar...

thank you
goutnet replied on at Permalink Reply
Ok, well you zipped the package directory ...

my guess is you did not modify the packages directly ? (did you ??)

so, if I guess correctly, you actually developped your site doing overrides ? can you zip up your code (not the packages you installed) to check that ? (especially the page type you created) ?

Moreover, what is the page type of the page not showing the footer ?
adwlabs replied on at Permalink Reply
adwlabs
I'm not sure to understand what you say. however this is what I did: I uploaded the bootstrap theme in my package directory. after installed it I started to modify the pages type and to create new pages type. In particular I created these pages: home3, camere, dove_siamo, gallery, offerte, ristorazione, servizi, ristorante.
The page without footer is "ristorazione.php".
You can find all pages and their code inside the folder I gave you.
goutnet replied on at Permalink Reply
OK, I start to understand now …

Well, you really shouldn't be doing it this way, modifying packages code like this will only lead you in a corner when that particular package gets updated.

If you want to modify a theme, just copy/paste that theme to your themes directory, and then modify it (you can rename it btw).

Another thing, you don't need to create a new .php file to create a page, you can create pages directly in the interface. You only need to add page types if needed (and register them from the dashboard).

I would suggest to reset the packages to their original, then start working anew in the override. You probably want to have a look at the documentation section, containing the basics video about that.
adwlabs replied on at Permalink Reply
adwlabs
I'm hazy. I bought the bootstrap package and the installation instruction explain to install the package by uploading it on package directory. I did so, and then I created some pages type inside the bootstrap theme to customize the style of my pages.
goutnet replied on at Permalink Reply
My point is you should *copy* the theme you want to modify in your themes directory.

Modifying packages directly in their respective directory will bring you quite a hassle if you get to upgrade that package in the future.

Now, that said, I see what you did, I'm gonna look a bit more in what you sent, but you really should be using overrides (that is, build your site within the root directory’s directories and not hack into packages. (but well, what's done is done I guess).
goutnet replied on at Permalink Best Answer Reply
First,

looking at your ristorazione.php page_type, you seem to declare Tons of areas one after the other, it is probably unnecessary, since in the editor you can add multiple blocks into one area. To me, it seems you are trying to "code" your content, as opposed to "edit" it in your website....

now, looking at the generated code, the execution of the page seems to stop at the execution of this code :

<div class="row-fluid"><?php
                                $a = new Area('spacer1');
                                $a->display($c);
                                ?><div class="clearfix"></div></div>
<div class="row-fluid">


Probably in the display of the 'spacer1' area, what block did you add into that area ?

Try remove those areas (comment them) to see what happens ?
adwlabs replied on at Permalink Reply
adwlabs
ok, the problem is in this part of code
"<div class="span6 camere">
<?php
$a = new Area('Img2');
$a->display($c);
?>
<div class="clearfix"></div>
</div>

<div class="span6 camere">
<?php
$a = new Area('Ristorazione2');
$a->display($c);
?>
<div class="clearfix"></div>
</div>

</div> "

If I delete the code the browser shows the rest of the page with footer.
However, I have again the problem with the javascript in the gallery page....

thank you very much.
goutnet replied on at Permalink Reply
When I view your gallery, I get the following javascript error :

Uncaught TypeError: Object [object Object] has no method 'datepicker' www.alletamerici.it:520
(anonymous function) www.alletamerici.it:520
n jquery.js:2
o.fireWith jquery.js:2
e.extend.ready jquery.js:2
c.addEventListener.B jquery.js:2


The offending line is

$( "#datepicker" ).datepicker({ minDate: "0", showOtherMonths: true, selectOtherMonths: true, altField: "#gg",   altFormat: "dd" });


you seem to be trying to add a jQueryUI datepicker to that object, but you don't actually load jQueryUI beforewise (hence the error).

somewhere in your header, you should call this

$html = Loader::helper('html');
echo $html->css('jquery.ui.css');
echo $html->javascript('jquery.ui.js');


or simply install that block :

http://www.concrete5.org/marketplace/addons/load-jquery-ui/...

and add it to the page where you are using jQueryUI
adwlabs replied on at Permalink Reply
adwlabs
Hi, I'm following your suggest. I copied my theme into root_site/themes to override it. But now i don't know where i need to copy the "css" folder: I must copy it inside root_site/themes/css or in root_site/css? thank you very much and excuse me for my insistence.
goutnet replied on at Permalink Reply
Both are valids, depending on how you reference them in the theme override.
adwlabs replied on at Permalink Reply
adwlabs
I don't know how to thank you! I think now I resolved the most important problems and I learned something more. I need to improve, step by step.

thanks again
fabienapd replied on at Permalink Reply
fabienapd
There is not free add-ons inside the zip you provide. I don't think you should make them available public like that.
adwlabs replied on at Permalink Reply
adwlabs
you're right, infact I deleted the package. I'm sorry but I really need help. I didn't know how to explain my problem. Excuse me