Problems, need help? Have a tip or advice? Post it here.
10 posts Page 1 of 1
I'm trying to create singlepage blog, blog post looks like this:

Code: Select all
<article>
<a class="thumbnail" href="images/fulls/12.jpg"><img src="images/thumbs/12.jpg" alt="" /></a>
<h2>Mattis lorem sodales</h2>
<p>Feugiat auctor leo massa, nec vestibulum nisl erat faucibus, rutrum nulla.</p>
</article>


I succeed posting text and images, but I can't figure out how to include html code. Because of that I can't post a new post, only update the old one. This is the current code that I'm running:

Code: Select all
<cms:template title="AddPost" clonable="1" commentable="0">
                  
                  <cms:editable name='Num_1' type='richtext'/>
                  <cms:editable name='Num_2' type='richtext'/>
                  <cms:editable name='img' type='image'/>

</cms:template>

<article>
<a class="thumbnail" href="<cms:show img/>"><img src="<cms:show img/>" alt="" /></a>
<h2><cms:show Num_1/></h2>
<p><cms:show Num_2/></p>
</article>


I need to include <article></article><h2></h2><p></p> in my posts.
Any idea how to do this? Tnx!
Hi @tleon,

You need to use cms:pages to loop through your cloned pages and list their contents e.g. as follows -
Code: Select all
<cms:pages limit='10'>
   <article>
      <a class="thumbnail" href="<cms:show img/>"><img src="<cms:show img/>" alt="" /></a>
      <h2><cms:show Num_1/></h2>
      <p><cms:show Num_2/></p>
   </article>
</cms:pages>

The code above should repeat the <article> block a maximum of 10 times showing the latest 10 blog posts.

May I also humbly suggest to please go through our tutorial http://docs.couchcms.com/tutorials/portfolio-site.html ?
It, amongst other things, also covers creating a blog and should give a firm grasp on the essentials of Couch.

Do let us know if you need help with anything.
Hi,

Thank you that did the trick, but I have a problem with KCFinder photo upload. When I try to upload larger photo (7-20mb) I get "Unknown error", while small photos work fine. Is there a way to fix this?
That most likely is a memory issue.
Please try the suggestions mentioned here - viewtopic.php?p=21021#p21021

Hope it helps.
Hi, I tried the following but I'm still getting the same error.
In that case please try taking a look at the error logs of your web server. Perhaps it'd provide some more info about the problem.

Try also turning off KCFinder (from couch/config.php) to use the older filemanager and see if the problem persists.
Hi, with older filemanager I'm getting error "Invalide file".

Here are the logs:
access.log
apache_error.log
php_error.log
Thanks.

The php_error log shows several errors like the following -
[05-Sep-2015 11:55:09 Europe/Paris] PHP Warning: POST Content-Length of 9048267 bytes exceeds the limit of 3145728 bytes in Unknown on line 0

[05-Sep-2015 22:44:03 Europe/Paris] PHP Warning: POST Content-Length of 9048171 bytes exceeds the limit of 3145728 bytes in Unknown on line 0

[05-Sep-2015 22:44:30 Europe/Paris] PHP Warning: POST Content-Length of 3899732 bytes exceeds the limit of 3145728 bytes in Unknown on line 0

These errors suggest that your PHP setup is configured to allow only a maximum upload size of 3MB.

You need to up that for uploading larger files. To do that, edit your php.ini file and set the following directive to some reasonably higher values -
upload_max_filesize = 256M
post_max_size = 256M

Restart your wamp server for the new values to take effect.

Please make sure you are editing the right php.ini file and see that that the new values have been accepted. For that, place the following in any of your template to get the current settings -
<?php phpinfo(); ?>

Finally, I'd like to say that your setup is still on the local machine. Once you move it to a proper hosted server, you are not likely to run into such issues as the host would have most likely configured the defaults to more practical values.

Hope it helps.
Hi, that fix it. Thank you! I have one more question, is it possible to just edit one part of page?
What I mean is that can I edit just one text and update it, while other one stays the same.This is the code I'm currently using, but it updates all editable parts.

Code: Select all
<cms:template title="Home" clonable="1" commentable="0">                  
<cms:editable name='text_1' type='richtext'/>
<cms:editable name='text_2' type='richtext'/>
cms:editable name='img' type='image'/>
<cms:editable name='text_3' type='richtext'/>
<cms:editable name='text_4' type='richtext'/>
</cms:template>



<cms:pages limit='0'>
<div class="intro-item" style="background-image: url(<cms:show img/>);">
<div class="caption">
<h2><cms:show text_1/></h2>
<p><cms:show text_2/></p>
<a class="button white transparent" href="contact.html">Contact</a>
</div>               
</div>
</cms:pages>



<cms:pages limit='0'>
<div class="quote">
<p>"<cms:show text_3/>"</p>
<div class="author"><cms:show text_4/></div>
</div>
</cms:pages>


Every time I edit let's say text_4 everything will update, even the image. Is it possible to just edit text_3,4?
Not sure if I'm able to understand the issue - updating an editable region should affect only that particular region and nothing else.
There seems to be a syntax error in your declaration (the opening '<' is missing). Perhaps that has something t do with this issue?
cms:editable name='img' type='image'/>

May I request you to please create a new thread for every fresh issue?
Please do so and post come screenshots showing exactly what is happening.

Thanks.
10 posts Page 1 of 1
cron