Welcome to Geeklog, Anonymous Friday, November 29 2024 @ 02:41 pm EST

Geeklog Forums

If title is too long, layout expands, help?


Status: offline

lestat

Forum User
Chatty
Registered: 11/15/03
Posts: 64
Hello,

I changed the table layout in my storytext.thtml template to be smaller than usual, around 200px wide. When a writer keys in a title, I set a character restriction to 34 (2 lines of 17 characters).

I'm sure this would never happen, but I do not want to take any chances. If a word happens to be more than 17 characters long (or if a writer doesn't put in spaces or whatever), my layout expands changing the entire layout of my index page.

Would anyone know how to save me from this? Is there a way to tell the code to put a dash if a word goes over a certain amount of characters?

Thank you.
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
You could try experimenting with the PHP wordwrap function or the HTML shy (soft hyphen) entity, but I don't think there's a solution that really works properly everywhere. Besides, you don't even know the font size the user has selected in their browser ...

bye, Dirk
 Quote

Status: offline

lestat

Forum User
Chatty
Registered: 11/15/03
Posts: 64
Thank you, Dirk. I'll look into this.
 Quote

Status: offline

vbgunz

Forum User
Full Member
Registered: 01/24/03
Posts: 169
Hello,

Within your themes layout directory, please check "storytext.thtml" and "featuredstorytext.thtml" and look for the tags that hold the value "{story_title}".

You can remove the "nowrap" directive if it exist and which is usually the culprit behind keeping all story titles on one line. Try it out. Good luck!
Victor B. Gonzalez -
http://aeonserv.com
 Quote

Status: offline

lestat

Forum User
Chatty
Registered: 11/15/03
Posts: 64
Thanks for the reply, but there is no 'nowrap.' What I was asking was if there was a word that happen to be 17 characters or longer, and this will probably never happen, is there a function that will put a dash when it gets to the 17th character?

I'm looking into Dirk's reply.
 Quote

All times are EST. The time is now 02:41 pm.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content