Smarty Forum Index Smarty
The discussions here are for Smarty, a template engine for the PHP programming language.
Load different TPL files if option selected

 
Post new topic   Reply to topic    Smarty Forum Index -> General
View previous topic :: View next topic  
Author Message
suncrew
Smarty Rookie


Joined: 30 Aug 2013
Posts: 5

PostPosted: Fri Aug 30, 2013 7:11 pm    Post subject: Load different TPL files if option selected Reply with quote

Hello. This is my first question in this forum.

I have SVG maps, which divided in individual TPL files.

I have page with advanced search form - Example: www.website.com/advanced-search.html

From left side of search form I have div element with map.

I also have map of one country in homepage. I want when user click in one region in homepage map to redirect him to advanced search form and include the region map that user click.

How to do this?

Thanks for all the answers in advance
Back to top
View user's profile Send private message
suncrew
Smarty Rookie


Joined: 30 Aug 2013
Posts: 5

PostPosted: Mon Sep 02, 2013 8:33 am    Post subject: Reply with quote

Nobody was able to help me with advice

How to do the following:

www.website.com/advanced-search.html&map=1

And load first map

If map=2 load second map and etc.
Back to top
View user's profile Send private message
TheOddPerson
Smarty n00b


Joined: 19 May 2013
Posts: 3
Location: Canada

PostPosted: Tue Sep 03, 2013 4:20 pm    Post subject: Reply with quote

It's basic php.

Code:

if (isset($_GET['map'])) {
   switch($_GET['map']) { //Gather data sent to php from browser
      case null:
         //no data (url typed in address bar / bookmark
         $smarty->display('blank.tpl');
         break;
      case '1':
         $smarty->display('map1.tpl');
      case '2':
         $smarty->display('map2.tpl');
}}

Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Smarty Forum Index -> General All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP