0

Here's the normal template for Advanced Forum:

enter image description here

I'd like to modify the template of advanced forum so that I can

  1. Remove the elements in red
  2. Rearrange the elements in blue
  3. Edit the elements in green
  4. Display the topic starter's profile2 picture

so that I can achieve the result below:

enter image description here

So far, I've tried editing advanced-forum.naked.topic-list.tpl.php but it doesn't change anything. I've managed to remove some of the content with Panels but I cannot modify what's left over here.

3 Answers 3

1

When I had to do this I found there are lots of template files and it's not obvious what controls what. I ended up putting die() in each one to find out which template file was used for each view, and then a case of trial and error to make the changes I wanted.

When you have worked out which files need editing then you should copy them from:

/sites/all/modules/advanced_forum/styles/naked/advanced-forum.naked.TEMPLATE_NAME.tpl.php

to your theme at:

/sites/all/themes/YOUR_THEME/templates/advanced-forum.naked.TEMPLATE_NAME.tpl.php

Any files here will override the ones in the advanced forum themes folder.

5
  • Thanks :) Now I've found the template file and I notice that they are printing things like $header and $rows. How do I modify the content of these variables? I ran global $rows; dsm($rows); with devel and nothing appears, but when I remove that line, it's clear that $rows contain information. running dsm($user) prints $user correctly so devel is working properly.
    – ashash
    Commented Apr 4, 2014 at 16:13
  • Oh wait, I think I've found what I need here admin/structure/views/view/advanced_forum_topic_list
    – ashash
    Commented Apr 4, 2014 at 16:21
  • Sounds like you've found it - it will be in another template file somewhere.
    – Felix Eve
    Commented Apr 4, 2014 at 17:24
  • ah actually I didn't need to edit the template. I used views to acheive what I needed :)
    – ashash
    Commented Apr 5, 2014 at 18:07
  • Sounds like a good solution - those templates are tricky!
    – Felix Eve
    Commented Apr 7, 2014 at 8:04
1

I achieved what I wanted (rearrange, add and remove fields, and set the display format for the time format) just by using views here : admin/structure/views/view/advanced_forum_topic_list

1

Just to update the answer from @Felix Eve - if doing it in your own theme in Drupal 7 (which is recommended) then save the "naked" file here, ie with a hyphen and no "naked":

/sites/all/themes/YOUR_THEME/templates/advanced-forum-TEMPLATE_NAME.tpl.php
1
  • Thank you so much for this. This naked suffix is really weird. Commented May 21, 2017 at 12:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.