Forums / Templates, Stylesheets, Page Layout / Chapter and TOC table mods

Chapter and TOC table mods

Locked
Results 1 to 6 of 6
This thread is locked. New replies are disabled.
07 Sep 2006, 20:03
#1
gmaderic avatar

gmaderic

New Zenner

Join Date:
Jun 2005
Posts:
12
Plugin Contributions:
0

Chapter and TOC table mods

Greetings,

I would like to display chapter and TOC in my ezpages but would like the tabel in a horizontal format. I am currently searching the "tpl" files for anything related to ezpages.

Does anyone know the location and file I need to modify to change the properties of this table ???
16 Nov 2006, 23:02
#2
lilymoon avatar

lilymoon

New Zenner

Join Date:
Nov 2006
Posts:
6
Plugin Contributions:
0

Re: Chapter and TOC table mods

The page is located here:
/templates/tpl_page_default.php

I am also working on a horizontal menu. If anyone has a preformatted menu they'd like to share, please do!

Ideally I was trying to get the 'current' page to move above the others, but this doesn't seem to work when I change the codes. Rather it keeps the position the same.

Here's an example of what i was trying to do:

ABOUT
Services FAQ Contact

(next page)
SERVICES
About FAQ Contact

What it's doing:

About

SERVICES

FAQ Contact

My next move is just to put them with the TOC Heading context as a label and bold the current selection.

If anyone knows the code to make it do what I'd like it to do, please let me know! (oh, I didn't display the context header as I didn't need one)

Thanks :)
17 Nov 2006, 00:17
#3
lilymoon avatar

lilymoon

New Zenner

Join Date:
Nov 2006
Posts:
6
Plugin Contributions:
0

Re: Chapter and TOC table mods

Additionally, if I want to move the TOC code to show up on the TPL_HEADER.PHP file, is this possible?

I try to remove the code I think is all the code for the TOC, but when I remove it the entire EZ Page does not appear.

Here's the full TPL_PAGE_DEFAULT code:
<?php
/**
 * Page Template
 *
 * This is the template used for EZ-Pages content display.  It is named "tpl_page_default" instead of ezpage for friendlier 
 * appearance
 *
 * @package templateSystem
 * @copyright Copyright 2003-2005 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_page_default.php 2741 2005-12-30 19:58:21Z birdbrain $
 */
?>
<div class="centerColumn" id="ezPageDefault">
<?php

// horizontal TOC listing
// create a table of contents for chapter when more than 1 page in the TOC
  if ($pages_listing->RecordCount() > 1 and EZPAGES_SHOW_TABLE_CONTENTS == '1') {?>
<div id="navEZPagesTOCWrapper">
<fieldset>
<legend id="ezPagesTOCHeading"><?php echo TEXT_EZ_PAGES_TABLE_CONTEXT; ?></legend>
<div id="navEZPagesTOC">
<ul>
<?php while (!$pages_listing->EOF) {
// could be used to change classes on current link and toc (table of contents) links
      if ($pages_listing->fields['pages_id'] == $_GET['id']) { ?>

<li><?php echo CURRENT_PAGE_INDICATOR; ?><a href="<?php echo zen_ez_pages_link($pages_listing->fields['pages_id']);?>"><?php echo $pages_listing->fields['pages_title']; ?></a></li>

<?php } else { ?>

<li><?php echo NOT_CURRENT_PAGE_INDICATOR; ?><a href="<?php echo  zen_ez_pages_link($pages_listing->fields['pages_id']); ?>"><?php echo $pages_listing->fields['pages_title']; ?></a></li>
<?php
      }
      $pages_listing->MoveNext();
    } ?>
</ul>
</div>
</fieldset>
</div>
<!-- EZ page title -->
<h1 id="ezPagesHeading"><?php echo $var_pageDetails->fields['pages_title']; ?></h1>

<?php
    }
