I'm having trouble getting pages to appear inside the modal. I'm specifically trying to get Search to load in the modal. Here's the structure of the link I'm using:

<a href="/drupal/search" class="twitter_bootstrap_modal tb_modal">Search</a>

it should be noted that my site is located in a subdirectory called "/drupal". The classes on the configuration page are just the default classes. I tried looking at the example page listed on the TBM project page, but that link is broken. Can anyone help me out?

Thanks!

Comments

hatuhay’s picture

My suggestion is not to load the search form in a modal, but to render it as a block and hide it on a modal...

seehawk’s picture

Thanks for the fast response. I appreciate the advice, but the bigger issue for me is that I can't get your module to work. No matter which page I set as the link target, I can't get it to open. As far as I can tell, I have the classes in the link set correctly. Can you confirm this? Is there a working example page you could point me to?

Also, does it make a difference that my site is in a subdirectory? I need to go through the code to see what's happening, but I'd like to at least be able to confirm that the module is supposed to work with the classes I'm using (I haven't changed the module's default configuration.)

Thanks!

hatuhay’s picture

Hi there,
The jquery_ajax_load module comes with a test module.
You can start there.
The intallation being in on a sub-dir should not be a problem, but could.

seehawk’s picture

Title: How to get the Search page to appear in a modal? » Can't load pages on a site that lives in a subdirectory.
Category: Support request » Bug report

Tried the test page, but was unable to get any page to load. Looking at the console, I'm getting page not found errors on calls to /jquery_ajax_load that are not including my subdirectory, so it looks like that's at least part of the problem.

I also hard-coded a modal inside a block just to confirm that it wasn't an issue with Bootstrap.

Changing this to a bug report with a new title to reflect the issue.

hatuhay’s picture

I do not have my computer on hand, so cannot check on code, but I am sure there is a previous issue that address same problem.
Please take a look on previous issues.

bverc’s picture

Project: Twitter Bootstrap Modal » jQuery AJAX Load
Version: 7.x-3.5 » 7.x-1.4

Confirmed the Twitter Bootstrap Modal module, but more specifically jqueary_ajax_load, does not work well (it does work though) with websites in a subdirectory.

Namely any link will generally be to href="/sub_dir/node/####" where modal will only work when href="/node/####".

In addition, the test module uses class: .jquery_ajax_load_TB, whereas the modal functionality needs .twitter_bootstrap_modal as the new default.

stringv’s picture

Is there a solution to this? I get an error for every page when the site is in a subdirectory, works fine when it's in the root. Unfortunately I need to use a subdirectory...

ahmedchebil’s picture

Priority: Normal » Major

Changed the issue to major,
The module should use the Drupal paths
changed line 59 in jquery_ajax_load.js to : loading_html += Drupal.settings.basePath + module_path;
and 60 to : loading_html += '/jquery_ajax_load_loading.gif">';
Line 62 changed to $(target).load(Drupal.settings.basePath + 'jquery_ajax_load/get/' + url, function( response, status, xhr ) {
but url is still undefined

matias’s picture

Status: Active » Needs review
StatusFileSize
new1.15 KB

Here is my attempt to fix this issue.

It worked ok on a site under a "/drupal/" directory and links like this:
<a href="/drupal/node/1" class="jquery_ajax_load">Test</a>

matias’s picture

StatusFileSize
new1.03 KB

Sory, I attached the wrong patch