Author Topic: Menu?  (Read 27476 times)

0 Members and 1 Guest are viewing this topic.

Offline nicky9

  • Jr. Member
  • **
  • Posts: 63
    • View Profile
Menu?
« on: May 06, 2008, 10:23:58 AM »
Have been looking on the forum, but haven't found any real menu. I mean like a left-side menu with several menu-buttons with text that are shown in the main-frame when pressing the menu-buttom.

Also, a footer-menu with items like Contact Us | Cookies | Terms etc. etc.

Offline † manurom

  • Full Member
  • ***
  • Posts: 227
    • View Profile
    • manurom's 4images templates
Re: Menu?
« Reply #1 on: May 06, 2008, 12:33:10 PM »
Hello;
it should be possible, extending your template.

Here is an example, using the default template.

  • First, edit the file includes/page_header.php
At the end of this file, just before the closing:
Code: [Select]
?>
add these lines:
Code: [Select]
//---------------------------------------------------------------------------------------------
//---- Template my_menu.html ------------------------------------------------------------------
//---------------------------------------------------------------------------------------------

$my_menu = $site_template->parse_template("my_menu");
  $site_template->register_vars(array(
    "my_menu" => $my_menu
  ));
  unset($my_menu);
 
//---------------------------------------------------------------------------------------------
//---- Template my_footer.html ----------------------------------------------------------------
//---------------------------------------------------------------------------------------------

$my_footer = $site_template->parse_template("my_footer");
  $site_template->register_vars(array(
    "my_footer" => $my_footer
  ));
  unset($my_footer); 


  • Now, go to templates/your_template/ folder.

_____Create a first file called "my_menu.html", with this example code:
Code: [Select]
<div align="center">
<table  width="100" border="0" align="center" cellpadding="0" cellspacing="0">
 <tr>
  <td width="100%" align="center" height="17" background="{template_url}/images/button.gif" ><a href="index.php" style="text-decoration: none"><strong>First link</strong></a></td>
 </tr>
 <tr>
 <td width="100%" align="center" height="17" background="{template_url}/images/button.gif" ><a href="index.php" style="text-decoration: none"><strong>Second link</strong></a></td>
 </tr>
 <tr>
 <td width="100%" align="center" height="17" background="{template_url}/images/button.gif" ><a href="http://www.mysite.com/" style="text-decoration: none"><strong>Partner</strong></a></td>
 </tr>
 </table>
</div>
<br>
You will need also to copy this image: , into your_template/images/ directory.

_____Create another file called "my_footer.html" with this code:
Code: [Select]
<br /><div align="center">
  <table width="600" border="0" align="center" cellpadding="0" cellspacing="0">
    <tr class="head1">
      <td width="25%" align="center" class="row1"><a href="contact.php">Contact us</a> </td>
      <td width="25%" align="center" class="row2"><a href="cookies.php">Cookies</a></td>
      <td width="25%" align="center" class="row1"><a href="terms.php">Terms</a></td>
      <td width="25%" align="center" class="row2"><a href="wazza.php">Etc...</a></td>
    </tr>
  </table>
</div>

  • Now, you're able to call {my_footer} and {my_menu} in any of your other template pages.

Example: open your_template/home.html file/
Find:
Code: [Select]
{endif random_image}
Add this:
Code: [Select]
{my_menu}
Find:
Code: [Select]
{footer}
Add BEFORE:
Code: [Select]
{my_footer}
I've done this with the default menu, as I said, and had this:

  • My_menu display:
  • My_footer display:

Once done, you just have to modify the file my_menu.html or my_footer.html once to get the modification in the whole template.
I'm sure you will be able to custom it as you prefer.

Please find in attachment the modified page_header.php, version 1.7.6 and the template files and image.

Salutations.

Offline nicky9

  • Jr. Member
  • **
  • Posts: 63
    • View Profile
Re: Menu?
« Reply #2 on: May 06, 2008, 01:18:45 PM »
Thanx a bunch ! !  :D

I'll try it out.

Offline mawenzi

  • 4images Moderator
  • 4images Guru
  • *****
  • Posts: 4.500
    • View Profile
Re: Menu?
« Reply #3 on: May 06, 2008, 02:46:14 PM »
... perfect manurom ...  :D
... this should be a tutorial ... in the right forum ... !
Your first three "must do" before you ask a question ! ( © by V@no )
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

You are on search for top 4images MOD's ?
- then please search here ... Mawenzi's Top 100+ MOD List (unsorted sorted) ...

Offline nicky9

  • Jr. Member
  • **
  • Posts: 63
    • View Profile
Re: Menu?
« Reply #4 on: May 06, 2008, 03:59:40 PM »
Perhaps somebody with the right energy should put together all the essentials in a manual?  :P

Offline † manurom

  • Full Member
  • ***
  • Posts: 227
    • View Profile
    • manurom's 4images templates
Re: Menu?
« Reply #5 on: May 06, 2008, 04:39:52 PM »
Perhaps somebody with the right energy should put together all the essentials in a manual?  :P

Keep on looking at the tutorials forum here: Tutorials.

Mawenzi and others are making a great job. But be patient, they've just begun.

Offline KurtW

  • 4images Guru
  • *******
  • Posts: 2.778
    • View Profile
    • Malediven-Bilder ~~Dreams~~
