[2.0] Backend - Entries, length of entrie titles

Discussion corner for Developers of Serendipity.
Post Reply
u1amo01
Regular
Posts: 273
Joined: Fri Sep 28, 2007 3:55 pm
Location: Kurpfalz, Germany
Contact:

[2.0] Backend - Entries, length of entrie titles

Post by u1amo01 »

Hi,
I've just updated my blog to 2.0-beta2. In the backend view of the entries (not sure if this is really english) there are only shown 39 (?) letters of the title. Unfortunetly a lot of my titles are like this:
Das Leben ist ein Erdbeben und ich stehe neben dem Türrahmen - Teil 26
And the backend shows only
Das Leben ist ein Erdbeben und ich stehe…
Is it possible to change this? Is there somewhere a simple button or do I have to dive into CSS?

Best,
Klaus

(I hope you understand the meaning of this humble english :roll: )
yellowled
Regular
Posts: 7111
Joined: Fri Jan 13, 2006 11:46 am
Location: Eutin, Germany
Contact:

Re: [2.0] Backend - Entries, length of entrie titles

Post by yellowled »

u1amo01 wrote:Is it possible to change this? Is there somewhere a simple button or do I have to dive into CSS?
First of all, it's important to notice this doesn't actually cut off your actual entry titles, it just cuts off the entry titles displayed in “Edit entries”. Also, the full title of any entry is in the title attribute, so if you hover the entry title, you should see the full entry title in a tooltip.

It might be possible to change this at some point, but not using CSS. I'm not sure where we are on this right now, but it's possible the whole backend will remain smartified, so you could adapt that using Smarty, just like you can do with frontend template files.

That being said, all this is indeed on purpose. The 2.0 backend is responsive, which means it is supposed to work on a lot of different screen resolutions. In order to make the layout work on all of them, we had to save space in some places. The length of the entry titles in “Edit entries” is one of them.

We might be able to emit a few more characters there, but since there's no way to tell how long these entry titles might get in various blogs, trimming the emitted length made it easier to get the layout up and running, especially on small screens. Emitting the full length title will most likely not work on small screens, and there's no good way to limit the length based on the screen resolution.

Why is it a problem that the entry titles are cut off anyway? You should be able to tell entries apart based on the cut-off part, right? It's not like it's limited to 10 characters or something …

YL
u1amo01
Regular
Posts: 273
Joined: Fri Sep 28, 2007 3:55 pm
Location: Kurpfalz, Germany
Contact:

Re: [2.0] Backend - Entries, length of entrie titles

Post by u1amo01 »

Thanks for the answer.
Why is it a problem that the entry titles are cut off anyway? You should be able to tell entries apart based on the cut-off part, right? It's not like it's limited to 10 characters or something …
Unfortunetly I have 26 entries (and more to come) with absolute same beginning, with "part xy" at the very end. Not the way a programmer should name things, I know. So it would be nice if I could change the truncation somewhere in the future.
onli
Regular
Posts: 2825
Joined: Tue Sep 09, 2008 10:04 pm
Contact:

Re: [2.0] Backend - Entries, length of entrie titles

Post by onli »

YL, it sure would be nice if we could have a solution where the titles are as long as possible and just shorten when the place is not available, like with overflow. I had a short look at the markup and realized that might not be easy though.

I am quite certain we want to keep admin themes as separate, overwritable templates (and this thread shows why).

So for the time being, the best solution is to fork the backend-template. Create a template folder with only an info.txt (select a name) and the config.inc.php of 2k11.

Then, get the admin/entries.inc.tpl into your template, into the admin-directory, and remove the trim in line 140 like this:

Code: Select all

<h3><a href="?serendipity[action]=admin&serendipity[adminModule]=entries&serendipity[adminAction]=edit&serendipity[id]={$entry.id}" title="#{$entry.id}: {$entry.title|escape}">{$entry.title|escape}</a></h3>
Untested, but I'll help if it doesn't work.

Now, you should only have to check the config.inc.php and the admin/entries.inc.tpl of 2k11 when new s9y-Versions get released, if you want their updates.
yellowled
Regular
Posts: 7111
Joined: Fri Jan 13, 2006 11:46 am
Location: Eutin, Germany
Contact:

Re: [2.0] Backend - Entries, length of entrie titles

Post by yellowled »

onli wrote:YL, it sure would be nice if we could have a solution where the titles are as long as possible and just shorten when the place is not available, like with overflow.
I agree, I just don't see that with a sensible overhead.

YL
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: [2.0] Backend - Entries, length of entrie titles

Post by garvinhicking »

Hi!

How about adding the possibility of user JS? Then one could use something like:

Code: Select all

$(document).ready(function() {
  $('.entry_list h3 a').each(function() {
    $(this).html($(this).attr('title'));
  });
});
Not actually tested code, not actual CSS class names - but the idea would be to use JS to put the title inside the element on its own.

Maybe this JS could even be added to 2k11 by default, and used if the screen size exceeds a certain size?

(I know this is a tad ugly, but I'm trying to employ a pragmatic approach, because I have seen people with long blog entries like these, and this could really be an issue!)
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
yellowled
Regular
Posts: 7111
Joined: Fri Jan 13, 2006 11:46 am
Location: Eutin, Germany
Contact:

Re: [2.0] Backend - Entries, length of entrie titles

Post by yellowled »

garvinhicking wrote:Maybe this JS could even be added to 2k11 by default, and used if the screen size exceeds a certain size?
We're already using JS quite a bit in the backend, and it shows in some places. I really don't think we should use JS to modify the DOM if it can be avoided. That's one of the things which are really expensive, even with jQuery.

I'll see what I can do to make longer titles possible with a smarty/CSS solution.

YL
Post Reply