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

[Solved] Type spacing issue on All Categories page in default installation

sudden156sudden156 ✭✭
edited September 2013 in Vanilla 2.0 - 2.8

I've noticed an odd spacing issue when you press the 'Categories' link, as you'll see at the link to my page there is no space before 'Most recent' nor before the time, like this:

3 discussions 179 commentsMost recent: Suggest a category by name8:23PM

Excuse my messy style.css. I still haven't moved out my new styling to a custom.css. But the above seems to be a problem with the default installation. Any ideas how to correct it most welcome. Or even how to disable the 'Categories' link on the sidebar, as it doesn't seem of much use.

Thanks.

Best Answer

  • Options
    hgtonighthgtonight ∞ · New Moderator
    edited September 2013 Answer ✓

    That is nefarious!

    This is actually due to a lack of whitespace in the source, not a CSS issue. Open up /applications/vanilla/views/categories/all.php and add a space right after the first single quote ' on lines 67 and 72.

    This was fixed in 2.1 by giving all the meta spans a specific class and setting up the margins explicitly.

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

Answers

  • Options
    hgtonighthgtonight ∞ · New Moderator
    edited September 2013 Answer ✓

    That is nefarious!

    This is actually due to a lack of whitespace in the source, not a CSS issue. Open up /applications/vanilla/views/categories/all.php and add a space right after the first single quote ' on lines 67 and 72.

    This was fixed in 2.1 by giving all the meta spans a specific class and setting up the margins explicitly.

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

  • Options

    Brilliant! Solved that. Thanks very much @hgtonight. Can't beat highly specific know-how.

  • Options

    Out of interest, how would you add more than a single space at line 67, so the spacing is the same as on All Discussions? I see just typing in spaces doesn't work.

  • Options
    hgtonighthgtonight ∞ · New Moderator

    Browsers treat white space between elements as a boolean. There either is whitespace, or there isn't. You could force extra whitespace with an html entity like   but that is a terrible practice.

    It would be better to just use some CSS to fix any margins you have. Add this declaration to your custom theme's CSS file.

    .DataList.CategoryList .Meta span {
        margin-right: 12px;
    }
    

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

  • Options

    I tried your CSS. I can see that it should work fine, but for some reason it doesn't. It's not important, a single space is fine.

  • Options

    Ignore that last comment. It work's great, I was uploading to the wrong directory...

  • Options

    You could also add this declaration to preserve all spaces:

    white-space: pre;

    Add Pages to Vanilla with the Basic Pages app

Sign In or Register to comment.