Re: Menu?
« Reply #6 on: May 06, 2008, 05:31:47 PM »
Hi,

one question? do you lose with this links the session?

I thing it is better looks like the link tags:
in includes/page_header.php
search:
Code: [Select]
  "url_captcha_image" => $site_sess->url(ROOT_PATH."captcha.php"),after add:
Code: [Select]
  "url_therms" => $site_sess->url(ROOT_PATH."therms.php"),search:
Code: [Select]
  "charset" => $lang['charset'],after add:
Code: [Select]
  "lang_therms" => $lang['therms'],

add in lang/my_language/main.php:
Code: [Select]
$lang['therms'] = "Therms";
add in my_menue.html, where do you like the link:
Code: [Select]
<a href="{url_therms}">{lang_therms}</a>

Quote
And why do I have to add these things that KurtW added?
- You logged in with a seesion id and with this links you lost it.
- Multi language possible




KurtW

« Last Edit: May 07, 2008, 04:43:58 PM by KurtW »

Offline † manurom

  • Full Member
  • ***
  • Posts: 227
    • View Profile
    • manurom's 4images templates
Re: Menu?
« Reply #7 on: May 06, 2008, 06:01:17 PM »
Hi, Kurtw;
my bad! :oops:
Did answer too much too quickly, but not checked enough.
You're totally right.

Offline nicky9

  • Jr. Member
  • **
  • Posts: 63
    • View Profile
Re: Menu?
« Reply #8 on: May 06, 2008, 09:06:24 PM »
Excuse me for being a complete newbie in this, I get the following error message:
Parse error: syntax error, unexpected T_DOUBLE_ARROW in /home/mycelebp/public_html/includes/page_header.php on line 397

Does it have anything to do with the ROOT_PATH in the following line? Whould it be replaced with the real rootpath or something?
(Line 397) "url_therms" => $site_sess->url(ROOT_PATH."therms.php"),     (That last , should be a ; I guess?)

Also, where exactly do I put the  <a href="{url_therms}">{lang_therms}</a>  ? Just after <div align="center"> in my_meny.html?

And why do I have to add these things that KurtW added?

Offline KurtW

  • 4images Guru
  • *******
  • Posts: 2.778
    • View Profile
    • Malediven-Bilder ~~Dreams~~
Re: Menu?
« Reply #9 on: May 07, 2008, 05:55:34 AM »
Hi,

please look at my last post...

KurtW

Offline nicky9

  • Jr. Member
  • **
  • Posts: 63
    • View Profile
Re: Menu?
« Reply #10 on: May 07, 2008, 11:11:35 AM »
Thanks a lot, now I get no error message.  :P

I'm not really sure I understand everything though. First of all, I'm only going to use one language, do I then have to add all the code you recommended?  Or can I go with Manurom's original code only?

"- You logged in with a seesion id and with this links you lost it."
What does that mean?

What is "therms"? Do you mean terms? I guess it's one of the menus-items I'm supposed to add? And then I'm supposed to add more of them by myself, like "contact us" etc? And for every menu-item I have to add more code to main.php, my_menu.html etc but with "therms" exchanged to other menu-items?

Treat me like a child and I understand...  :roll:


Offline nicky9

  • Jr. Member
  • **
  • Posts: 63
    • View Profile
Re: Menu?
« Reply #11 on: May 07, 2008, 12:29:13 PM »
Regarding this line:

<td width="25%" align="center" class="row1"><a href="contact.php">Contact us</a> </td>

I'm not really sure how to implement contact.php. Should't it be contact.html? And then I have to have the entire webpage within that contact.html? And just write my own text in the main frame about contact?

Offline † manurom

  • Full Member
  • ***
  • Posts: 227
    • View Profile
    • manurom's 4images templates
Re: Menu?
« Reply #12 on: May 07, 2008, 02:08:08 PM »
Have you got existing pages for terms of use, contact form, or any other stuff?

Offline nicky9

  • Jr. Member
  • **
  • Posts: 63
    • View Profile
Re: Menu?
« Reply #13 on: May 07, 2008, 03:10:24 PM »
Ehh... no, I don't know how to do it. I'm completely new to this.

Do I add templates like contact.html, about.html and have them all similair with everything in it (toplogo, leftmenu, footer etc) except for the text in the main frame? Or how do I do it?

Offline † manurom

  • Full Member
  • ***
  • Posts: 227
    • View Profile
    • manurom's 4images templates
Re: Menu?
« Reply #14 on: May 07, 2008, 04:04:07 PM »
Hello;
  • About contact, you'll have to install something like this: [MOD] Contact Form.
    In this case, you will have to use links like KurtW said, to link to a "contact.php" file, keeping user's session alive.

_____Or else, let your visitor use its emailing software, using a link like this in your menu or footer:
Code: [Select]
<a href="mailto:me@myhost.com">Contact us</a>

_____For links to external sites, like partners, you may use this in your menu or footer:
Code: [Select]
<a href="http://www.my_partner.com/" target="_blank">My partner</a>
By the way, I think you should be better helped if you could tell us how many links you'd like tu use, and precisely for what use.
You could have a help for anyone of them in an only post, I hope.
« Last Edit: May 07, 2008, 04:17:27 PM by manurom »