Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
any category listing, any plugin, breaks at the blank between words
I have been able to get around this by using an underscore to connect each word in the category titles.
But it doesn’t look good.
Just look on the right hand side of the above page.
Offline
Re: any category listing, any plugin, breaks at the blank between words
A couple of ways you could approach this. Your sidebar has a fixed width and it is not wide enough to avoid line wrapping with your category titles. So some combination of reducing margins and/or font size and increasing the sidebar width may be all you need.
Or you could use non-breaking spaces between words in your category titles. Use rah_replace to do the substitution.
Code is topiary
Offline
#3 2010-02-06 01:20:01
- uli
- Moderator
- From: Cologne
- Registered: 2006-08-15
- Posts: 4,310
Re: any category listing, any plugin, breaks at the blank between words
Jim, have you tried to cook following Els’ recipe?
In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links
Offline
Re: any category listing, any plugin, breaks at the blank between words
uli wrote:
Jim, have you tried to cook following Els’ recipe?
Yes, didn’t seem to have an effect. I did a page reload, etc. No change I could see.
Hmm. If I remember the css correctly, the entire page is 770 pixels wide. I have no problem changing it to 1024 pixels wide. I can change that and see what happens.
Offline
Re: any category listing, any plugin, breaks at the blank between words
jsoo wrote:
A couple of ways you could approach this. Your sidebar has a fixed width and it is not wide enough to avoid line wrapping with your category titles. So some combination of reducing margins and/or font size and increasing the sidebar width may be all you need.
Or you could use non-breaking spaces between words in your category titles. Use rah_replace to do the substitution.
My part:
I connected the words in some category titles with underscores _ and they don’t wrap. Some that do wrap are less wide than those that don’t wrap.
I read the plugin help and … it seems to be for something else. So if you would please explain how to use that plugin to get the no wrap in category titles, I would appreciate it. I know a small bit of css and even less php.
Offline
#6 2010-02-06 03:08:57
- uli
- Moderator
- From: Cologne
- Registered: 2006-08-15
- Posts: 4,310
Re: any category listing, any plugin, breaks at the blank between words
You need to change both #container
and #sidebar-2
. My trial with Firebug worked.
In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links
Offline
Re: any category listing, any plugin, breaks at the blank between words
My, the default Txp stylesheet is showing its age. Box model hack, fer cryin’ out loud…
In Presentation->Style, find this:
#container {
margin: 10px auto;
padding: 10px;
width: 760px;
}
Increase the width. Then find this:
#sidebar-1, #sidebar-2 {
padding-top: 50px;
width: 150px;
}
Change it to this:
#sidebar-1 {
padding-top: 50px;
width: 150px;
}
#sidebar-2 {
padding-top: 50px;
width: 150px;
}
and then increase the #sidebar-2 width by the same amount you increased the #container width.
Then add this:
#sidebar-2 ul {
list-style: none;
margin-left: 0;
}
#sidebar-2 ul ul { margin-left: 1em; }
See where that gets you.
Learn to use the Firefox web development tools, or the WebKit inspector, so that you can see the actual size of your elements overlaid on the page.
Code is topiary
Offline
Re: any category listing, any plugin, breaks at the blank between words
uli wrote:
You need to change both
#container
and#sidebar-2
. My trial with Firebug worked.
I did. I changed container to 1024 and sidebar-2 to 300.
Offline
Re: any category listing, any plugin, breaks at the blank between words
jsoo wrote:
My, the default Txp stylesheet is showing its age. Box model hack, fer cryin’ out loud…
In Presentation->Style, find this:
#container {
margin: 10px auto;
padding: 10px;
width: 760px;
}
Increase the width. Then find this:
#sidebar-1, #sidebar-2 {
padding-top: 50px;
width: 150px;
}
Change it to this:
#sidebar-1 {
padding-top: 50px;
width: 150px;
}
#sidebar-2 {
padding-top: 50px;
width: 150px;
}
and then increase the #sidebar-2 width by the same amount you increased the #container width.
Then add this:
#sidebar-2 ul {
list-style: none;
margin-left: 0;
}
#sidebar-2 ul ul { margin-left: 1em; }
See where that gets you.
Learn to use the Firefox web development tools, or the WebKit inspector, so that you can see the actual size of your elements overlaid on the page.
Me:
I changed the sidebar-2 width to 500 pixels. It gives lots of room. But the categories with blanks between each word still gives one word of the title per row on some categories.
One such example from my site would be:
Grand
Duchy
of
the
Royal
Moonraker
I think that if it was a room problem, ‘of’ and ‘the’ of the above example from my site would be on the same line as Moonraker takes up enough width that ‘of the’ should be on one line, but they are on separate lines instead.
I have no idea what a ‘non-breaking’ space might be. I use the spacebar on my keyboard. So, please forgive my ignorance.
Offline
Re: any category listing, any plugin, breaks at the blank between words
Add padding-left: 0;
to #sidebar-2 ul
. Then add:
#sidebar-2 ul li {
margin-left: 0;
padding-left: 0;
}
That should get you closer.
Code is topiary
Offline
Re: any category listing, any plugin, breaks at the blank between words
And get rid of the box model hack rules:
\width: 150px;
w\idth: 150px;
and so on. Either that, or update their values accordingly (to match the increased widths for #container
and #sidebar-2
).
Code is topiary
Offline
Re: any category listing, any plugin, breaks at the blank between words
JimJoe wrote:
I have no idea what a ‘non-breaking’ space might be. I use the spacebar on my keyboard. So, please forgive my ignorance.
No worries. Non-breaking space is an HTML entity,
. It outputs a space but won’t allow a line break. I think you’ll be better off getting the CSS widths adjusted as you need them; don’t worry about rah_replace
for now.
Code is topiary
Offline