Zen Follower
- Join Date:
- Jun 2006
- Posts:
- 223
- Plugin Contributions:
- 0
How to directly link to defined pages?
What html php do I need to use to directly link to a defined pages in my template?
Views: 3,295
Zen Follower
What html php do I need to use to directly link to a defined pages in my template?
Totally Zenned
I may be misunderstanding your question, but set up the page you need, find the link in your information/more information/wherever you're displaying it sidebox and right click>copy link information (or your browser equivalent)
Zen Follower
I am making a general template for everyone.
So I need a general php link I can put in the header that will call up defined pages.
So I don't need it to be specific to my domain but a php/zencart variable
Obaa-san
If you set up a site and mouseover the links I think you will begin to see the pattern of their naming.
Zen Follower
Yeah but that shows the links for the specific domain. I am looking to make a general template that will grab the site domain from the langugage files
Totally Zenned
Ok, take a look at includes/modules/sideboxes/more_information.php
Zen Follower
I tried linking list this but it did not work
<li><a href="<?php echo zen_href_link('shippinginfo')?>">Shipping & Returns</a></li>
What am I doing wrong?
Totally Zenned
<li><a href="<?php echo zen_href_link('shippinginfo')?>">Shipping & Returns</a></li> ``` > > What am I doing wrong?bjraines:
I tried linking list this but it did not work
Try```
zen_href_link(FILENAME_SHIPPING)
and filenames are defined in includes/filenames.php
Zen Follower
so you can't call them directly by their filename....like minus the .php
Zen Follower
That didn't work either here is the code I am presenting in tpl_header. I am using version 1.3.6
Thanks!
My direct links to define pages are not working. The last link I tried the old way and way suggested above.
<?php
/**
* Common Template - tpl_header.php
*
* this file can be copied to
/templates/your_template_dir/pagename<br />
* example: to override the privacy page<br />
* make a directory /templates/my_template/privacy<br />
* copy /templates/templates_defaults/common/tpl_footer.php to
/templates/my_template/privacy/tpl_header.php<br />
* to override the global settings and turn off the footer un-comment
the following line:<br />
* <br />
* $flag_disable_header = true;<br />
*
* @package templateSystem
* @copyright Copyright 2003-2006 Zen Cart Development Team
* @copyright Portions Copyright 2003 osCommerce
* @license http://www.zen-cart.com/license/2_0.txt GNU Public
License V2.0
* @version $Id: tpl_header.php 3392 2006-04-08 15:17:37Z birdbrain $
*/
?>
<?php
// Template designed by www.zen4me.com (c) 2006
//
// Display all header alerts via messageStack:
if ($messageStack->size('header') > 0) {
echo $messageStack->output('header');
}
if (isset($_GET['error_message']) &&
zen_not_null($_GET['error_message'])) {
echo htmlspecialchars(urldecode($_GET['error_message']));
}
if (isset($_GET['info_message']) &&
zen_not_null($_GET['info_message'])) {
echo htmlspecialchars($_GET['info_message']);
} else {
}
?>
<!--bof-header logo and navigation display-->
<?php
if (!isset($flag_disable_header) || !$flag_disable_header) {
?>
<div id="headerWrapper">
<table style="text-align: left; width: 750px;"
>
<tbody>
<tr>
<td colspan="3" rowspan="1" style="width: 124px;"><div
id="navMain">
<ul class="back">
<li><?php echo '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . '">';
?><?php echo HEADER_TITLE_CATALOG; ?></a></li>
<?php if ($_SESSION['customer_id']) { ?>
<li><a href="<?php echo zen_href_link(FILENAME_LOGOFF, '',
'SSL'); ?>"><?php echo HEADER_TITLE_LOGOFF; ?></a></li>
<li><a href="<?php echo zen_href_link(FILENAME_ACCOUNT, '',
'SSL'); ?>"><?php echo HEADER_TITLE_MY_ACCOUNT; ?></a></li>
<?php
} else {
if (STORE_STATUS == '0') {
?>
<li><a href="<?php echo zen_href_link(FILENAME_LOGIN, '', 'SSL');
?>"><?php echo HEADER_TITLE_LOGIN; ?></a></li>
<?php } } ?>
<?php if ($_SESSION['cart']->count_contents() != 0) { ?>
<li><a href="<?php echo zen_href_link(FILENAME_SHOPPING_CART, '',
'NONSSL'); ?>"><?php echo HEADER_TITLE_CART_CONTENTS; ?></a></li>
<li><a href="<?php echo zen_href_link(FILENAME_CHECKOUT_SHIPPING,
'', 'SSL'); ?>"><?php echo HEADER_TITLE_CHECKOUT; ?></a></li>
<?php }?>
</ul>
</div></td>
</tr>
<tr>
<td style="width: 430px;"><img alt="personalized gifts and
custom monogramming" src="<?php echo
DIR_WS_TEMPLATE_IMAGES?>logo.png"></td>
<td style="width: 160px; vertical-align: bottom;"><ul>
<li><a href="<?php echo zen_href_link('privacy')?>">Privacy
Notice</a></li>
<li><a href="<?php echo
zen_href_link('conditions')?>">Condition of Use</a></li>
<li><a href="<?php echo
zen_href_link('shippinginfo')?>">Shipping & Returns</a></li>
<li><a href="<?php echo
zen_href_link('contact_us')?>">Contact Us</a></li>
<li><a href="<?php echo zen_href_link('site_map')?>">Site
Map</a></li>
<li><a href="<?php echo zen_href_link(FILENAME_SHIPPING)?>">Shipping
& Returns</a></li>
</ul>
</td>
<td style="width: 160px; vertical-align: top;"><a href="<?php
echo zen_href_link('shopping_cart')?>"><img src="<?php echo
DIR_WS_TEMPLATE_IMAGES?>cart.gif" ></a></div>
<br /><?php
if (SHOW_TOTALS_IN_CART == '1') {
echo '<strong>' . $_SESSION['cart']->count_contents() .
' ' . 'items</strong>' . ' ' . 'in your cart' . '<br />' .
$currencies->format($_SESSION['cart']->show_total());
} ?> </td>
</tr>
</tbody>
</table>
<table class="zmhb01" width="750" border="0" cellspacing="0"
cellpadding="0">
<tr>
<td width="175" valign="bottom">
<strong>Find:</strong>
<?php echo
zen_draw_hidden_field('main_page',FILENAME_ADVANCED_SEARCH_RESULT)?>
<?php echo zen_draw_hidden_field('search_in_description',
'1')?>
<?php echo zen_draw_input_field('keyword')?><input name=""
type="hidden">
</td>
<td width="198" align="left" valign="bottom">
<strong>Currencies:</strong>
<?php echo zen_draw_form('currencies',
zen_href_link(basename(ereg_replace('.php','', $PHP_SELF)), '',
$request_type, false), 'get')?>
<?php reset($currencies->currencies);
$currencies_array = array();
while (list($key, $value) = each($currencies->currencies)) {
$currencies_array[] = array('id' => $key, 'text' =>
$value['title']);
}
$hidden_get_variables = '';
// reset($HTTP_GET_VARS);
//while (list($key, $value) = each($HTTP_GET_VARS)) {
if ( ($key != 'currency') && ($key != zen_session_name()) &&
($key != 'x') && ($key != 'y') ) {
$hidden_get_variables .= zen_draw_hidden_field($key, $value);
}
//}
echo zen_draw_pull_down_menu('currency', $currencies_array,
$_SESSION['currency'], 'onchange="this.form.submit();" class=select')
. $hidden_get_variables . zen_hide_session_id()?>
</form> </td>
<td width="377">
<div class="zmhb07">
<ul>
<li><a href="<?php echo
zen_href_link('featured_products')?>">Featured</a></li>
<li><a href="<?php echo
zen_href_link('specials')?>">Specials</a></li>
<li><a href="<?php echo
zen_href_link('products_new')?>">New</a></li>
<li><a href="<?php echo zen_href_link('products_all')?>">All
Products</a></li>
</ul>
</div>
</td>
</tr>
</table>
</div>
<?php } ?>
Obaa-san
Look at your includes/modules/sideboxes/information.php
example:
zen_href_link(FILENAME_PRIVACY)
Zen Follower
Kim:
Look at your includes/modules/sideboxes/information.php
example:
zen_href_link(FILENAME_PRIVACY)
what am i looking for exactly.....
i just want to link these directly. Neither of the ways above are working and I can't figure out why.
Thanks for everyone who has helped so far. I am still trying
Obaa-san
Use the constant (the ALL CAPS) instead of whatever it is that you are doing. Or stop trying to use the Zen function and just use <a href> with the relative address:
index.php?main_page=privacy
Zen Follower
If you notice the last link in the lits I used the all caps. I have been reading all the relevant threads and read the older About Us module instructions.
I really cannot see what I am doing wrong here.
Do I have to turn define pages on somewhere? I notice that some code has , if Define Status = 1?
The link where I am practicing is
update.bjrtechnologies.com
you will notice that privacy notice link in the header works but the one below it doesn't.
The code for the header is posted above. I will try the link you suggested now.
Thanks again for your time.:wink2:
Zen Follower
I AM AN IDIOT. The status for that link was set to 3. i don't even know how. so sorry
New Zenner
maybe you can help with mine?
I created a new define page called define_return_policy.php
Then I added the define to the filenames and also created a return_policy.php page and a pages folder with a header.php page for it in there, all in the appropriate places. I looked through all the other files I could think of. I even created a tpl_default_return_policy.php page in the templates...
The link reads correctly in the information pages, but it only calls the header, without calling the define page text. And in admin, while I can edit the define page text, there is nowhere to set the define page status for the new page...
what else can I try? I don't want to add this in the "more info" section, but in the main information section. I also tried turning on one of the extra define pages, like page 2, and putting the info there, and adding the link to the main info section, but it won't show up as a link there when I do that.
The site is:
New Zenner
Yep me too.
After about 6 hours of searching for the same answer required, it seems to be that quite a few of us have recreated ie 'page_5', and everything works except for being able to 'switch it on' in the Admin's Define Page Status because its the only place it doesn't appear to show up. You get every thing else up to 'page_4' and nothing else.
If you manage to make your extra link in ie 'More Information' it goes to the page that doesn't show your html work.
What are we missing?
Why doesn't it show up in admin's 'Define Page Status' ?
Most of the posts I'm finding seem to hit a dead end. What's the answer please Guru Zenners? There must be one somewhere, yeah?
When we actually have an answer, can we please pin this to the top of the boards?
Cheers.
New Zenner
I need a napkin for this humble pie around my mouth.
OHH! EZ PAGES!!
Save yourself a headache and go there.
Cheers
Dusky.
New Zenner
I ended up just changing the title and info for one of the other define pages, and then consolidating that one's info into another define page... lol.. oh well... I would still like to know how to do it correctly, as it seems it should be possible.
I didn't want to use the ez pages, as they show up a bit differently, style-wise, due to my stylesheets, as I'm using them for a different section of the site.
so if there's a way to actually make custom define pages work, I would realllly like to know. I have a couple more site design projects on the way, and I'd like to be able to implement that...
Obaa-san
Have a look in the Downloads section for the "About Us" contrib. Complete instructions on making additional Defined Pages.
Tell staff why this post should be reviewed.