Multiple view.php Pages?

Permalink 1 user found helpful
Hi. Is it possible to use multiple view.php pages for static wrappers? I'd like the Calendar add-on to use one (calendar_view.php) and the Blog add-on to use a different one (blog_view.php).

But I can't find in the code for either the Calendar or the Blog add-ons where it decides what page to use for the base. Is it set default by Concrete5 to always be the view.php page?

Anyway to change that?

BeKindRewind
 
kino replied on at Permalink Reply
kino
I think it's possible.
like left_sidebar.php full.php.

you make
calender.php ,blog.php ,calender_and_blog.php
and select pagetype.
BeKindRewind replied on at Permalink Reply
BeKindRewind
It seems like it should be, but I'm not sure how to do it.

When you add the Calendar Add-on, it creates an Event page type. And I can go in and edit the defaults for the Events page type, but when I click on "Design" for the default, it won't let me select a different page type. It's locked into the Event page type (which uses the default view.php file).

I went through the code for the Calendar Add-on, but I can't find any reference that would bind the Event page type to the view.php file.
kino replied on at Permalink Reply
kino
sorry
I had been so misunderstood.


If you determine the name of the first page view.php
I do not think much harder.

But,I don't have calendar・blog Add-on.
andrew replied on at Permalink Reply
andrew
view.php in your current theme is used in a couple different situations.

1. (The most common) you have a "single page" for some specific functionality. That page's content resides in single_pages/your_page.php, and after it is rendered, it is deposited into the content at yourtheme/view.php. This is so that you can create single pages that are separate from the themes that they may reside in.

2. (Less common, but what is happening here.) Your package installs a page type, and then the content of that page type is specified in packages/your_package/page_types/page_type_name.php. This is what's happening in the calendar. A "calendar_event" page type is created. But since the calendar can be used on any theme, we store the calendar-specific page type content in packages/calendar/page_types/calendar_event.php, which, when viewed on your site, is shown in view.php (the same way a single page is.)

Overriding: if you create a file named "calendar_event.php" in your theme, it will override the content of page_types/calendar_event.php completely. This way you can customize the calendar event for your site without hacking your package's code.
BeKindRewind replied on at Permalink Reply
BeKindRewind
Thanks Andrew. That's exactly what I needed!