Okay, so I have the basic structure set up for AF and everything is looking good, except the forum replies (comments). What's happening is it's keeping them inside of the main content section like it should, but it's wrapping them again, messing up the format.

If you look at the attached af_01.jpg, you can see what I mean by this.

If I use 'Inspect element' in Chrome and remove 'art-box art-post' and 'art-box-body art-post-body' from under <div id="forum-comments> (af_02.jpg), it looks as it should.

So, how exactly do I get it so <div class=​"art-box art-post">​ and <div class=​"art-box-body art-post-body"> are not printed under <div id="forum-comments"> only?

CommentFileSizeAuthor
af_02.jpg140.07 KBAFX337
af_01.jpg142.52 KBAFX337
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mcdruid’s picture

These classes are not added by AF - it sounds like they're coming from your theme, which I'm guessing is Artisteer?

Do you have the same problem if you change to one of the default Drupal themes (e.g. Garland)?

Try searching in your theme directory for the offending classes e.g. art-box, art-post - I'd expect them to appear in the theme templates.

AFX337’s picture

Yes, I'm using Artisteer and switching to Garland or some other stock theme does fix it. I see where it is in the theme files, but the problem is if I remove it altogether, the content will not display properly on the rest of the site. What I need to be able to do is have it display everywhere that it does now, except in <div id="forum-comments>, because that's where it's messing things up.

I think the solution could be creating a second '$content' called '$content2' or something, with everything identical except for those two lines that need to be removed. I have no idea how to do that though.

Either that or override them using the AF theme CSS, but even then you can't really override it with a blank style, can you?

mcdruid’s picture

You ought to be able to prevent those classes from being added by the theme when you don't want them (assuming you're happy hacking the theme).

A common technique, for example, is to check the node type in the preprocess_node implementation and decide what to do (or not do) that way.

Failing that, you should be able to undo the styling that you don't want in the CSS. If, for example, some margin or padding is added by the classes you mentioned, add a rule which reverts the margin / padding to what it would have otherwise been when the classes appear inside #forum-comments.

e.g.

#forum-comments .art-post {
  padding: 0;
}

...or something like that.

You mention using the "AF theme CSS" - I don't know if this is what you mean, but as a rule I'd always edit the CSS in my theme in preference to hacking at the CSS (or any other file) provided by a contrib module.

AFX337’s picture

A common technique, for example, is to check the node type in the preprocess_node implementation and decide what to do (or not do) that way.

Yeah, that's what I was getting at. I don't know specifically how I would do that in this case though.

mcdruid’s picture

Without seeing the preprocess hooks and templates in your theme, we can't tell you exactly how to do what you want.

It looks like the classes you want to conditionally remove are probably in comment.tpl.php and your theme may or may not include an implementation of template_preprocess_comment; if not, you can add one.

In both cases, you have the node object the comments are attached to, so you can decide what to include in the markup based on, for example:

if ($node->type != 'forum') {
  // Everything except forum posts.
}
else {
  // Do something different for comments on forum posts.
}

I don't wish to be unhelpful, but this really isn't an AF issue - you may want to read up on general Drupal theming including preprocessing and template files.

If you don't have experience with Drupal theming, I suspect it will be easier to undo the styling in the CSS than to remove the classes in the markup.

Michelle’s picture

Status: Active » Closed (works as designed)

Cleaning the queue.