Looong single-word topic titles make forum expand off-screen

Looong single-word topic titles make forum expand off-screen

by Richard Miller -
Number of replies: 16

When someone types a looong single-word topic title, the whole forum widens to make it fit, and the whole right side gets shoved off-screen.

To clarify, this is in the Topic list view.

My hope is that there's some way to force those long words to wrap or break, or limit the width of the topic title column - but I can't figure it out. I've tried every CSS fix I can think of, but can't seem to target the problem.

(Mine can't be the only forum where people enter titles like "AAAAAAAUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUURRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRGGGGGGGGGGGGGGHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH!!!" can it? )

Using theme based on Canvas, Moodle 2.0.5

Average of ratings: -
In reply to Richard Miller

Re: Looong single-word topic titles make forum expand off-screen

by Richard Oelmann -
Picture of Core developers Picture of Plugin developers Picture of Testers

I can't think of any css/coding way to fix this - but I would suggest this is a 'people' issue rather than a technical one - do you plan on coding for every single eventuallity of daft meaningless entry that someone may possibly put in to your site? - if so you could be at it for a very long time :D What if someone decided to make their logon name similarily meaningless and long? etc....

I would be tempted to say that the best solution for this is for the forum moderator to go in and determine whether the post itself is meaningful or not, and then to either edit the post title or delete the entire post (possibly with a polite warning message to the culprit!) as appropriate - if this is such a laborious task because it happens so often as to make this impractical then a few words to the student/poster responsible may be needed!

Richard

 

Richard

In reply to Richard Miller

Re: Looong single-word topic titles make forum expand off-screen

by Mary Evans -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

Open .../moodle/theme/canvas/style/mod.css using Notepad and add the following CSS rule.

.forumpost .no-overflow { overflow: auto;}

Save the file back to your Moodle server.

I am assuming you have Theme designer Mode Enabled...otherwise you would not have been able to select Canvas theme.

Refresh your browser using Ctrl + F5 and you should see a scroll bar appear in the forum post area.

That should fix it.

However Canvas theme is not meant as a theme to use but more as a parent theme.

Do you get the same problem with other themes?

Cheers

Mary

Average of ratings: Useful (1)
In reply to Mary Evans

Re: Looong single-word topic titles make forum expand off-screen

by Richard Miller -

Thanks, Mary (and Danny) -

I tried both of these code solutions, and neither worked - possibly because there doesn't appear to be a use of .forumpost in the Topic list view?

Is there something I could target in that view that would be effective?

Just in case I'm not using the right terminology here, by "Topic view" I mean the page that has the forum description at the top, the "add a new discussion topic" underneath, and then a paged list of topics within that forum.

Note: I AM actually using Canvas as a parent theme, so I'm making the changes to the theme files based on it.

In reply to Richard Miller

Re: Looong single-word topic titles make forum expand off-screen

by Mary Evans -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

OK,

Working in Moodle 2.x.x requires you to have Theme designer mode enabled in Theme settings. This prevents Moodle saving cached data from files and images etc. otherwise you will not see the changes you are making.

Try adding this CSS rule to end of your theme's core.css file..

.forumpost .row .topic {overflow: hidden;}

I have just checked this against the forum post here...this is the rule in Moodle Offical theme...

HTH

Mary

In reply to Mary Evans

Re: Looong single-word topic titles make forum expand off-screen

by Richard Miller -

Thanks, Mary.

Unfortunately, this code  target elements on the wrong page - "website.com/mod/forum/discuss.php?d=XXX" rather than "website.com/mod/forum/view.php?d=XXX", which is what I need.

The issue is with topic titles in the forum view, rather than in the thread.

(And I'm aware of the necessity for having Theme designer mode enabled - thanks for the reminder)

In reply to Richard Miller

Re: Looong single-word topic titles make forum expand off-screen

by Mary Evans -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

In that case try...

#page-mod-forum-view .forumpost .row .topic { overflow: hidden}

or alternatively...

.path-mod-forum .forumheaderlist .discussion .starter {overflow: hidden}

In reply to Mary Evans

Re: Looong single-word topic titles make forum expand off-screen

by Richard Miller -

Thanks, Mary ...

Unfortunately the first had no visible effect at all, and the second broke all kinds of stuff - but didn't affect the titles at all.

Oh well ...

In reply to Richard Miller

Re: Looong single-word topic titles make forum expand off-screen

by Mary Evans -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

I should have said this at the start...try Firefox and Firebug and try checking out the elements on the page yourself. Eventually you will find the CSS that works.

Cheers

Mary

In reply to Mary Evans

Re: Looong single-word topic titles make forum expand off-screen

by Richard Miller -

Mary, that's precisely how I began. I spent several hours searching for the right CSS to target, and only posted to this forum for help once I'd been stumped.

Thanks anyway.

In reply to Richard Miller

Re: Looong single-word topic titles make forum expand off-screen

by Miriam Laidlaw -
Picture of Plugin developers

Hey there,

I tried this out just now by creating a post with a long title:

long title

As you can see, it pushes the other fields off to the side without the ability to scroll over to them.

So I added into my style sheet:

.path-mod-forum .forumheaderlist .discussion .starter {
    overflow: hidden;
    max-width: 350px;
}

It wouldn't work without some sort of max width, you choose how wide. Now the forum looks like this:

forum works

Average of ratings: Useful (1)
In reply to Miriam Laidlaw

Re: Looong single-word topic titles make forum expand off-screen

by Danny Wahl -

that would work and you could also trade it out for overscroll-x:scroll

so that someone could scroll and see the whole title, just in that specific TD

Average of ratings: Useful (1)
In reply to Miriam Laidlaw

Re: Looong single-word topic titles make forum expand off-screen

by Richard Miller -

That's it, hurrah!

Thanks, Miriam ... whew.

In reply to Richard Miller

Re: Looong single-word topic titles make forum expand off-screen

by Danny Wahl -

.forumpost .topic .subject {overflow:hidden;}

Average of ratings: Useful (1)
In reply to Danny Wahl

Re: Looong single-word topic titles make forum expand off-screen

by Richard Oelmann -
Picture of Core developers Picture of Plugin developers Picture of Testers

doh! of course - Thank you Danny and Mary!

To put my previous post in context, I recently had to deal with a similar situation (on a different system, not moodle) where a user appeared to be deliberately trying to break the system by creating entries in a form that it had not been designed to deal with - in that case though I didn't have access to the source code of the form as it had been in use for some time and I had inherited it on the system.

Yes I know the form should be redesigned to prevent abuses like that happening, but it is being replaced soon anyway as I am in the process of working on a replacement website for the club involved (which will be moodle based! smile)

In my recent case the user was spoken to about deliberatley trying to break the system - and then put to work helping me redesign the website lol!

Rich

In reply to Richard Miller

Re: Looong single-word topic titles make forum expand off-screen

by Mary Evans -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

I've just been testing this.  And find that the majority of themes have this covered in the later versions of Moodle. Moodle 2.3 uses the one I added, but Moodle 2.0.5 does not have a class selector called no-overflow in forumpost. So perhaps what Daniel is saying is perhaps the best fit.