Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Options

Editing a category page to display the category name above the content

edited March 2012 in Vanilla 2.0 - 2.8

I've been trying to look around in various class files to find out how to have the name of the category the person is viewing printed out along with the discussions for that category. I assumed it might be in class.categoriescontroller.php but was slightly overwhelmed when trying to look through it. On top of that, I'm not entirely sure what I'd even have to add to get it to print out the category name. (I'm just trying to get it to display the name of the category).

For further clarification:

How it currently looks:
Imgur
How I am trying to make it look:
Imgur

Thanks!

Answers

  • Options
    422422 Developer MVP
    edited March 2012

    Using firebug, can you right click all/general link as seen in 1st pic and view its attributes. There may be a simple css change you can make , you may need to do something like top:-50px etc to position.

    I havent got internet for a week or so, so cannot help much.

    There was an error rendering this rich post.

  • Options
    edited March 2012

    It's CSS path is:
    html body#vanilla_categories_index.Vanilla div#Frame div#Body div#Content ul.DataList li.Item div.ItemContent div.Meta span a.Category

    Because it is an item in a list, when I try to reposition it it simply repositions the entire list of elements (every "All/General" for each discussion is moved up as well).

    Thank you for the suggestion, but I don't think that trying to do it simply via CSS by relocating the Category tag will work. (Unless there's another way of doing it which I didn't try, which I'm sure there is :P )

  • Options

    Unfortunately I can't go back and edit, but I found this:
    $this->Title(GetValue('Name', $Category, ''));

    and I feel as if this could be used to get the category name and display it? Or something like it? I still don't know where I would input something like this into the categoriescontroller file, or if that's even the right spot.

  • Options
    edited March 2012

    A friend helped me solve my problem (or come up with a way of solving it).

    Simply used:
    <h1 id="categoryTitle"><?php echo $this->Data['Title']; ?></h1>

    In my default.master.php file.

  • Options
    422422 Developer MVP

    Thanks. Love it when ppl post their fix.!

    There was an error rendering this rich post.

Sign In or Register to comment.