Jump to content

Use another template in runtime


diegonella
 Share

Recommended Posts

Hi all, 

I am listing a gallery of products and each product, there is the possibility of seeing a rapid or enter the product and see it in detail view. 

I have the following structure 

/products/product-a 

and would like to pass on to the product in a segment to display quick view 

/products/product-a/quick-view 

There any way to use another template in runtime?

Thanks

Link to comment
Share on other sites

......But what is not as changing the template assigned to the page I'm invoking (at runtime)

Is this even possible? A template is tied to a page and its content is mapped to the fields attached to that template. If a page were to use another pages template these relations would be lost....I might be wrong here. Anyway, I don't really get what you are trying to do. Why would you want to use another template at runtime? 

Link to comment
Share on other sites

actually you can just show different content based on the request type; so if you are doing a quick view, then you show that with Ajax; if you are linking to the page you show the page code;

i'm doing that here:

http://www.katonahartcenter.com/student-showcase/

and here:

http://www.charleswuorinen.com/compositions/

so on your template:

<?php if($config->ajax) { ?>

show your markup for the quickview here

<?php } else { ?>

show your normal page code

<?php } ?>

so you don't need the quickview part of the URL

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...