[Great work on the latest update by the way.] So I'm not sure if facebook_status used a page reloads for refreshing page content before but let me explain my current setup and expected result. I'm using fb_status with panels 3 and activity (along with a few other views) to make up my user profiles. My desired result is: when user submits fb_status the page refreshes to update the activity block (that sits below the fb_status box). I'm not sure if fb_status does this without panels or if you wanted the page not to be refreshed by design. It would eventually be nice to use an ajax or ahah call to refresh a particular block and I'm sure this is possible with ctools once I learn it. But until then would it be possible to add this - at least as an option?
thanks
Comments
Comment #1
icecreamyou commentedThis is less "won't fix" and more "can't fix." And believe me, I've tried. I've consulted merlinofchaos who wrote Views, Panels, Chaos Tools et al, and he says even he couldn't do it. If merlinofchaos couldn't do it, there's no way I could. :-/
This may eventually be possible if, for instance, a View was embedded within the status update form (so it would be refreshed along with the form). I haven't looked into how that would be done but I hope to eventually look into that approach.
Comment #2
icecreamyou commentedTurns out this got on my mind and I couldn't be satisfied until I found a way to make it work. Try the demo site for proof (also committed to dev).
In order to make this work on your site, you'll need to create something (a block, node, custom pane, whatever) that can hold PHP snippets, and put this inside it:
Comment #3
pribeh commentedWow, this works pretty cool IceCreamYou and I could see how this works well for this module or for your publisher project. What I'm looking for though is a simple page refresh upon submission since I actually use the activity module for the display of content such as statuses since it allows for aggregation of all types of content in one spot. I do use status blocks in other sections of the site but I use activity on the user page so that it functions similarly to facebook's system.
Comment #4
icecreamyou commentedIn that case this is a support request, not a feature request - you should form_alter() the status update form in a site-specific module to unset $form['fbss-submit']['#ahah'].
You could also alter it like this to get a JavaScript-updating effect for your Activity view:
Comment #5
pribeh commentedThanks Ice! So the view I want gets sucked in below the facebook_status submit box (which is workable) and it reloads properly but only after hitting enter. Clicking the submit button disappears the view and all other elements (submit button, number widget) except the submit box. I'm using the view "facebook_status_recent" to test this and I've called the module "fb_status". Here's what I put in my custom module:
Comment #6
icecreamyou commentedAh, well, what's probably happening is that your form_alter() is adding the View to the form at the end, and the AHAH on form submit replaces everything within a <span> that's closed by the View if it's present. In the module, the view is higher up on the form. Probably what I'll do is just change the module so that the theme function can specify which view is displayed. You'll end up with something like this:
Comment #7
pribeh commentedIs this something I can do? Or does the last bit of code require tinkering within facebook_status? Or is this as easy as sticking the last bit of code you posted into a template file?
Comment #8
icecreamyou commentedPut the code in #6 wherever you want your status/view combo. No need to change any module/theme files. The code that will make this work is currently incubating in CVS - grab the next dev to try it. You can go ahead and put the code from #6 where you want it while you're waiting--it won't break anything, it will just show the facebook_status view instead of the one you specify.
For help, see the new documentation on this.
Comment #9
pribeh commentedThis is excellent work Ice! Keep it up!
Comment #10
pribeh commentedActually, one more problem. I've put this inside a pane and the view is printed awkwardly. It sits inside a block right with the status textfield. But this block gets printed before the submit button and the "post to twitter" input. This makes for some tricky CSS action to sway that view into a position below the entire status box.
Comment #11
icecreamyou commentedThe CSS to do that is already in the module, and it works unless the viewing area is too small. I really can't help you beyond there--there's no other way to do it, although I suppose it might be marginally possible to improve upon the CSS. Take a look at facebook_status_view.css if you're interested.
Comment #12
pribeh commentedSorry Ice, I'm not sure if this is simply a problem I'm experiencing so let me illustrate what I mean. The problem does not arise from the styling but from where the view is printed (using the snippet form the doc page).
The code displays as such (below) within a custom pane I've setup for the user panel:
Making it terribly difficult to shift the view to display below the form. Any attempt to move the view will shove the submit, character and submit tags around awkwardly. It should be printed like so:
Or if not possible then at least like this:
Comment #13
icecreamyou commentedI know. That's how it works and it can't be changed. The CSS is slightly improved in the latest dev (replace your whole facebook_status folder) so can try that if you'd like; otherwise I can't help you and you'll have to mess around with your theme. It works in Garland...
Comment #14
pribeh commentedK, that's cool Ice. Thanks for all your hard work. I'll try my best to work around it. I'll take a look at how it displays in Garland. Thanks again.
Comment #15
pribeh commentedOK, so my users are complaining that they want activity-module-esque feeds instead of twitteresque messages underneath the fb_Status box. So since I'm using activity 1.2 I decided to try and throw in the user-activity block my attempt at theming said functionality within a custom pane is as follows:
My php skills suck so obviously no go here. Anyone care to help out?
Comment #16
icecreamyou commentedAs you'll notice from the docs, the 'facebook_status_form_display' theme function takes three variables: a user account object, an integer denoting the horizontal size the status update textfield/textarea should be, and the "view" parameter:
The $view parameter should be the string of the machine name of the view you wish to display. In your case I think it's called "activity" or "activity_history," I can't remember which. I don't know how you came up with $block in your code, but not only should you not invoke Drupal hooks like hook_block() that way, but it wouldn't give you anything that would be remotely useful for you to work with, and you also mysteriously pass "user" to that module_invoke() without declaring it as a variable or assigning any value to it.
This probably should have been a separate support request, although I understand that this all stems from the same original issue in your head/site. ;-)
Comment #17
pribeh commentedThanks Ice. I'm going to wait until activity 2.0 is ready and just use views for displaying the user's feed within the pane. I realized while you were gone what I was doing wrong :)
Comment #19
merilainen commentedI managed to turn off AHAH in the form, but Panels won't update content (Author pane, activity etc.) before manually pressing F5 to update the page. Then browser complains about resending form data. After pressing "resend" everything is right.
Comment #20
icecreamyou commentedDon't hijack unrelated issues for your personal support requests. This issue isn't even for a version of the module that's supported any more, not to mention that it's closed, and it's very rare that there's a valid reason to reopen a closed issue.
Per your question, Panels has nothing to do with it. Read the docs and this thread--you can't have a view auto-update if it's in another panel. Not to mention there's no way you're going to get AHAH-driven updates if you hacked the module to remove the AHAH.
Comment #21
merilainen commentedI was replying to your comment no 4 and was trying to point out that disabling AHAH in the form with
unset($form['fbss-submit']['#ahah']);didn't do me any good (cannot be considered "hacking" the module). This flat view of comments makes it look like I'm commenting on the main issue.So should I open a new issue? Disabling AHAH doesn't make the form reload the whole page, and pressing F5 makes the browser to ask for confirmation on resending the form values -> confusing for user.
Comment #22
icecreamyou commentedYes, you should have opened a new issue. However, I can't give support if you're not using the module the way it's built. I will say that your problem after unsetting the AHAH in the form is probably that your Drupal system cache needs to be cleared, but that's as much as I can do for you.