Jump to content


Photo
- - - - -

[resolved] Simple:Press bootstrap uploader issue

bootstrap simple:press forum plugin

  • Please log in to reply
7 replies to this topic

#1 weave5

weave5

    Newbie

  • Members
  • 5 posts
  • LocationMinneapolis
  • Framework Version:2.4.3
  • Country: Country Flag

Posted 25 March 2014 - 10:13 PM

I'm using the Simple:Press forum plugin and the forum has its own plugins, and one that is not running properly is the file uploader. Simple:Press says it's due to a conflict with bootstrap, and they suggest that I edit the theme and make sure bootstrap is loaded before the jQuery-UI core library.

 

My website: 

Please Login or Register to see this Hidden Content

. The page is

Please Login or Register to see this Hidden Content

The theme is pagelines framework running on wordpress 3.8.

 

I'm a beginner. Can someone explain step by step, how to edit the page's theme so that bootstrap loads before the jquery-ui..?

 


  • assomibatrifs likes this

#2 Danny

Danny

    Is Awesome!

  • Moderators
  • 15059 posts
  • LocationManchester, UK
  • Country: Country Flag

Posted 27 March 2014 - 01:41 PM

Hi,

 

I have brought this to the attention of one of our developers. However, I don't believe your issue could be caused by what they suggested.


  • assomibatrifs likes this

#3 nokow

nokow

    Advanced Member

  • Members

  • 44 posts
  • Country: Country Flag

Posted 27 June 2014 - 02:36 PM

I have the same issue to, the file uploader don't upload files. When i put back twenty fourteen il place of DMS, the upload works. 

Do you found a solution or something? 



#4 Martin Davies

Martin Davies

    Advocate

  • Members

  • 3268 posts
  • LocationManchester, England
  • Framework Version:latest
  • Country: Country Flag

Posted 27 June 2014 - 05:32 PM

Could you create a new topic for this with the listed requirements from the message when you create a new topic. Thanks. 



#5 Simon_P

Simon_P

    Messer

  • Administrators



  • 8388607 posts
  • LocationDevon
  • Framework Version:2.1.1
  • Country: Country Flag

Posted 27 June 2014 - 09:12 PM

Wow not seen a simplepress topic for a long time, anyway the solution was here: 

Please Login or Register to see this Hidden Content



#6 nokow

nokow

    Advanced Member

  • Members

  • 44 posts
  • Country: Country Flag

Posted 28 June 2014 - 08:07 AM

tried this solution, not working...

And the solution is for pagelines framework, not for dms2.



#7 Simon_P

Simon_P

    Messer

  • Administrators



  • 8388607 posts
  • LocationDevon
  • Framework Version:2.1.1
  • Country: Country Flag

Posted 29 June 2014 - 06:57 PM

The script handlers are the same.

 

add_action('wp_print_scripts', 'deregister_pl_bootstrap', 100);
function deregister_pl_bootstrap() {
    if(sp_is_forumpage()) {
        wp_dequeue_script('pagelines-bootstrap-all');
    }
}
 
Anyway that works as long as sp_is_forumpage() is still part of simplepress forum. No way I could check as all their support forum posts are behind a paywall.


#8 MrFent

MrFent

    Super Member

  • Members


  • 232 posts
  • Country: Country Flag

Posted 11 July 2014 - 08:33 PM

Ok here's what I had to do to get it to work in DMS 2...

 

Since the uploader plugin is conflicting with bootstrap, you need to dequeue all bootstrap files on that page (also as posted above) 

 

add_action('wp_print_scripts', 'deregister_pl_bootstrap', 100);

 

function deregister_pl_bootstrap() {
   if(sp_is_forumpage()) {
   wp_dequeue_script( 'pagelines-bootstrap-all' );
   }
}
 
Now, this will only work when the DMS editor is disabled. The DMS Editor loads pagelines-bootstrap-all on its own, so if the editor is enabled, the above function won't work. (this isn't a problem for guests on your site, since they can't access the DMS editor anyway)
 
So when the DMS editor is disabled, I noticed that two new issues came up. The dropdown menu in my navi section no longer works. This makes sense because the drop down menu uses bootstrap script which we I just disabled. The other issue I ran into, was that now my "Add Topic" and "Add Reply" button no longer worked. Inspecting in Chrome, you'll see the following error:
 
Uncaught TypeError: undefined is not a function      pl.common.js
 
You can fix both issues (navi dropdown and add topic/reply button don't work) by enqueueing the bootstrap-dropdown.js script. I understand why this fixes the navi dropdown issue, but don't know why it fixes the add topic/reply button issue, but hey I'm not complaining.
 
Anyway, go to 

Please Login or Register to see this Hidden Content

and copy the script and save it to a file on your computer, naming it bootstrap-dropdown.js
 
Note: you can't use the raw.githubusercontent.com as the script source, cause it won't work. You need to have the file on your server. 
 
I placed the file directly in my child theme. You may have a better place to put it, but here's the code I used to enqueue it:
 
add_action('wp_enqueue_scripts', 'enqueue_dropdown_script', 100);
 
function enqueue_dropdown_script() {
if(sp_is_forumpage()) {
$scriptsrc = get_stylesheet_directory_uri(); 
wp_register_script( 'bootstrap-dropdown', $scriptsrc . '/bootstrap-dropdown.js', array( 'jquery' ) );
  wp_enqueue_script( 'bootstrap-dropdown' );
}
}
 
Hope this helps someone. Props to @

Please Login or Register to see this Hidden Content

for helping me figure this out.
 






Also tagged with one or more of these keywords: bootstrap, simple:press, forum, plugin