Content Block and CSS

Permalink
Hey Guys,

I have a custom template with very precise CSS to get things where I want them to be.

When I inert a content block it breaks my design, I was hoping I could assign a CSS class to the block. Is this doable?

webnut
 
jordanlev replied on at Permalink Best Answer Reply
jordanlev
It's doable, but note that the nature of the content block is to allow for arbitrary text, images, etc. to be entered by the user. It generally wraps content in heading and paragraph tags. If that's okay, and all you want to do is wrap everything in a div with a certain class, then your best bet is to override the block template by copying /concrete/blocks/content/view.php to /blocks/content/view.php, and editing that new copy of the file so it has the div tag around the code.

If, on the other hand, you want to get extremely granular with which portions of content go inside which kind of tag, then you'll have better luck crafting your own custom block with the free Designer Content addon:
http://concrete5.org/marketplace/addons/designer-content...

Best of luck!

-Jordan
webnut replied on at Permalink Reply
webnut
I'm fine with the whole idea of a block.
But it shouldn't override template styles.
I don't want to change how it works, I just want to
force a certain width. That's all, should be easy right.

Otherwise C5 doesn't fit the template, the template has
to fit C5 or not at all?
jordanlev replied on at Permalink Reply
jordanlev
I don't understand what your exact issue is then -- the content block does not output any styles on its own -- it just puts the user's entered content into <p> and <h#> tags.

As @SuperNova mentions below, it would be really helpful to see the code you're referring to.
webnut replied on at Permalink Reply
webnut
That's an awesome addon though! Thanks for posting the link :0)
webnut replied on at Permalink Reply
webnut
Muwahahahaha!!

Thanks man! Your addon, and I didn't realize it was yours until just recently, worked a charm! Problem was default content block added a div wrapper and used it's own css; I had two options. One, change the CSS as mentioned by Supernova, or two create my own block with designer content addon.

I went with option two. Created a wysiwyg content block with no wrapper. Now I my layout seems to be fixed and I can edit it as desired!! wooo!

Now to test it to ensure it really is fixed. :0)
SuperNova replied on at Permalink Reply
SuperNova
Go to 'Design' at the context menu, open the last tab 'CSS' and put a class in there.
It would be easier if we could have a look at your site.
webnut replied on at Permalink Reply
webnut
hey guys, thanks greatly for the help.
I'm not always the best with my words, or writing them :P

I guess I'm not describing what my problem is.
As suggested it is best to see it.

here you go:
*removed to prevent harvesting and caching before it's ready*

Prior to adding the code for a block the layout was
solid, I could add paragraphs, breaks, headings etc and
they wouldn't break the layout so easily.

I wasn't sure how to add a block without adding it via the code.
That's another topic I might open later on. I'll stick to the issue here.

If you're willing to have a look and advise me on how to best proceed I'd be grateful.

I'm online currently and checking the forum often.
I can at any time remove the block to show you the desired result.
I can then add the block to show you how it breaks.

Thank you
webnut replied on at Permalink Reply
webnut
Looking at the code C5 adds a DIV[Line 50] then a P, that div is throwing things off. I might have to modify the default styles after all... although I really really hope not.
jordanlev replied on at Permalink Reply
jordanlev
Sorry I didn't see this when you posted it -- wound up in my spam folder somehow.

If you can send me a link to the page where this is happening, I can take a look. PM me or email me at concrete@jordanlev.com