?>
<div><?php echo $var_pageDetails->fields['pages_html_text']; ?></div>
    <?php if (EZPAGES_SHOW_PREV_NEXT_BUTTONS=='2' and $counter > 1) { ?>
<div id="navEZPageNextPrev">
      <a href="<?php echo $prev_link; ?>"><?php echo $previous_button; ?></a>
      <?php echo zen_back_link() . $home_button; ?></a>
      <a href="<?php echo $next_link; ?>"><?php echo $next_item_button; ?></a>
</div>
<?php } elseif (EZPAGES_SHOW_PREV_NEXT_BUTTONS=='1') { ?>
<div id="navEZPageNextPrev"><?php echo zen_back_link() . $home_button . '</a>'; ?></div>
<?php  } ?>
</div>
And here's the code I removed from the code above, but it seems to mess up this page:
<?php

// horizontal TOC listing
// create a table of contents for chapter when more than 1 page in the TOC
  if ($pages_listing->RecordCount() > 1 and EZPAGES_SHOW_TABLE_CONTENTS == '1') {?>
<div id="navEZPagesTOCWrapper">
<fieldset>
<legend id="ezPagesTOCHeading"><?php echo TEXT_EZ_PAGES_TABLE_CONTEXT; ?></legend>
<div id="navEZPagesTOC">
<ul>
<?php while (!$pages_listing->EOF) {
// could be used to change classes on current link and toc (table of contents) links
      if ($pages_listing->fields['pages_id'] == $_GET['id']) { ?>

<li><?php echo CURRENT_PAGE_INDICATOR; ?><a href="<?php echo zen_ez_pages_link($pages_listing->fields['pages_id']);?>"><?php echo $pages_listing->fields['pages_title']; ?></a></li>

<?php } else { ?>

<li><?php echo NOT_CURRENT_PAGE_INDICATOR; ?><a href="<?php echo  zen_ez_pages_link($pages_listing->fields['pages_id']); ?>"><?php echo $pages_listing->fields['pages_title']; ?></a></li>
<?php
      }
      $pages_listing->MoveNext();
    } ?>
</ul>
</div>
</fieldset>
</div>
Any help please!:wacko::no: Thanks!
17 Nov 2006, 01:45
#4
clydejones avatar

clydejones

Deceased

Join Date:
Nov 2005
Posts:
7,017
Plugin Contributions:
12

Re: Chapter and TOC table mods

You don't need to do anything with the template files; creating the horizontal look can be accomplished in your stylesheet.

In your stylesheet find the following

.floatingBox, #accountLinksWrapper, #sendSpendWrapper, #checkoutShipto, #checkoutBillto, #navEZPagesTOCWrapper {
	margin: 0;
	width: 47%;
	}


now create a new declaration and delete the highlighted portion above.
	#navEZPagesTOCWrapper {
	margin: 0;
	width: 100%;
	}


Now find the following and delete the highlighted portion:
#navEZPagesTOCWrapper {
	font-weight: bold;
	float: right;
	height: 1%;
	border: 1px solid #9a9a9a;
	}


Now find the following and add the highlighted portion:
#navEZPagesTOC ul li {
	white-space: nowrap;
		display: inline;
}


This should give you your horizontal TOC
18 Nov 2006, 15:55
#5
lilymoon avatar

lilymoon

New Zenner

Join Date:
Nov 2006
Posts:
6
Plugin Contributions:
0

Re: Chapter and TOC table mods

Hi Clyde,

Thanks for the CSS. That will help CSS novices, unfortunately it will not help in my case. I was able to create a horizontal menu using CSS, as stated in my first post, but was having an issue with the placement due to the way the PHP was taking the ez page links. I decided to just use fieldset and legends to house the TOC and it looks better BUT I do need help with the following, please!:D

I need help with the removal of the EZ Pages TOC PHP because I want to place it ABOVE the main content table (which is in another template file). Why? Because I want to create a javascript where it appears as a submenu and by keeping it in the template file as it currently is, there is other stuff that is displayed above it and it looks off.

If someone can please help me by providing the actual code that is safe to remove from this template file (so I can paste it into the header file), I'd really appreciate it!

Thanks again!
05 Apr 2010, 23:18
#6
reidwalley avatar

reidwalley

New Zenner

Join Date:
Jun 2008
Posts:
4
Plugin Contributions:
0

Re: Chapter and TOC table mods

This worked great. Thanks @clydejones.