Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Custom Dynamic Extra Pages with URL parameters, GET, POST - for Define and EZ Pages

Custom Dynamic Extra Pages with URL parameters, GET, POST - for Define and EZ Pages

Locked

Views: 7,835

Results 1 to 3 of 3
This thread is locked. New replies are disabled.
21 Jul 2006, 8:30 PM
#1
bjoly avatar

bjoly

New Zenner

Join Date:
May 2006
Posts:
28
Plugin Contributions:
0

Custom Dynamic Extra Pages with URL parameters, GET, POST - for Define and EZ Pages

Current version: 1.2.6d

I've been looking around for a post to help solve my problem but haven't had any luck. I have done a number of successful modifications to my client's website but am now snagged on this new problem. I need some help--or guidance at least.

PROBLEM:

I am setting up an extra page that can be edited with the Define Pages Editor. The page is a builders showcase/gallery and includes a menu of specific galleries. Rather than create an extra page for each gallery, I would like to pass another paramater to Zen Cart and use it to determine which gallery to generate. The menu would look something like:

<a href://www.anyzenstore.com/zencart/index.php?main_page=builders_showcase&gallery=1>Gallery 1</a><br>
<a href://www.anyzenstore.com/zencart/index.php?main_page=builders_showcase&gallery=2>Gallery 2</a><br>
<a href://www.anyzenstore.com/zencart/index.php?main_page=builders_showcase&gallery=3>Gallery 3</a><br>
....

I am confused how to handle this on the server side with Zen-Cart. I think I should be able to reference $_GET but this doesn't get the job done. The URL is sent to the server and Zen Cart doesn't know what to do with extra info so it defaults to the home page. Where does Zen-Cart 'catch' parameter values, such as 'main_page'? I assume it uses $_GET somewhere but how can I add more parameters, such as 'gallery'? Or do I need to use a form with hidden inputs?

Any help or suggestions would be greatly appreciated.

23 Jul 2006, 3:50 AM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Custom Dynamic Extra Pages with URL parameters, GET, POST - for Define and EZ Pages

You need:

  1. /includes/modules/pages/builders_showcase/header_php.php

inside this file, you need the intelligence to read the &gallery=x value:
$page_to_display = $_GET['gallery'];

Then act accordingly based on $page_to_display

  1. includes/languages/english/builders_showcase.php
    This is the language file ... which you can build from components in the privacy.php file in the same folder.

  2. includes/templates/YOURTEMPLATE/templates/tpl_builders_showcase_default.php

This is the template which displays your actual content.
Again, you could base it off the tpl_privacy_default.php as an example, since you stated you're using it to display define-page content specifically.

24 Jul 2006, 3:04 AM
#3
bjoly avatar

bjoly

New Zenner

Join Date:
May 2006
Posts:
28
Plugin Contributions:
0

Re: Custom Dynamic Extra Pages with URL parameters, GET, POST - for Define and EZ Pages

Thanks DrByte. I will let you know how this works.