Support Forum

List View: Unread posts – force newline for spListLabel

CF Conrad_Farlow
Conrad_Farlow
Member

When I am reading the list view generated by clicking the unread posts icon I want the spListLastPost = spListLabel to start on a new line so that the formatting is always consistent.

What is the best way of doing this – the screen-shot should make it obvious what I would like to do. I would like the Topic Title left justified on one line and then the last post data on the line below. I’m sure this is easy if you know how.

Conrad

26 Answers

New Answer

YS Yellow Swordfish
Yellow Swordfish
Member

Er… like it is on this site you mean? 🙂
have you changed the template or styling on that to centre it in some way?

CF Conrad_Farlow
Conrad_Farlow
Member

Yes of course, in fact in several ways.

                sp_ColumnStart('tagClass=spColumnSection spLeft&width=400px&height=20px');

                sp_ListTopicName('tagClass=spListTopicRowName spLeft', __sp('Browse the thread %NAME%'));

I have added a width parameter which works fine but the sp_ListTopicName with the tag class doesn’t seem to work.

Basically I want

  sp_ListTopicName('', __sp('Browse the thread %NAME%'));

To left justify the Topic name so it is consistent with the rest of the site. How?

Conrad

YS Yellow Swordfish
Yellow Swordfish
Member

But have you changed the CSS in this? For me it does format left correctly so can you work back through changes to see what the cause is?

CF Conrad_Farlow
Conrad_Farlow
Member

By the CSS I presume that you mean the sp-list-view-functions.php? I have compared my file with build 7705 which I downloaded and other than the date and truncate settings, there is no difference, so I can’t see anything there.

Is there not a brute force way of forcing the ‘Last post blah blah….’ text from displaying on a new line? It is justifying left correctly but not starting a new line due to the variable title widths. I have made some topic titles deliberately long but truncated to test both the truncate feature and the alignment.

Regards

Conrad

YS Yellow Swordfish
Yellow Swordfish
Member

I still don’t not really understand why it doesn’t.

Still – the only way to force a div to open beneath everything before it is to issue a clear statement. You will find these liberally used in the templates as an insertbreak function call. You could try inserting one of them before the call to the offending line.

CF Conrad_Farlow
Conrad_Farlow
Member

Oh that nearly did it!

All I need is for the right arrow to be on the right and for the last post text to align with the topic title on the left. They are off course tied at the moment, spLeft makes both align left with icon first.

So if I can call the spIcon and spPostLink separately that should do it.

Conrad

YS Yellow Swordfish
Yellow Swordfish
Member

Don’t think you can cal them separately,.
That looks like either padding or margin to me. What does Firebug have to say?

CF Conrad_Farlow
Conrad_Farlow
Member

Firebug says that if I add spRight to the icon it goes to the right and looks perfect but then the text stays in the same place  with a gap to accommodate the icon. In other words it stilll will not align left and it’s driving me as crazy as a box of frogs!

In firebug if I add text-align: left; of course it works fine. The section is span class=”spListLabel” , is it possible to pass arguments for each class “spListLabel” and “spIcon” in the array from sp-list-view-functions.php?

    $defs = array('tagId'        => 'spListLastPost%ID%',
                  'tagClass'     => 'spListPostLink',
                  'labelClass'    => 'spListLabel',
                  'linkClass'    => 'spLink',
                  'iconClass'    => 'spIcon',
                  'icon'        => 'sp_ArrowRight.png',
                  'tip'           => 1,
                  'niceDate'    => 0,
                  'date'          => 1,
                  'time'          => 1,
                  'user'          => 1,
                  'echo'        => 1,
                  'get'            => 0,

 Where else is spListView used? Unread Posts, Subscribed Threads, Watched Threads etc so probably not a good idea anyway. I don’t like messing with the functions at all.

Conrad

YS Yellow Swordfish
Yellow Swordfish
Member

1 – what arguments?
2 – the list view is also used for search queries
3 – I still would like to know why your list displays different to mine, It must be down to CSS changes.

CF Conrad_Farlow
Conrad_Farlow
Member

What can I say Andy other than as far as I’m aware there are none. I compared (by machine) the sp-list-view-functions.php files from my version and Build 7705, the only differences were references to truncate.

You know what I am trying to achieve, I apologise if I am using the incorrect terminology. I have read more about arrays and I know that there is nothing I can do there.

Can I get hold of your code with the spLeft commands in and see what happens? Where else could I have screwed with the CSS for this other than sp-list-view-functions.php?

Conrad

YS Yellow Swordfish
Yellow Swordfish
Member

Well I was actually meaning the theme CSS file itself.
But Firebug should tell you what is set.
If my attempt to register on your site the other night had been successful I could have taken a look but I can’t open the popups as a visitor.[Update] Actually i CAN run a search as a visitor which also uses the list view template and that looks just fine….

CF Conrad_Farlow
Conrad_Farlow
Member

Hi Andy thanks for taking the time, it’s appreciated. I have sent you a PM with a new password and given you admin status. I’ve never even tried the search feature, I never use it on my sites but of course I do use it here.

Conrad

CF Conrad_Farlow
Conrad_Farlow
Member

Search results look exactly how I want them to. Except for a tiny amount of bleed from the spSearchSection into the main container. That was easily fixed by setting the spSearchSection width to 99.2%, if only the latest unread posts was that easy.

Conrad

YS Yellow Swordfish
Yellow Swordfish
Member

Ha. Good try but I am being stupid.
As a new registrant I wont get any unread posts in the list anyway so still can’t look at the popup list!
I have logged out. What you could do is go into the database, sfmembers table, find my row and change the last visit date to something earlier than today (and to a date where posts have been made since) to ensure when I log back in again it will recalc my unread postlist.
Is that possible?