changing the view

Hello

renderview() uses views\index.cfm as it’s default view. I tried to change this. I learned, that a only adding a new file name was not good enough:

`
#renderView(view=“index_blog”)#

`

renderview would look in the root of the webspace instead of the theme folder for a view folder. So changed the path like this:

#renderView(view="#cb.layoutRoot()#/views/index_blog")#

This works, until i hit the link *Read more" at an article, which has an excerpt. I got an error, that i’m in the pages and not in the entry view. Checking out the involved files in the error, i see that it was switched to the pages. Of course, this will cause the error.

If i change everything back to

`
#renderView()#

`

it works fine.

Any idea?

Cheers

Martin,

What are you trying to do? Sounds like you are doing it the wrong way…

Could be :wink: The only thing i wanted to achive is to use a different file name as “index.cfm”, e.g. index_blog.cfm, which is more readable to me. Ist this possible?

Cheers

It is, but that is not the way to do it.

The index.cfm comes from the URL, so if you are using SES you need to modify that to stop adding the index.cfm and if your not then you need to modify the routes.cfm and modify the index.cfm there.

Also, you will need to change the Application.cfc check for index.cfm so it can process the index.cfm again.

I think that is all you need to do. ContentBox uses ColdBox configurations here, and this is the best way that I can think off to do this.

Thanks Andy,

After having two days of Coldbox training, this question is answered anyway. The training was the confirmation, that a ContentBox developer needs at least a basic knowledge about ColdBox :wink:

Yes… For sure…