Forum for discussing general topics related to Couch.
7 posts Page 1 of 1
Hi!

I have a blog using pretty URLs in folder:

http://www.mysite.com/blog/

Based on template:

http://www.mysite.com/blog.php

With blog posts with URLs like:

http://www.mysite.com/blog/my_first_blog_post.html

I would like to create a blog list page _not_ at URL:

http://www.mysite.com/blog/

But instead at any of (I don't care which):

http://www.mysite.com/blog/all_blog_posts/
or
http://www.mysite.com/blog/all_blog_posts.php
or
http://www.mysite.com/blog/all_blog_posts.html

How can I achieve that?

TY!
Hi,

Create a folder named 'blog' and place a non-clonable template named 'all_blog_posts.php' within it.
Use
Code: Select all
<cms:pages masterpage='blog.php' limit='10' paginate='1'>..</cms:pages>
within it to list the blog posts.
Notice above how the 'masterpage' parameter is pointing to 'blog.php' - that is the key for listing pages of one template on any other template.

So what happens when prettyURL is active and someone accesses http://www.mysite.com/blog/?
I think, depending on your server's configuration, the web server will either try to show contents of the physical 'blog' folder or load blog.php in its 'home-view'.

If the first thing happens, place another non-clonable template named 'index.php' within the 'blog' folder and place within it a
Code: Select all
<cms:redirect 'all_blog_posts.php' />.

If the second thing happens, the use the following blog.php -
Code: Select all
<cms:if home_view>
    <cms:redirect 'all_blog_posts.php' />
</cms:if>


Hope this helps.
Thank you. Hmm. I think the problem is that I have a non CMS site page at this location already:

www.mysite.com/blog/index.php

If I replace that page with my list page though (which is my eventual intention), I do ALSO want a repeat of the list page within the blog folder in another location. (client's request)

One list page includes a large introduction text to the blog, with the items (or at least the first 'n') below.

The other page will be the full list without a big intro at the top, but really also needs to be located inside the 'blog' folder.

Is this impossible with pretty URLs in place perhaps?
I am not sure if I could understand the use-case fully but speaking just about the repetition, you may create the listing on as many places as you like - <cms:pages> with 'masterpage' set to the source template will fetch the pages without any concern about which template it is being used in.
The problem is though that the repetition page _must_ be inside the folder /blog/ and not in the root of the website. And pretty URLs seems to be causing this to be impossible.
Hi, you said it doesn't matter which link would be used from the 3 above. If take the last one, it can be solved (taken into account your last post). Just create in blog template a new cloned page among the regular blog pages. Name it "All blog posts".
Code: Select all
http://www.mysite.com/blog/all-blog-posts.html


In page-view of the blog, a simple check to be introduced: if k_page_name is 'all-blog-posts' then embed a special snippet, otherwise show regular blog page.

At last, configure the template via cms:config_list_view to remove delete option from 'Actions' column for that particular page or, even simpler and better, use exclude parameter of cms:config_list_view to exclude that page from the listing in backend.
Ah interesting idea! Which I read when I signed in to say I'd found a nice way to do it by another means.

The way I did it was to put the template in a sub-folder of the /blog/ folder like this:

/blog/list/index.php

And then the new list view can be seen at the following URL no problem:

/blog/list/

Thanks all!
7 posts Page 1 of 1