Today I tried to style the comment reply page (comment/reply/%node) as a panel.
How can I override this system path as a panel page? It works for node-view / node-edit but I didn't find a way to overrride the comments reply form.
It tells me, that this path is already used, which is of course correct.
Any ideas?
| Comment | File | Size | Author |
|---|---|---|---|
| #31 | ctools_commentreply.31.patch | 39.54 KB | manarth |
| #29 | ctools_commentreply.29.patch | 36.65 KB | manarth |
| #23 | ctools_commentreply.19.patch | 36.41 KB | manarth |
| #15 | ctools.patch | 36.47 KB | manarth |
| #1 | comment_reply.inc_.txt | 4.4 KB | ayalon |
Comments
Comment #1
ayalon commentedAfter I realized, that this task is handled in the ctools and not in the panels module, I was able to create a system override for comments reply.
Attached you will find my working file. Copy it to the folder 'ctools/delegator/plugins/tasks' and rename it:
comment_reply.inc
Comment #2
ayalon commentedThe fallback didn't work as expected. I corrected this:
Take this version
Comment #3
thomasmuirhead commentedHi there,
I was wondering what would need changing to make this work with the page manager rather than delegator?
thanks
thomas
Comment #4
friolator commentedthanks for this! I got it working on our site for forum replies (We're using Advanced Forum 6.x-1.0), and the form does actually work. EXCEPT: the page doesn't correctly redirect after posting. that is, you can post a reply to a forum post and the reply winds up in the database, but after hitting submit, you're not taken out of the comment form, the page just reloads with a new comment form.
I don't know if this is handled here, or if it's something in advf or elsewhere. any clues?
thanks!
Comment #5
merlinofchaos commentedThis needs to be rerolled for the change from delegator to page manager.
I'm curious about #4. I recall I needed to do some extra work on node edit stuff to get it to forward to the right place, but that was using an actual form context. This doesn't actually supply that.
Comment #6
friolator commented@merlinofchaos: Was the work you needed to do to handle forwarding within delegator/plugins/tasks/node_edit.inc or somewhere else? If i have some time I'll dig through some code to see if I can figure out a way to make this go, but I'm not really sure where to start looking!
Also - I assume that with Advanced Forum 2, which uses node comments, all of this stuff would pretty much just work within Panels, right? Since that's in Alpha now, we're weighing whether or not to give it a shot for a site that's going live in about a month.
Thanks!
Comment #7
merlinofchaos commentedThe work I did for node_edit was within the context, which is a little different from how this is implemented. That means that I'm not sure it's actually relevant. =(
Comment #8
ayalon commentedYou are right. The redirect is lost somehow. I was not able to fix that. Does someone has an idea, how this could be solved?
Comment #11
summit commentedSubscribing, greetings, Martijn
Comment #13
ekarelin commentedi've solved this problem very easily as
function yourmodulename_form_alter(&$form, &$form_state, $form_id) {
switch ($form_id) {
....
case 'comment_form':
$form['#submit'][] = 'youmodulename_comment_form_submit';
break;
....
}
function youmodulename_comment_form_submit($form, &$form_state) {
$form_state['redirect'][0] = 'node/'. $form_state['values']['nid'];
}
Comment #14
merlinofchaos commentedChanging this to a feature request. If this can get cleaned up and made into an actual patch there is a good likelihood that, when it's ready, I'll accept it into CTools so it'd be lovely if someone would work on this.
Comment #15
manarth commentedHere's a patch against DRUPAL-6--1 branch, which adds:
The code references a icon_comment.png which isn't in the patch - it'd be great if someone with more artistic talent than I could come up with something :-)
Comment #18
merlinofchaos commentedI need to do a full review of this, which will take awhile.
In the meantime:
Those have to go =)
Comment #23
manarth commentedOops! Take 2...
Comment #28
PI_Ron commentedHi guys.
I'm after a bit of help, Ive applied the patch in #23, and enabled the comment/reply/%node panel. When I click a comments reply link, the page refreshes and I get the message:
What is the correct setup for the comment/reply/%node panel?
Comment #29
manarth commentedHi Tigeda - looks like there was a bug in the code...It was handling replies to other comments, but not new comments directly on the node.
This new patch should fix that.
The steps to install *should* simple be:
- patch the module
- flush caches
- navigate to /admin/build/pages
- click 'Enable' next to the 'comment_reply' entry
Comment #30
PI_Ron commentedHi Manarth,
Thanks for that after reverting ctools and reapplying the patch it works correctly.
Just a couple of questions:
Thanks again.
Comment #31
manarth commentedI can't reproduce this. If it's still an issue with the attached patch, can you repost with the panel-pane affected, and the panel page it's embedded on?
I hadn't realised that comment's implementation of hook_links creates a link using
arg(0) . '/' . arg(1), which will only work on certain URLs. I've altered that link in the ctools plugin so it points to the correct parent node.The new patch:
- Fixes the URL to the parent comment
- Adds a "Delete comment" admin link to the pane
- Adds the option to choose if the comment-links should be displayed (on the "Comment content" pane).
- Contains various code-cleanup changes (mostly these are better inline comments)
Comment #32
PI_Ron commentedHi Manarth,
The new patch fixed the Parent link url.
The delete link works as expected, I might of wasted your time a little here, I had a panel comment/delete/%comment that was causing the 404.
My theme doesnt use any blocks apart from branding up the top, and footer. So everything is within panels. I'm trying to also override the comment/edit/cid and comment/delete/cid pages, I can override them fine, and place a comment form, but I'm not sure that I can pass the comment form a context like the "Comment being replied to" one you provide (for comment edit panel).
For comment delete, I can override the comment/delete/cid page, but it doesnt delete the comment, and I'm not sure how I can print a system message in a panel (Are you sure you wan't to delete this comment? Yes/No).
I can just leave them as they are, but it looks devastatingly ugly because everything disappears except the header/footer, and all content is rigt up against the left side of browser window.
Comment #33
PI_Ron commentedBit the bullet and spent the morning converting the site to Panels Everywhere.. awesome stuff!
Comment #38
wjaspers commentedsubbing. Would like to see in 7 as well.
Comment #39
cartagena commentedAlso interested in D7 version...thank you!
Comment #42
guybedford commentedYeah a d7 version is a really necessary complement for overriding the node pages with panels. I thought I didn't need this page, until comments had validation errors and they redirect to this url, which isn't a pretty sight!
Comment #43
pwaterz commentedDrupal 7 patch here. Not as elaborate as the patch above, but gets the job done http://drupal.org/node/1693352
Comment #44
summit commentedWouldn't it be fine to have one patch for this please? greetings, Martijn
Comment #45
pwaterz commentedOne patch for what? D6 and D7?
Comment #46
summit commentedD7 the same as D6. It says the one for D7 is not as elaborate as the patch above. Would be great if the quality of the patch for D6 and 7 is the same.
Sorry if I was not clear on that remark.
greetings, Martijn
Comment #47
pwaterz commentedThe api is different in 7. This d6 patch attempts to completely abstract the comment reply page. By having a ctools content type for every component of the comment reply page. My patch just offers a ctool content type that give you the output of the comment reply form and allows you to make the comment/reply a panel page. Personally I dont think the level of abstraction is necessary. All the is really needed is the ctool task and the full form. If a person wants more abstraction they can write some very simple ctools content types.
Comment #48
pwaterz commentedIn addition, I think it make sense to get this patch worked out as it. And see if users request more functionality. No sense in wasting time on something no one uses.
Comment #50
japerryClosing this issue as outdated as Drupal 6 ctools is not supported. If this issue is relevant for Drupal 7, feel free to re-open and mark for Drupal 7 (or 8)