4images Forum & Community
Welcome, Guest. Please login or register.
Did you miss your activation email?
June 28, 2016, 07:58:17 AM

Login with username, password and session length
Search:     Advanced search
You're looking for some 4images templates and styles? Then visit this thread to show websites with 4images templates to download.
Togle to toolbar
Translate this page with =>
Translate this page >
* Home Help Search Login Register
 
+  4images Forum & Community
|-+  4images Modifications / Modifikationen
| |-+  Templates & Styles (Requests & Discussions) (Moderator: Rembrandt)
| | |-+  Menu?
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] 2 » »» Print
Author Topic: Menu?  (Read 17588 times)
nicky9
Jr. Member
**
Offline Offline

Posts: 63

Thank You
-Given: 0
-Receive: 0


View Profile
« 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.
Logged
† manurom
Full Member
***
Offline Offline

Posts: 227

Thank You
-Given: 0
-Receive: 6


View Profile WWW
« 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:

add these lines:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
//---------------------------------------------------------------------------------------------
//---- 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:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
<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:
1
2
3
4
5
6
7
8
9
10
<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:
1
{endif random_image}

Add this:
1
{my_menu}

Find:

Add BEFORE:
1
{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.

* my_menu.zip (5.32 KB - downloaded 131 times.)
Logged

nicky9
Jr. Member
**
Offline Offline

Posts: 63

Thank You
-Given: 0
-Receive: 0


View Profile
« Reply #2 on: May 06, 2008, 01:18:45 PM »

Thanx a bunch ! !  Very Happy

I'll try it out.
Logged
mawenzi
4images Moderator
4images Guru
*****
Offline Offline

Posts: 4500

Thank You
-Given: 36
-Receive: 121


View Profile
« Reply #3 on: May 06, 2008, 02:46:14 PM »

... perfect manurom ...  Very Happy
... this should be a tutorial ... in the right forum ... !
Logged

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) ...
nicky9
Jr. Member
**
Offline Offline

Posts: 63

Thank You
-Given: 0
-Receive: 0


View Profile
« 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?  Razz
Logged
† manurom
Full Member
***
Offline Offline

Posts: 227

Thank You
-Given: 0
-Receive: 6


View Profile WWW
« 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?  Razz

Keep on looking at the tutorials forum here: Tutorials.

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

KurtW
4images Guru
*******
Offline Offline

Posts: 2778

Thank You
-Given: 0
-Receive: 8


View Profile WWW
« 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:
1
  "url_captcha_image" => $site_sess->url(ROOT_PATH."captcha.php"),
after add:
1
  "url_therms" => $site_sess->url(ROOT_PATH."therms.php"),
search:
1
  "charset" => $lang['charset'],
after add:
1
  "lang_therms" => $lang['therms'],


add in lang/my_language/main.php:
1
$lang['therms'] = "Therms";

add in my_menue.html, where do you like the link:
1
<a href="{url_therms}">{lang_therms}</a>


Quote  [Expand]
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 » Logged

† manurom
Full Member
***
Offline Offline

Posts: 227

Thank You
-Given: 0
-Receive: 6


View Profile WWW
« Reply #7 on: May 06, 2008, 06:01:17 PM »

Hi, Kurtw;
my bad! Embarassed
Did answer too much too quickly, but not checked enough.
You're totally right.
Logged

nicky9
Jr. Member
**
Offline Offline

Posts: 63

Thank You
-Given: 0
-Receive: 0


View Profile
« 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?
Logged
KurtW
4images Guru
*******
Offline Offline

Posts: 2778

Thank You
-Given: 0
-Receive: 8


View Profile WWW
« Reply #9 on: May 07, 2008, 05:55:34 AM »

Hi,

please look at my last post...

KurtW
Logged

nicky9
Jr. Member
**
Offline Offline

Posts: 63

Thank You
-Given: 0
-Receive: 0


View Profile
« Reply #10 on: May 07, 2008, 11:11:35 AM »

Thanks a lot, now I get no error message.  Razz

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...  Rolling Eyes

Logged
nicky9
Jr. Member
**
Offline Offline

Posts: 63

Thank You
-Given: 0
-Receive: 0


View Profile
« 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?
Logged
† manurom
Full Member
***
Offline Offline

Posts: 227

Thank You
-Given: 0
-Receive: 6


View Profile WWW
« 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?
Logged

nicky9
Jr. Member
**
Offline Offline

Posts: 63

Thank You
-Given: 0
-Receive: 0


View Profile
« 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?
Logged
† manurom
Full Member
***
Offline Offline

Posts: 227

Thank You
-Given: 0
-Receive: 6


View Profile WWW
« 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:
1
<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:
1
<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 » Logged

Pages: [1] 2 » »» Print 
« previous next »
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.095 seconds with 19 queries.
Post your comments here