Where is that option? Is that in the template somewhere? I want the format to be the same for all posted content as right now the paragraphs are way too long and when other people start posting, they wont format it the same either. thanks.
Not sure what you mean by "paragraphs are way too long", if you mean too much text, I do not know of away to limit the amount of text in a paragraph (you can limit the total body text).
Css would be added to the themes .css file (typically style.css).
Your theme has at least one .css file in it that styles things on your site.
To set the width of a paragraph, you'd add something like:
p {
width: 300px;
}
to your theme code (in the CSS file). That'd set the width of all paragraphs, though. To get more specific, you'll need to look at what other classes or IDs are in the HTML markup and look for something unique to the content type.
Take a look at source code for the page ("View source" in your browser, or use a tool like Firebug), and find the opening HTML tag. Odds are, if you're using a contributed theme, you'll see some classes in there, like <body class="html front not-logged-in no-sidebars page-node"> (different classes are separated by spaces). Use those classes to write a more specific bit of CSS code, like:
body.page-node p {
width: 300px;
}
That'd set all paragraphs on nodes of the "page" type to be 300px wide. There's a lot more to CSS, but hopefully that helps a little.
I'm still learning CSS usage, once i understand the framework of it, I'll be off and running. I get the syntax just not the process to alter/change.
I am still trying to understand how the CSS pages are laid out. Marinelli has 12 CSS files (blocks*, comments*, common*, drupal*, forms*, layout*, links*, node*, primary-links*, secondary-links*, slideshow*, typography* (*.css)). Intuitively I'd add the code below in typography.css, is that correct?
actually, my theme (Marinelli) does not have only 1 css file to style the whole site. It has 12. I've been editing typography.css. There's also: blocks.css, comments.css, common.css, drupal.css, forms.css, layout.css, links.css, node.css, primary-links.css, secondary-links.css, slideshow.css. Do I need to paste the same code into every css file?
What's likely happening is your stylesheets are being overridden by the time you get to the p you're identifying. Take a look at the other styles that are being applied in Firebug. Notice that some values are overridden, some are applied. That's the cascade.
First, do a test. Add something like this:
p {width: 300px !important;}
That should tell the style to always be applied, no matter where it occurs in the stylesheet cascade.
From there it's a matter of figuring out how to identify the element you want to style in a way that overrides the previous styles (assuming you don't want to alter those). The most specific selector will always be applied - in the case that the selectors are equal in specificity, the one that occurs last in the stylesheet cascade will be applied.
I have managed to make changes to a certain specific node type using the assistance here, in the typography.css file, but when i click my menu to show a collection of the nodes, the formatting disappears. Do I need to find somewhere else to make changes? I did the page source view for the types listed in the body HTML section but the one type listed did not make any changes when i added it into the CSS file. This ' page-artist-list ' is what I get from the page source, but it's failing...
body.page-artist-list p matches paragraphs with in the body tag when it has the class page-artist-list which would only be when viewing a single node of type artist_list. If you examine the generated page, the node will have a outer div that likely has a class reflecting the content type, as a guess I suspect you want div.artist-list p
unfortunately div.artist-list does not do anything. Where do I look to determine this 'outer div 'exactly? Am I looking for this? --- div class="view view-artist-list view-id-artist_list view-display-id-page view-dom-id-1" ??? (adding 'div.view-artist-list p {' also fails).
' field-list ' ?
Is there a learning resource that explains this situation elaborately?
That is the outer div for the list of content, if the list is displaying teasers each node should have it's own wrapper div. Using firefox if you inspect the title of each node, the wrapper div will be a bit before that. As for a learning resource what you are really try to understand is CSS, there are lots of resources for learning that.
After installing Firebug, I'm still working on understanding/finding the teaser div IDs. Having no luck, and have spent 2 days trying to find the tag used by CSS to format paragraphs. I am editing the typography CSS file in the theme, I hope that is correct.
While i'm doing that, perhaps you can explain something. Why is it when I'm logged out of admin, things are formatted nicely (before & after commenting out all the css 'body.* p ' strings) but when i log in to admin, the paragraph px length formatting all disappear. It's making no intuitive or logical sense, I am missing some kind of information as to how Drupal and css work together. I've tried asking in IRC to spare the web my probable inane questions, but no one seems to be there to answer.
Do I need to make changes for Drupal to run CSS files differently for authenticated users?
Why is it so difficult to make a change to paragraph lengths, I've spent 2 days trying to do this... and no one has been able to give me a simple solution. I've managed to get the article content type to format fine, but my created content type (artist profiles) simply does not comply on the front page. When I look at the individual node for my created content type, they are formatted, but in the listing of the items with teasers, it loses all p formatting...
only using:
body.node-type-artistprofiles p {
width: 475px;
}
body.page-node p {
width: 475px;
}
Was recommended in IRC to use: ' .view p {} ' which i tried (below) with no effect:
body.view p {
width: 475 px;
}
I am editing the typography.css file in the Marinelli theme package.
Ok, do you really mean paragraph lengths? Or are you referring to widths?
Paragraph lengths cannot be controlled via css in the way you seem to be indicating. You can set the height of elements (and apply overflow:hidden; to be sure it snips off stragglers), but that's not really the same thing.
Please clarify - are you trying to control height or width?
Also, do you have a link to the page you are trying to modify?
As you will see, when you click on a node item, the paragraph width is as set in css. the views list seems to ignore css altogether for the content type Artist Profiles which i created
If you look at the paragraph of text on the page you linked, you'll notice that it's contained in a div, not a p tag. The style you set for the p tag will never have any effect on this area.
Look at this field in your views. In Rewrite Results, what is checked? Your p tags are being stripped out. Do you have Strip HTML Tags checked? Have you rewritten the field?
At any rate there are several things you can do:
1. make views enclose the field in a p tag (in the teaser, body or whatever you've called the field) - edit the field, choose the rewrite option, put an enclosing p tag around the token for the field. This will only give you one chunk of text like you have now, but the p style will be applied.
2. in the Rewrite Results, check the 'Convert newlines to HTML tags' option and style the views field. It would look like this:
3. make sure you're displaying the field with the correct text format (not plain text). First check your view. Then, if there's nothing mucking things up there, go to /admin/structure/types/manage, click Manage Display, make sure the format of your field is set to default.
Edit your view. Under Format is Show. I'm guessing is says content | teaser. Click content, change to fields. Under Fields, add your fields (title, bday, artist-pics, bio, etc - there won't be any added by default). As you add them, you should see the options I was mentioning if you're using views in D7.
Thank you for your concise explanation occupant, your patience is incredibly assistive. Unfortunately, I'm not in total understanding of how to wrap the token in the rewrite results field. I've tried, and it simply prints whatever i put in the text box instead of the content for the artist biography as intended.
I was hopeful that your solution would have finally solved this for me, and I have learned something I was not aware of which seems quite useful, but I do not fully understand how to make it function as described. I've looked this up on google with only a few confusing posts about adding some other view field somewhere with the name of the field I want to format and setting it as 'do not display results'. Is this something I need to do? So convoluted to style views, I am guessing this will be addressed in the future to simplify a process to be straight-forward...
Using the token from the 'Replacement Patterns' : [field_bio] but it simply prints it at the exclusion of the biography... I've added the string into typography.css and it appears to have straightened out all but the views results.
(Anecdotal: I also now own a CSS reference book, but it doesn't cover Drupal nor Views... lol. Plus, finding up to date Drupal 7 books is a virtual impossibility. I was learning from one til, oddly enough, the entire chapter on views was obsolete...)
I think I may have confused you with talk of rewriting, tokens, etc.
Try adding the fields without rewriting anything, without excluding anything. Play around with it. You can see the current results of your settings in views (at the bottom of the page if you scroll down while editing the view).
As for views getting easier, I don't think it will. It's exceptionally powerful, but something that just needs to be learned. Playing and breaking things is the best way to do that. :)
is the solution to learn how to edit a .tpl.php file with what's found under Theme: Information for the view I've created? or is that simply for the structure of the views layout and not the content?
With nothing in the rewrite results area, the biography paragraphs are simply format-less, as with the rest of the views results compared to what i have with the nodes as set in the typography.css file. It makes sense what you say that my requests for css p formatting will be ignored if views does not put in a < p > tag.
No, the tpl files won't help with this - it'll just change the surrounding structure.
I just took a look at your page again (http://www.paradoxinparadise.com/artist-list#). It looks like you have views spitting out the fields with p tags inside, so that's good. Now, you just need to make sure your CSS is targeting them. body.page-node p won't work (there's no page-node class on the body tag). Better to target the p tags in the content area if you want to apply the styles to all paragraphs in the primary content area of all the pages
#content p { width: 300px; }
However, your homepage paragraphs are being stripped now. So you'll have to get those fields outputting properly. But don't give up, just get one working and then figure out what is different between your views.
Comments
You could use css.
You could use css.
CSS?
Where is that option? Is that in the template somewhere? I want the format to be the same for all posted content as right now the paragraphs are way too long and when other people start posting, they wont format it the same either. thanks.
Not sure what you mean by
Not sure what you mean by "paragraphs are way too long", if you mean too much text, I do not know of away to limit the amount of text in a paragraph (you can limit the total body text).
Css would be added to the themes .css file (typically style.css).
CSS is code in your theme
Your theme has at least one .css file in it that styles things on your site.
To set the width of a paragraph, you'd add something like:
to your theme code (in the CSS file). That'd set the width of all paragraphs, though. To get more specific, you'll need to look at what other classes or IDs are in the HTML markup and look for something unique to the content type.
Take a look at source code for the page ("View source" in your browser, or use a tool like Firebug), and find the opening HTML tag. Odds are, if you're using a contributed theme, you'll see some classes in there, like
<body class="html front not-logged-in no-sidebars page-node">(different classes are separated by spaces). Use those classes to write a more specific bit of CSS code, like:That'd set all paragraphs on nodes of the "page" type to be 300px wide. There's a lot more to CSS, but hopefully that helps a little.
Thanks for your help and time with above
I'm still learning CSS usage, once i understand the framework of it, I'll be off and running. I get the syntax just not the process to alter/change.
I am still trying to understand how the CSS pages are laid out. Marinelli has 12 CSS files (blocks*, comments*, common*, drupal*, forms*, layout*, links*, node*, primary-links*, secondary-links*, slideshow*, typography* (*.css)). Intuitively I'd add the code below in typography.css, is that correct?
width: 300px;
}
actually, my theme
actually, my theme (Marinelli) does not have only 1 css file to style the whole site. It has 12. I've been editing typography.css. There's also: blocks.css, comments.css, common.css, drupal.css, forms.css, layout.css, links.css, node.css, primary-links.css, secondary-links.css, slideshow.css. Do I need to paste the same code into every css file?
On the page i need to fix the
On the page i need to fix the p formatting, i only have the following
body class="marinelli ie6 html not-front logged-in one-sidebar sidebar-second page-artist-list toolbar toolbar-drawer i18n-en"
page-artist-list does not format when used as such
body.page-artist-list p {
width 475px;
}
The rest doesn't exactly seem to apply to my content.
What's likely happening is
What's likely happening is your stylesheets are being overridden by the time you get to the p you're identifying. Take a look at the other styles that are being applied in Firebug. Notice that some values are overridden, some are applied. That's the cascade.
First, do a test. Add something like this:
p {width: 300px !important;}That should tell the style to always be applied, no matter where it occurs in the stylesheet cascade.
From there it's a matter of figuring out how to identify the element you want to style in a way that overrides the previous styles (assuming you don't want to alter those). The most specific selector will always be applied - in the case that the selectors are equal in specificity, the one that occurs last in the stylesheet cascade will be applied.
List Type ?
I have managed to make changes to a certain specific node type using the assistance here, in the typography.css file, but when i click my menu to show a collection of the nodes, the formatting disappears. Do I need to find somewhere else to make changes? I did the page source view for the types listed in the body HTML section but the one type listed did not make any changes when i added it into the CSS file. This ' page-artist-list ' is what I get from the page source, but it's failing...
body.page-artist-list p {
width: 475px;
}
TIA
body.page-artist-list p
body.page-artist-list pmatches paragraphs with in the body tag when it has the class page-artist-list which would only be when viewing a single node of type artist_list. If you examine the generated page, the node will have a outer div that likely has a class reflecting the content type, as a guess I suspect you wantdiv.artist-list punfortunately div.artist-list
unfortunately div.artist-list does not do anything. Where do I look to determine this 'outer div 'exactly? Am I looking for this? --- div class="view view-artist-list view-id-artist_list view-display-id-page view-dom-id-1" ??? (adding 'div.view-artist-list p {' also fails).
' field-list ' ?
Is there a learning resource that explains this situation elaborately?
That is the outer div for the
That is the outer div for the list of content, if the list is displaying teasers each node should have it's own wrapper div. Using firefox if you inspect the title of each node, the wrapper div will be a bit before that. As for a learning resource what you are really try to understand is CSS, there are lots of resources for learning that.
Appreciate the guidance Nevets
After installing Firebug, I'm still working on understanding/finding the teaser div IDs. Having no luck, and have spent 2 days trying to find the tag used by CSS to format paragraphs. I am editing the typography CSS file in the theme, I hope that is correct.
While i'm doing that, perhaps you can explain something. Why is it when I'm logged out of admin, things are formatted nicely (before & after commenting out all the css 'body.* p ' strings) but when i log in to admin, the paragraph px length formatting all disappear. It's making no intuitive or logical sense, I am missing some kind of information as to how Drupal and css work together. I've tried asking in IRC to spare the web my probable inane questions, but no one seems to be there to answer.
Do I need to make changes for Drupal to run CSS files differently for authenticated users?
tks
Why is it so difficult to
Why is it so difficult to make a change to paragraph lengths, I've spent 2 days trying to do this... and no one has been able to give me a simple solution. I've managed to get the article content type to format fine, but my created content type (artist profiles) simply does not comply on the front page. When I look at the individual node for my created content type, they are formatted, but in the listing of the items with teasers, it loses all p formatting...
only using:
body.node-type-artistprofiles p {
width: 475px;
}
body.page-node p {
width: 475px;
}
Was recommended in IRC to use: ' .view p {} ' which i tried (below) with no effect:
body.view p {
width: 475 px;
}
I am editing the typography.css file in the Marinelli theme package.
Ok, do you really mean
Ok, do you really mean paragraph lengths? Or are you referring to widths?
Paragraph lengths cannot be controlled via css in the way you seem to be indicating. You can set the height of elements (and apply overflow:hidden; to be sure it snips off stragglers), but that's not really the same thing.
Please clarify - are you trying to control height or width?
Also, do you have a link to the page you are trying to modify?
the css command I'm changing
the css command I'm changing is widths, as with the examples I've provided that I'm using.
http://www.paradoxinparadise.com/artist-list# is the page i'm have specific trouble with.
As you will see, when you click on a node item, the paragraph width is as set in css. the views list seems to ignore css altogether for the content type Artist Profiles which i created
Ok, I just wanted to clarify
Ok, I just wanted to clarify that.
If you look at the paragraph of text on the page you linked, you'll notice that it's contained in a div, not a p tag. The style you set for the p tag will never have any effect on this area.
Look at this field in your views. In Rewrite Results, what is checked? Your p tags are being stripped out. Do you have Strip HTML Tags checked? Have you rewritten the field?
At any rate there are several things you can do:
1. make views enclose the field in a p tag (in the teaser, body or whatever you've called the field) - edit the field, choose the rewrite option, put an enclosing p tag around the token for the field. This will only give you one chunk of text like you have now, but the p style will be applied.
2. in the Rewrite Results, check the 'Convert newlines to HTML
tags' option and style the views field. It would look like this:
3. make sure you're displaying the field with the correct text format (not plain text). First check your view. Then, if there's nothing mucking things up there, go to /admin/structure/types/manage, click Manage Display, make sure the format of your field is set to default.
Let me know how you make out.
"The selected style or row
"The selected style or row format does not utilize fields." -Content type info for Artist List in views
I created a new view, and that one also has the same comment for fields... I don't see rewrite results anywhere in views.
Using filtered text & filtered HTML for the Artist Profiles content type +artist biography. no options to manage fields.
Under Format is Show. I'm
Edit your view. Under Format is Show. I'm guessing is says content | teaser. Click content, change to fields. Under Fields, add your fields (title, bday, artist-pics, bio, etc - there won't be any added by default). As you add them, you should see the options I was mentioning if you're using views in D7.
Ok, i've moved fwd, yet... back again.
Thank you for your concise explanation occupant, your patience is incredibly assistive. Unfortunately, I'm not in total understanding of how to wrap the token in the rewrite results field. I've tried, and it simply prints whatever i put in the text box instead of the content for the artist biography as intended.
I was hopeful that your solution would have finally solved this for me, and I have learned something I was not aware of which seems quite useful, but I do not fully understand how to make it function as described. I've looked this up on google with only a few confusing posts about adding some other view field somewhere with the name of the field I want to format and setting it as 'do not display results'. Is this something I need to do? So convoluted to style views, I am guessing this will be addressed in the future to simplify a process to be straight-forward...
Using the token from the 'Replacement Patterns' : [field_bio] but it simply prints it at the exclusion of the biography... I've added the string into typography.css and it appears to have straightened out all but the views results.
(Anecdotal: I also now own a CSS reference book, but it doesn't cover Drupal nor Views... lol. Plus, finding up to date Drupal 7 books is a virtual impossibility. I was learning from one til, oddly enough, the entire chapter on views was obsolete...)
I think I may have confused
I think I may have confused you with talk of rewriting, tokens, etc.
Try adding the fields without rewriting anything, without excluding anything. Play around with it. You can see the current results of your settings in views (at the bottom of the page if you scroll down while editing the view).
As for views getting easier, I don't think it will. It's exceptionally powerful, but something that just needs to be learned. Playing and breaking things is the best way to do that. :)
I live to break things...
is the solution to learn how to edit a .tpl.php file with what's found under Theme: Information for the view I've created? or is that simply for the structure of the views layout and not the content?
With nothing in the rewrite results area, the biography paragraphs are simply format-less, as with the rest of the views results compared to what i have with the nodes as set in the typography.css file. It makes sense what you say that my requests for css p formatting will be ignored if views does not put in a < p > tag.
No, the tpl files won't help
No, the tpl files won't help with this - it'll just change the surrounding structure.
I just took a look at your page again (http://www.paradoxinparadise.com/artist-list#). It looks like you have views spitting out the fields with p tags inside, so that's good. Now, you just need to make sure your CSS is targeting them. body.page-node p won't work (there's no page-node class on the body tag). Better to target the p tags in the content area if you want to apply the styles to all paragraphs in the primary content area of all the pages
#content p { width: 300px; }However, your homepage paragraphs are being stripped now. So you'll have to get those fields outputting properly. But don't give up, just get one working and then figure out what is different between your views.