Hi,

Just wondering... is there a reason for the line break on line 31 of views-view-fields.tpl.php? Because it actually creates a "br" that prevents me from inlining fields. Am I doing things not the way I am supposed to?

Comments

monish_deb’s picture

Have you tried Format->Show->Fields->Settings where you will find multiple checkbox(under "Inline Fields") corresponds to each field whom you want to be inline ? This is the only way to inline your fields in view.

nicolas bouteille’s picture

Yes precisely, when I do that the fields are not inlined because of the "br" that is added because of the line-break in the template file.
I have also tried to changed the html of each field and wrapper to a "span" but the "br" keeps preventing them to be inlined.
I am not stuck, because I can either float them in css or remove the line-break in the .tpl file but I was just wondering why there was a line-break and how it is possible that it is creating a "br"...

esmerel’s picture

Status: Active » Fixed

Probably for code readability; you can always copy the template over to your theme and remove the line break - that is probably the easiest fix for you.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

nicolas bouteille’s picture

Status: Closed (fixed) » Active

Okay I am facing this problem again.
Whenever I try to override a template file in Views, line breaks and indentation are converted in empty <p> or <br> tags. This is very annoying. Any idea why this is happening and how I can disable it ?

merlinofchaos’s picture

Status: Active » Fixed

If line breaks are getting converted to <p> or <br> tags, that is happening 'downstream' from Views because it's being run through an input filter which is set to convert linebreaks. That's unrelated to Views other than the order you have things configured in. You'll have to figure out what's going on there, but if you have, for example, a view inserted into a node or other textarea, that'd do it.

The br has nothing to do with the templates themselves.

nicolas bouteille’s picture

Thank you ! Indeed, I always embed Views in the body field of Basic Pages so that clients can easily edit the page title, add a text before and after the view and edit the url and meta tags... Maybe I should create another content type instead with three fields : before, embed-view, after. And disable filters in the embed-view field.

merlinofchaos’s picture

Views has headers and footers already, so that seems kind of an odd way to use a view. If you're going to do that, I'd recommend views_attach.

Also, rearranging your filters so that the embed view happens after the linebreak filter probably does the trick as well.

nicolas bouteille’s picture

Thanks for all the tips! I did not know of views_attach, now replaced by EVA: Entity Views Attach BTW and it looks great! I'll try to rearrange filters too. But I think it still is a better way to create three separare fields for inserting text before and after the view. So that I can hide the embed-view field to the client.
Views has headers and footers okay, but clients are 99% of the time not good at handling a computer so they need to have only one way of editing a content. Editing a view right now is not only another way to do it but also a scary one for clients! I see views header and footers more like a way to display info such as the number of results found, or the pager of a slider for example... But I don't use it to let clients add some custom text without needing to call me.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Anonymous’s picture

Issue summary: View changes

br