View Single Post
  #19  
Old 03-16-2003, 04:49 PM
 
Darren Darren is offline
 

Member
  
Join Date: Dec 2002
Posts: 19
 

Default

I make several pages and use the following method.
You can modify the page names (ie., information.tpl) to whatever you want, but it will probably be easier the first time to do it exactly as I show so it won't be so confusing.

Here it is step by step:

1. Make a copy of help.tpl and call it information.tpl
2. Open the new information.tpl and change each link that has
"help.php?section" to "home.php?mode"
3. Change each word/phrase after the "=" sign to whatever your topic is for that link. For instance, here is one of my links.
Code:
<a href="home.php?mode=whatis">

4. Next, go ahead and put your language label there even though you haven't set it up in the language area.
For instance, one of mine is
Code:
{$lng.lbl_whatisabattery}

5. Your entire new link should look like this:


6. Enter as many links as you need after the
, but write down the word you used for the mode and also the label tag. You will need that info and it will save you from having to go back and forth.

7. Go to the language link in the admin menu, select English (if that's your primary language), and add each new label. Hint: you have to scroll down to the bottom of the page. Doublecheck your entries to avoid problems.

8. Next, go to your ./customer/main directory and make a new file including the extension ".tpl". For mine, I made one called whatis.tpl

9. Open up each new file. It should be totally blank.

Put this:


Code:
{ include file="location.tpl" last_location="What is a Battery"} {capture name=dialog} {$lng.txt_whatis} {/capture} { include file="dialog.tpl" title="What is a Battery?" content=$smarty.capture.dialog extra="width=100%"}

See where it says "last_location=What is a Battery"? That is what will show up in the location text that is present on each customer page.

Where it says "title="What is a Battery?" will show in the colored dialog box that is also on every customer page.

Both of these can be changed to whatever you decide later.

10. In the code above, you see the {$lng.txt_whatis} ?
That's what we're going to fix next. That is the actual text that smarty pulls from your language text area. I called mine "txt_whatis". You can call yours whatever you want.

So, go BACK to the language link in the admin menu and select English but this time we want to select the "text" pulldown in the Topic listing. Scroll down to add your file name, but be sure it's the exact same name as what is on the .tpl pages you just made. Write each label like "txt_whatis", NOT like this "$lng.txt_whatis . Write your description and value for each txt entry. The value will be all the text you want to show up on the page. HTML is acceptable here.

11. Go to customer/home_main.tpl and add this code for each link/page you just made
Code:
{elseif $smarty.get.mode eq "whatis"} {include file="customer/main/whatis.tpl"}


12. Finally, the last thing you need to do is place your new section (information.tpl) on the customer page. Simply go to customer/home.tpl and drop your new section wherever you want it to show. I placed mine just about the Help section, so it looks like this:

Code:
{ include file="information.tpl" } { include file="help.tpl" }


That's it. It's actually easier than all this sounds, but I wanted to go step by step to make it easy. The main thing is to make sure you are consistent with what you call things so as to avoid confusion.

I suggest using the exact names as I did just to see how it works and than just go back and change to your likings.

Hope this helps.
Reply With Quote