Sackgesicht VIP
Total posts: 1,636
04 Nov 2015 10:30

A list view template like "table" should provide a parameter "Title Nowrap: Yes/No" to avoid unwanted wrapping of title content.

<h2 class="record-title nowrap">

Last Modified: 23 Nov 2015


Sergey
Total posts: 13,748
04 Nov 2015 16:38

In what template in particular you would like to see it? I can add it. But I would not add it to each template. I think this is something for template customiztion. This nowrap can loks bad on small screens so it is not common practice. usualy those cases for nowrap are rare and particular nowadays.


Sackgesicht VIP
Total posts: 1,636
04 Nov 2015 21:35

I would suggest the "table" template of the template pack. Yes, it can be easily accomplished with a copied template, but the problem with this approach is that bug fixes will not apply automatically to them. Therefore a supported template would be the proper place. To make it even more flexible, the parameter could be a "Class Parameter" (empty text field) where the user can add his desired classes between the "Title Tag" and "Date Format" parameter under the "Format" section.


pepperstreet VIP
Total posts: 3,837
05 Nov 2015 14:44

Sackgesicht To make it even more flexible, the parameter could be a "Class Parameter" (empty text field)

+1 better to target the title by a custom class and change appearance with CSS.
i.e. white-space, text-overflow etc.

BTW, this could be done without an extra class, too. If the page or template provides a unique class on a "wrapper" div.


Sergey
Total posts: 13,748
07 Nov 2015 14:00

If we talking about classes, there is cob-title-td class on td that contain title. Co you can use .cob-title-td .record-title selector to apply nowarap properties.


Sackgesicht VIP
Total posts: 1,636
08 Nov 2015 21:23

Sergey If we talking about classes, there is cob-title-td class on td that contain title. Co you can use .cob-title-td .record-title selector to apply nowarap properties.

Yes, but that would affect other tables as well. Example: List with a parent field and nowrap should be applied to parent field only without using a customized list template.


Sergey
Total posts: 13,748
09 Nov 2015 08:51

Do you think that inserting section ID into class name will solve it?


pepperstreet VIP
Total posts: 3,837
09 Nov 2015 09:46

Sackgesicht Example: List with a parent field and nowrap should be applied to parent field only

You might add a custom fields class to the parent field. That should give you more specificity to target those particular titles.


Sergey
Total posts: 13,748
09 Nov 2015 11:35

pepperstreet

Sackgesicht Example: List with a parent field and nowrap should be applied to parent field only

You might add a custom fields class to the parent field. That should give you more specificity to target those particular titles.

There should be something in template itself if you what to apply changes to articlers list but not to child views. Custom field class will allow you to style children view withough affecting current list view.

Sackgesicht

Sergey If we talking about classes, there is cob-title-td class on td that contain title. Co you can use .cob-title-td .record-title selector to apply nowarap properties.

Yes, but that would affect other tables as well. Example: List with a parent field and nowrap should be applied to parent field only without using a customized list template.

By the way Cobalt table template has class on table section-<?php echo $this->section->id; ?>. So you can use selector .section-12 tr td.cob-title-td h2 or somethign like this. This will affect only current table.


Sackgesicht VIP
Total posts: 1,636
19 Nov 2015 22:10

It will not solve the problem to address an individual table. Just imagine the case that you use the same template for a relation field listing within another section and at the same time for the section listing of this field. Changes will affect both tables. Therefore the best solution would be to provide a table class parameter as described above.


pepperstreet VIP
Total posts: 3,837
20 Nov 2015 17:27

Sackgesicht same template for a relation field listing within another section and at the same time for the section listing of this field. Changes will affect both tables.

What about custom field class in Relation field? This would add a specific class to the "container". IMHO you should be able to distinguish between both contexts.

Therefore the best solution would be to provide a table class parameter as described above.

However, I agree that it is not a bad idea to have custom class parameters.
Maybe in general and for all main parts and structural containers in a template!

For instance, to add certain base classes from other popular CSS frameworks. Often they follow the same basic idea and structure, but differ in class names only.
Another example: Pre-defined bootstrap table classes. A custom input field would allow to change the table appearance by changing template parameters. (Same principle like J! core class suffixes)

So, additional custom class parameters could result in better compatibility without re-writing default templates. Apart from that, better and easier customization with my own classes, too.


Sergey
Total posts: 13,748
23 Nov 2015 14:35

I have added CSS class parameter to table template. But I still believe there is not need for that. You have uniquie class on it. So if you use > in selector it will only apply to exact HTML element.

table.section-12 > tr > td.cob-title-td > h2 {
    white-space: nowrap;
}

Somethign like this will only work on current table.

Powered by Cobalt