Closed (fixed)
Project:
Views (for Drupal 7)
Version:
7.x-3.6
Component:
Miscellaneous
Priority:
Minor
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
3 Apr 2013 at 14:44 UTC
Updated:
6 Jun 2013 at 00:50 UTC
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
Comment #1
monish_deb commentedHave 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.
Comment #2
nicolas bouteille commentedYes 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"...
Comment #3
esmerel commentedProbably 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.
Comment #5
nicolas bouteille commentedOkay 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 ?Comment #6
merlinofchaos commentedIf 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.
Comment #7
nicolas bouteille commentedThank 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.
Comment #8
merlinofchaos commentedViews 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.
Comment #9
nicolas bouteille commentedThanks 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.
Comment #10.0
(not verified) commentedbr