Problems, need help? Have a tip or advice? Post it here.
3 posts Page 1 of 1
Hi, this is my first attempt at creating a blog. I have put together a very rough bare-bones blog page just to see if I can get it working, and so far all I get is 'Page not found'. I'm sure it's something very silly which I have missed. Here is my code:

Code: Select all
<?php require_once($_SERVER[ 'DOCUMENT_ROOT']. '/_edit/cms.php'); ?>
<!DOCTYPE html>
<cms:template title="Blog" clonable="1" order="12">
    <cms:editable name="blog_image" type="image" label="Post feature image" />
    <cms:editable name="blog_content" type="nicedit" label="Post content" buttons="<cms:embed 'nicedit_buttons.inc' />" />
</cms:template>

<html>

<body>

    <cms:if k_is_page>

        <!-- Post Title -->
        <h3 class="title"><a href="<cms:show k_page_link />"><cms:show k_page_title /></a></h3>
        <!-- Post Title -->
        <img class="thumb" src="<cms:show blog_image />" alt="" />
        <!-- Post Content -->
        <cms:show blog_content />


        <cms:else />



        <!-- Blog Post -->
        <cms:pages masterpage='blog.php' folder=k_folder_name start_on=k_archive_date stop_before=k_next_archive_date paginate='1' limit='3'>

            <div class="post">
                <!-- Post Title -->
                <h3 class="title"><a href="<cms:show k_page_link />"><cms:show k_page_title /></a></h3>
                <!-- Post Image -->
                <img class="thumb" alt="" src="<cms:show blog_image />" />
                <!-- Post Content -->
                <cms:excerptHTML count='75' ignore='img'>
                    <cms:show blog_content /></cms:excerptHTML>
                <!-- Read More Button -->
                <p class="clearfix"><a href="<cms:show k_page_link />" class="button right"> Read More...</a>
                </p>
            </div>

            <cms:if k_paginated_bottom>
                <!-- Blog Navigation -->
                <p class="clearfix">
                    <cms:if k_paginate_link_next>
                        <a href="<cms:show k_paginate_link_next />" class="button float">&lt;&lt; Previous Posts</a>
                    </cms:if>

                    <cms:if k_paginate_link_prev>
                        <a href="<cms:show k_paginate_link_prev />" class="button float right">Newer Posts >></a>
                    </cms:if>
                </p>
            </cms:if>

        </cms:pages>


    </cms:if>

</body>

</html>
<?php COUCH::invoke(); ?>


Many thanks!
Hi,

Nothing seems to be wrong with the code.

I wonder if your site has prettyURLs turned on?
If that is the case probably you forgot to regenerate the .htaccess file (using gen_htaccess.php) to include the new blog template.

Please let me know. Thanks.
Urghh! Thanks KK yep I just needed to regenerate the htaccess file. I knew it would be something silly but just couldn't think what it was.

Thanks!
3 posts Page 1 of 1