Problems, need help? Have a tip or advice? Post it here.
11 posts Page 1 of 2
Hi, first of all i want to say that CouchCMS is a great, great product...i choose it over Concrete5 and ModX!!

Now on to my question, i don't know if i defined the question correctly(english is not my native), but what i want to know is: i am following your tutorial, and when creating about page we define cms:editable, and when working in backend everything we put inside is formatted by the Css for those elements.

But when creating a blog page, we delete some of the Html and replace it with call to blog_content.
Now if i put a veeeeery long sentence in backend, it is stretched far out of blog post.
What i mean is that default style for that blog post doesn't apply anymore.

Am i missing something here? How to apply those style again, or create a new one.

Thanks in advance,
Mirko
Hi,
Welcome to our forums and thank you very much for the kind words :)

Replying to your question -
could you please specify which of the following two scenarios you are referring to? -
1. The CSS styles of your 'blog.php' do not seem to get applied in the richtext editor (i.e. when you are in the admin panel) or
2. The CSS styles of the text you inputed in the richtext editor do not seem to get applied to the 'blog.php' (i.e. when you view blog.php in the browser).

Hope I as able to make myself clear.

It would help if you post in a few screenshots showing the problem.

Thanks
I meant that after declaring editable areas in cms:template, and replacing some Html with cms:show and also inserting show in src attribute of the image, i go in dashboard and starting typing a new blog post.If i write a long sentence, the text is not formatted, it just keeps going right.It is not controlled by any rules/styles.

I have attached a image, you will see what i wrote, and the output in the browser.
Also a new problem arrived, some 10 min ago my image uploader just started working.

It is just showing off code:
crop='1'
width='610'
height='150'
type='image'
and i don't have the option to browse a file, just sace and close buttons.Also image attached.

Attachments

Ok, I get it.

That is the expected behaviour.
The line is going beyond bounds in your main site too and the CSS there is actually yours (as the designer).

If you want to to somehow keep the 'very long line' within limits you'll have to define the proper CSS rules yourself and then make it known to Couch.

So, suppose, you add the appropriate changes to your site's CSS file and the long line appears to be properly formatted in your main site, you can then make Couch use the same stylesheet in the admin-panel too.
Just add the css parameter to the definition of your richtext editable region e.g.
Code: Select all
<cms:editable name='desc' label='Description'
    desc='Enter description of property here'
    css='styles/editor_styles.css'   
    type='richtext'/>


Coming to your second problem - the 'image' editable region is being mistakenly recognised by Couch as a 'text' editable region.
Please take a second look at the definitions in your template - there must be some typo.
You can paste the relevant part here and I'll take a look at it, if you wish.
Thank you very much for your reply.The moment i asked the question, i realized it was somehow a dumb question.Of course i need to apply the styles myself, given that Html is replaced with cms tag.
Regarding the image problem, i installed Couch again.Now is everything fine.
Thanks for support.
Excuse me, just one more stupid question...then i'll get to smarter ones ;)
Correct me if i am wrong, let's say that i give to my client CouchCMS powered site, and it has news(blog) section, whatever.Those sections are editable and client wants to write a new article(which i made Css styles for-let's say it has <h1>,<p>,<span>), does he need to put text inside those tags?
My question is how does CouchCMS knows which style to apply, given that client is entering raw text in richtext editor?
..how does CouchCMS knows which style to apply, given that client is entering raw text in richtext editor?

The 'raw text' that you mentioned actually gets formatted into proper HTML in two ways -
1. CKEditor (the wysiwyg editor behind the richtext editable region) automatically applies some basic formatting to the text entered by the user. Usually it is very simple - just <p> tags and <br>s (click on the 'source' button of the editor to see the HTML getting produced behind the scenes).
2. The user can also choose to specifically style the text he enters by selecting the various formatting buttons and dropdowns available.

The point is, in both the cases above only the 'markup' is getting generated. How that markup shows up on the final page will be handled by your CSS (that. as you mentioned, you have written for <h1>,<p>,<span> etc.).

Hope this answers your question.
Ok, in Diving deep - the Blog (Part 1) from your tutorial we are asked to strip the Html for post entry and replace it with cms:show tag which points to already defined cms:editable.
Let's say that i want my new blog entry to have a h1, two different p tags and a blockqoute.
Where do i write the new Html, given that in the place of the blog entry is now cms:show?

Once more, thank you for taking your time to answe these questions.
Let's say that i want my new blog entry to have a h1, two different p tags and a blockqoute.
Where do i write the new Html, given that in the place of the blog entry is now cms:show?

If your blog is structured to such an extent (though I doubt if that is the case) that each of its entry consists of a discrete h1, two different p tags and a blockqoute - you could define separate editable regions of type text for each of them e.g. naming them my_heading, my_para1, my_para2 and my_blockquote etc. and then in the template you could use them as -
Code: Select all
<h1><cms:show my_heading /></h1>
<p><cms:show my_para1 /></p>
<p><cms:show my_para2 /></p>
<blockquote><cms:show my_blockquote /></blockquote>

- but, like I said, it is highly unlikely that you'll have such a tightly defined structure for the blog entries.
The best way to go is define a single editable region of richtext type (e.g. named my_blog_entry) and then ask the end user to type in the blog entry and then format it himself using the buttons and dropdowns provided by the richtext editor.
The HTML formatted by the end-user can them be displayed simply as
Code: Select all
<cms:show my_blog_entry />

Hope this helps.
Thanks, it sure helps.But it is still not clear in my mind.
Let's say that i have somewhat more complex area for the client to edit(not blog), where the text needs to be cufonized, some tables populated, a few spans with different classes, nothing complicated, but is made of many styles.

I then strip the original Html and replace it with cms:show.Please can you explain me how do i regain my original Html order and how to apply styles to them.
Basically before cloning that section had its look and feel defined by Html and Css.
How do i regain that?

Ok i got it.I read your previous answer more carefully.Just one thing, can i apply normal css classes to these:
<h1><cms:show my_heading /></h1>
<p><cms:show my_para1 /></p>
<p><cms:show my_para2 /></p>
<blockquote><cms:show my_blockquote /></blockquote>
11 posts Page 1 of 2