Problems, need help? Have a tip or advice? Post it here.
6 posts Page 1 of 1
I posted a new blog on my site and for some reason the latest post is not grabbing the the full '75' excerpt on blog_list.html. What is strange is that the other blog posts are showing the excerpt without problem. Any idea what would cause this? The blog list is located at this URL: http://sharpenyouraxe.net/blog/
Could you post the code you are using for the 'excerpt' tag as well as the content before it is put through the 'excerpt' tag?

By the way, the 'Read more...' links appear to be using k_page_title instead of k_page_link. The 'tags' anchor links have not been closed properly: <li class="tags"><a href="">Business</li> The post titles have not been nested correctly:
Code: Select all
<a href="http://sharpenyouraxe.net/blog/business/the-key-to-hiring-a-good-attorney.html">
<h2>The Key To Hiring A Good Attorney</a></h2>
You appear to have extraneous opening 'p' and 'center' tags in your page title. Also, block level elements should not be nested inside of paragraph tags:
Code: Select all
<p><p>Text</p></p>
<!-- the above will be treated as: -->
<p></p><p>Text<p>
Thanks for the heads up. I have fixed the Read more links. Here is the code I am using:
Code: Select all
        <div id="main">
            <!-- Normal Post -->
            <cms:pages masterpage='blog.php' folder=k_folder_name paginate='1' limit='3' >
            <div class="post clearfix">
                <a href="<cms:show k_page_link />"><h2><cms:show k_page_title /></a></h2>
                <ul class="post-meta">
                    <li class="author">By <a href="/about.html">Sharpen Your Axe</a></li>
                    <li class="date"><cms:date k_page_date format='M, jS y'/></li>
                    <li class="tags"><a href="<cms:show k_folder_link />"><cms:show k_page_foldertitle /></a></li>
                    <!--<li class="comments"><a href=""><cms:show k_comments_count /></a></li>-->
                </ul>
                <div class="post-entry">
                    <a href="<cms:show k_page_link />" title=""><img src="<cms:show blog_image />" alt="" class="image" /></a>
                    <p>
                        <cms:excerptHTML count='75' ignore='img'><cms:show blog_content /></cms:excerptHTML><a href="<cms:show k_page_link />">Read more...</a>
                    </p>
                </div>
            </div>


I am assuming that the WYSIG editor in the admin section is throwing the extra tags in? Thank you for your help!
The excerptHTML tag is doing its job fine. The problem is with the formatting of your content from which the tag tries to excerpt 75 words.

This is what is happening - unlike the other posts in your blog, the one that 'seemingly' is not showing the excerpt begins with elements that have profuse inline styles applied
<strong style="border: 0px; font-size: 14px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline; color: rgb(99, 99, 99); font-family: 'Open Sans', 'Lucida Sans Unicode', 'Lucida Grande', sans-serif; line-height: 23px; "><span style="background-color: transparent; border: 0px; font-size: 18px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline; color: rgb(51, 51, 51); line-height: 1.25; text-transform: capitalize; ">The Key To Hiring A Good Attorney</span></strong></p>
<pre>
</pre>
<p>
<span style="color: rgb(99, 99, 99); font-family: 'Open Sans', 'Lucida Sans Unicode', 'Lucida Grande', sans-serif; font-size: 14px; line-height: 23px; ">When deciding which attorney to hire..

The excerptHTML extracts the first 75 words as directed - it is only that a bulk of that extract consists of the inline style directives and has little to display.

You can go into the 'source' view of CKEditor to tweak the markup and this should rectify the problem.
Would also like to add that using inline styles the way you are is not commendable to begin with. Please consider use simple markup combined with CSS stylesheets to produce the same effect.

Hope this helps.
It definitely makes sense. I guess the trouble I am having is how do I go from pasting from a word doc to taking on the CSS styling of the page in the editor?

UPDATE:

I realized I just need to plug in the div style that pertains to that page and that the WYSISWG won't display the styling. I have been staring at a screen for way too long. :oops:

Thank you for your help!
the trouble I am having is how do I go from pasting from a word doc to taking on the CSS styling of the page in the editor

Two ways to do so:
1. The toolbar of CKEditor has a button 'Paste from Word' (has a 'W' in it). Instead of pasting the MS Word contents directly into the editor, do so in the window that this button displays.
2. For always stripping off MS Word formatting, use the following method - the 'couch/includes/ckeditor' folder contains a configuration file for CKeditor named 'config.js'. Find the following line and uncomment the directive
Code: Select all
// Uncomment the following line if your users tend to frequently paste in contents from, say, MS-Word.
   // config.forcePasteAsPlainText = true;

Hope this helps.
6 posts Page 1 of 1
cron