I am having trouble getting my Forum nodes to print the title of the node when published. Follow this link for an example: http://www.gooverseas.com/taiwan-forum/leaving-teach-english-taiwan/213
You'll see that the top post does not print the title, but you can see it in the browser window. Also, as you scroll down you will see that all comments made have a title posted. I have tried to fiddle around with the advf-forum-post.tpl.php file (also attached) but I am not even sure that is the problem. As far as I can tell, the file says it will print a title.
Thanks! Any help would be greatly appreciated!
Andrew
FYI, I am using the Blue Lagoon stacked theme.
| Comment | File | Size | Author |
|---|---|---|---|
| #20 | forum-panels.png | 195.64 KB | derekwebb1 |
| #20 | forum-no-panels.png | 189.87 KB | derekwebb1 |
| advf-forum-post.tpl_.php_.zip | 1.63 KB | dunklea |
Comments
Comment #1
michelleChange:
to:
Michelle
Comment #2
dunklea commentedAwesome, that did the trick! Thank you very much for your support Michelle!
Andrew
Comment #3
michelleNo problem. Glad you got it working. :)
Michelle
Comment #5
friolator commentedRather than starting a new thread on this, I figured I'd just tack on to the end of this one. We're seeing the exact same symptoms as the OP describes, but we're in the 6.x-2.x-dev (2010-Mar-25) version.
the $title variable simply isn't there for the top post, but it is for comments that follow. If I dsm() the $title variable at the top of the post.tpl.php file (before anything else), on a thread that has 3 posts, only the two comment titles are printed. Interestingly, the $node variable's title is 'null' when I dsm() $node, so it's getting wiped out somewhere, maybe?
we're using our own theme, based on naked.
any idea what might be happening here? I'm really perplexed.
Comment #6
michelleI don't have time to dig into the code right now but it's probably because a node's title is printed in the page.tpl.php, which is outside of AF.
Michelle
Comment #7
friolator commentedok, that makes sense. However, i don't get why the $title is null for a top post, yet it works in comments.
In our case, the problem is definitely something different than the OP's issue, since that was just a case of changing a test in the template file. In our case, the variable itself is just empty for top posts.
weird.
Comment #8
michelleBecause you're supposed to have the title for the comments at the comment level. The title for the node is handled at the page level. That said, I thought it was also available at the node level. I'd have to check the code to be sure.
Michelle
Comment #9
TonyT commentedI had the same problem and edited my advf-forum-post.tpl.php file. By default the forum module seems not to display the node subject at the top of the topic page. So if it is not displayed by Advanced Forum it is only visible in the browsers title bar. I noticed that others seem to have the same issue (see http://drupal.org/node/638394 ) and others have also made this change to get the subject to be present on the top_post. So I wonder if it is worth having an Advanced Forum configuration option to make it easy to choose if you want the top post to have a subject displayed?
Thanks for a great module!
Tony
Comment #10
michelleI wouldn't make it a config option but it makes sense to have the variable available. Will look into this.
Michelle
Comment #11
michelleOk, I just confirmed that the title not only is available to the node but it's already set to print it. Nothing more I can do here.
Michelle
Comment #13
derekwebb1 commentedI am using panels to display the advanced forums (v 6.x-2.0-alpha4) and the title does indeed get wiped (Set to NULL in the node object) somewhere before $variables['title'] gets set in the node preprocessor. The title is set in the page preprocessor correctly though. The title does not get wiped if I use AF in a non-panels site though.
I can get around this by using drupal_get_title() in the forum node template however that's not my preferred option. I will continue to look into this and if I can find out where it is getting wiped I will report that here.
Cheers
Comment #14
derekwebb1 commentedAdditionally, nodes that are not forum types seem to have titles within the node object as expected...
Comment #15
michelleI already checked this in #11 and confirmed it works as expected. Possibly Page Manager is having some effect since you are throwing that into the mix, but it works as designed under normal usage.
Michelle
Comment #16
derekwebb1 commentedHuh? So normal usage is with vanilla Drupal only?
Comment #17
michelleWell, that's the baseline to test against. We can't be responsible for what other modules do to nodes.
Michelle
Comment #18
derekwebb1 commentedOk, however do you have any suggestions about how to debug this? I have been pouring over panels code as well as AF code and I don't see anything yet that would be causing this. I am however mostly a front end developer.
The 2.0-alpha4 branch is supposed to work with panels (hence the panels integration plugins.) However it does not actually fully work with panels. For instance, to get the comments that have been posted to actually display, one must create a new view pane based off the nodecomments view and set the arguments to be pulled from the url, and then place that pane into your panel. Also using panels, or panels and panels everywhere, the title is nowhere to be seen. In processing, the title of the node is still available at the call to menu_get_item (ln 302 menu.inc) however I have been unable as of yet to determine exactly where it gets whacked. If you have any developer advise on tracking this down I would greatly appreciate it. I know I can simply patch this up by using drupal_get_title() in the forum post template but I think that is rather hackish and would prefer to find the real cause. If I have to go with my ugly patchwork I guess I will but I would rather not.
Thanks
Comment #19
michelleIt works with Page Manager in that it provides the forum pages as system pages and bits of AF as content panes. There is no Page Manager integration for the nodes, though I never had any issues with it on my own site. I don't know what all these issues you are having are caused by but they don't sound like they have anything to do with AF. You might want to try asking for help in the CTools queue or in the forums.
Michelle
Comment #20
derekwebb1 commentedI can tell you that a base (or very close to it) install without panels works as expected and the same install with panels does not. See images: The only thing disabled from non-working version to the working version is panels.
So the issue is very likely in AF or Panels.
Comment #21
derekwebb1 commentedFound it!
When using panels be sure to check leave node title... If it is unchecked then node.inc in ctools (specifically) ctools_node_content_type_render() (line 89) will set the title to NULL and it will not be available to the forum templates.
It was indeed my own fault that it was not showing up!
Chalk up another issue to user error...
Cheers