diegonella Posted July 10, 2014 Share Posted July 10, 2014 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 More sharing options...
LostKobrakai Posted July 10, 2014 Share Posted July 10, 2014 Seems like your searching for url-segments. Take a look here: http://wiki.processwire.com/index.php/URL_Segments. Link to comment Share on other sites More sharing options...
diegonella Posted July 10, 2014 Author Share Posted July 10, 2014 Thanks LostKobrakai But what is not as changing the template assigned to the page I'm invoking (at runtime) Link to comment Share on other sites More sharing options...
kongondo Posted July 10, 2014 Share Posted July 10, 2014 ......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 More sharing options...
Macrura Posted July 11, 2014 Share Posted July 11, 2014 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 1 Link to comment Share on other sites More sharing options...
diegonella Posted July 11, 2014 Author Share Posted July 11, 2014 Thanks Macrura. I'll do it that way Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now