Problems, need help? Have a tip or advice? Post it here.
9 posts Page 1 of 1
Hi...back here again..
Now i'm trying to make blog section with couch..(in my site i called it newsletter)..
everything was perfect..my blog views was success..
but when I came to Embedding snippets section to make list view page.. i got error message :

Error embedding file: .../snippets/blog_list.html

i have follow this instruction:

Image

but..when i Accessing http://www.mytestsite.com/blog.php ... the contents of blog_list.html not displayed and only error messsage displayed :Error embedding file: .../snippets/blog_list.html

is there my codes are wrong? please advice..

thanks before..

bagus
Hi,

All the embedded snippets need to be placed within the 'snippets' folder.
Please make sure that you have indeed placed the 'blog_list.html' file within this folder.

By default the 'snippets' folder lies within the 'couch' installation folder but the location can be changed from config.php. From your error message it appears that you have opted to change the location. If this is so, please also make sure that you have made the entry in config.php properly. The instructions are given in config.php.
// 12b.
// Folder containing the embedded snippets if not using the default 'snippets' folder within 'couch'.
// Should be relative to your site. No leading or trailing slashes please.
//define( 'K_SNIPPETS_DIR', 'mysnippets' );
Ok..i got it..and my blog_list.html displayed now.. thankyou very much...

but.. when i inserted the code or tag named pages that is used to enumerate or list pages belonging to a particular template:

Code: Select all
<cms:pages masterpage='newsletter.php'>
<div id="wb_Text1" style="position:absolute;left:191px;top:252px;width:716px;height:693px;text-align:justify;z-index:13;">
<span style="color:#E8A940;font-family:'DIN Medium';font-size:24px;"><cms:show k_page_title/></span><span style="color:#000000;font-family:Arial;font-size:13px;"><br><br></span><span style="color:#C0C0C0;font-family:'DIN Medium';font-size:16px;"><cms:show k_page_date/></span><span style="color:#000000;font-family:Arial;font-size:13px;"><br><br></span><span style="color:#000000;font-family:'DIN Medium';font-size:16px;"><cms:excerptHTML count='75' ignore='img'><cms:show newsletter_content/></cms:excerptHTML>
</div>
</cms:pages>
</body>
</html>


the blog list or newsletter list are displayed on newsletter.php (blog.php) ... but the content are overlap each other... as you see on:http://www.mysite.com/newsletter.php

can you tell me.. what the mistake i made? coz I'm getting frustrated with this..

thankyou..
You are making a big mistake by using inline styling:
Code: Select all
<div style="width:800px;padding:20px 0;margin:0 auto;">...</div>
You should be using an external style sheet with classes and ID's:
Code: Select all
<div class="header">...</div>

The problem is caused by absolute positioning, more specifically because you are using the same 'top' value for each newsletter post: 252px

If I was you I would ditch the absolute positioning method; besides being inefficient, it will frustrate you quickly as you have found out.
ow..ic..i make a big mistake by using inline styling..
ok .. thanks a lot .. I've fix the code problem .. and now I'm not using absolute code anymore ... I use an external css .. and it's work .. i have newsletter.php page with pagination now..thanks again for your advice..

But..there's still a problem with my css code.. it seem one or more my css style code doesn't work. here my code:
Code: Select all
<td style="background-color:transparent;border:1px #C0C0C0 solid;text-align:left;vertical-align:top;height:787px;">
<cms:pages masterpage='newsletter.php' paginate='1' limit='3'>
  <h1 class="padding small"><cms:show k_page_title/></h1>
  <h3 class="padding"><cms:date k_page/></h3>
  <cms:excerptHTML count='100' ignore='img'>
  <p class="padding medium main"><cms:show newsletter_content/></p>
</cms:excerptHTML>
<cms:if k_paginated_bottom>
<p>Previous Posts</p>
<p>Newer Post</p>
</cms:if>
</cms:pages>
      </td>


my css class="padding" is works for page title and date.. but it doesn't works for blog content..as you seen at my page:http://mysite.com/newsletter.php

Am I doing something wrong?

regards

bagus
I think you have found a bug. The 'excerptHTML' tag should not modify the nesting of tags in this way...
Code: Select all
<cms:excerptHTML count='100' ignore='img' >
<p class="outside">
    <p class="inside"></p>
</p>
</cms:excerptHTML>
<p class="outside"></p>
<p class="inside"></p>

Generally speaking though it is not the best idea to nest <p> tags inside of each other. If you take the <p> tag out of the 'excerptHTML' tag it will work fine, although I think it makes sense to change it to a <div>:
Code: Select all
<td style="background-color:transparent;border:1px #C0C0C0 solid;text-align:left;vertical-align:top;height:787px;">
<cms:pages masterpage='newsletter.php' paginate='1' limit='3'>
  <h1 class="padding small"><cms:show k_page_title/></h1>
  <h3 class="padding"><cms:date k_page_date/></h3>
  <div class="padding medium main">
<cms:excerptHTML count='100' ignore='img'>
  <cms:show newsletter_content/>
</cms:excerptHTML>
</div>
<cms:if k_paginated_bottom>
<p>Previous Posts</p>
<p>Newer Post</p>
</cms:if>
</cms:pages>
      </td>
You were also using the wrong variable for the page date.
I think you have found a bug. The 'excerptHTML' tag should not modify the nesting of tags in this way...

@cheesypoof It is not exactly a bug - it is more of a 'side-effect'.
You see, the 'excerptHTML' tag truncates its input to the specified length. Now since this input is actually HTML this truncation can result in the closing tags of many elements being cut off. Returning the input in this condition will lead to some serious mutilation of the page's markup (not to mention invalid HTML).
In a bid to rectify this condition, the 'excerptHTML' tag goes about 'balancing' the orphaned tags. This can lead to the resulting markup not being exactly the same as the input but, more crucially, prevents outputting malformed HTML.
Alright, fair enough that makes sense. :)
Hi KK & cheesypoof...

Thankyou for guidance.. i have fix my code.. i've trial and error for a couple of time..
but i can fix it now..my blog_list.php displayed well..once again thankyou very much..

i still develop my website with couchcms..and for further i will continue discussing with you about it.. ;)

regards

bagus
9 posts Page 1 of 1