Modal conflict with bootstrap.js when launched from Edit menu in C5 Toolbar

Permalink
99% of my problems are solved, but this modals is a bitch one.

I have added a #themewrapper and this cleared up all the CSS conflicts I had.

I am also currently using this technique so that my bootstrap.js does not clash with C5's bootstrap.js:

<?php
       // bootstrap jQuery 1.10.2 conflicts with Concrete5's 1.7.2, so we only load bootstrap.js if not in Edit mode
      $page = Page::getCurrentPage();
      if(!$page->isEditMode()) {
      ?>
      <script src="<?php echo $this->getThemePath(); ?>/_/js/bootstrap.js"></script>
      <?php
      }
   ?>


But, of course, since these modals are never in EditMode, I guess my script is loading my bootstrap.js in this particular case, so I guess I need a new rule when dealing with those particular modals. Is there an ID or something for these I can work with? This is really a huge pain in the butt to try to figure out on my own. Any idea how this could be fixed? I don't want to buy a theme because I want to know how to solve the problem.

Image attached in case you are still not clear which modals I'm talking about.

1 Attachment

View Replies: View Best Answer
planist1 replied on at Permalink Reply
planist1
I know you probably want to run the newer jquery and have the modal be available,

but if not, could you use something like:
<?php
global $u;
if ($u->isLoggedIn()) { ?>
   // Content if logged in
<?php } 
else { ?>
   // Content if not logged in
<?php } ?>
zoinks replied on at Permalink Reply
Well, the only real problem with that is the navbar breaks whenever C5's bootstrap.js is loaded instead, so they would never be able to navigate the site. Thanks for your suggestion, though.

I'm thinking I need to use some or conditionals like "if in Edit mode" OR page ID is 'versions' OR page ID is 'properties' or whatever. I'm tooling around now looking for page IDs for these modals...

I see stuff like this when I hover over the links:

...index.php/tools/required/versions.php?cID=1

.../index.php/tools/required/edit_collection_popup.php?approveImmediately=1&cID=1&ctask=edit_metadata

.../index.php/tools/required/edit_collection_popup.php?cID=1&ctask=set_theme

etc.

And am trying to figure out how to incorporate that into the conditional script.
planist1 replied on at Permalink Reply
planist1
I was more thinking about disabling your new jquery when logged in. Interesting problem though.
zoinks replied on at Permalink Reply
Yeah, that would be great except you can't navigate through the site to edit different pages since the nav breaks if the new js isn't loaded.
zoinks replied on at Permalink Best Answer Reply
You know what? I ended up using your solution. I didn't bother with an else statement, but it seems to be better to just let them navigate through the dashboard sitemap and tell them the nav doesn't work when they're logged in. Meh.

<?php
   global $u;
      if (!$u->isLoggedIn()) { ?>
         <script src="<?php echo $this->getThemePath(); ?>/_/js/bootstrap.js"></script>
   <?php } ?>


PS - I marked yours as best answer first so you'd get the karma/credit. But, I marked mine so I would be able to see how I solved it in the future. I think it will be a while between C5 projects.
planist1 replied on at Permalink Reply
planist1
Oh good. Just another thought, could you place another nav on the page and only show it when logged in?
zoinks replied on at Permalink Reply
I probably could (and thanks for the suggestion), but the original nav is a horizontal navbar with dropdowns (Bootstrap 3) so anything else is going to just interfere with the page. I think it makes enough sense to just say they have to navigate through the dashboard and forget about it for the price they are paying.