Welcome, Guest. Please login or register.
Did you miss your activation email?
May 26, 2012, 06:06:06 PM

Login with username, password and session length
Search:     Advanced search
Wollen Sie dem WebsiteBaker Team beitreten?
Nähere Informationen finden Sie unter hier und auf unserer neuen Webseite.
155547 Posts in 21714 Topics by 7736 Members
Latest Member: chris85
* Home Help Search Login Register
Pages: [1]   Go Down
Print
Author Topic: Unique page  (Read 480 times)
pjok

Offline Offline

Posts: 5


WWW
« on: May 29, 2011, 06:31:04 AM »

I need to make a site that has a header image which isn't supposed to be displayed anywhere but on the front page.

This site needs to be completed before Tuesday  (31 may).

Anyone care to elaborate on how to do this?

I also need help with the Show_menu2 module, I don't quite understand it and I need help to make it right. This is the format of a normal HTML output from the site I'm making, the " <ul> " is supposed to be a drop-down menu. I need someone to give me the proper format to make the drop-down menu work with the following code below:

Code:
<nav id="nav-main" class="main jqueryslidemenu">
                    <ul class="nav">
                        <li><a href="./index.html">Home</a></li>
                        <li><a href="./sidebar.html">Sidebar</a></li>
                        <li><a href="#">Properties</a>
                            <ul>
                                <li><a href="./features.html">HTML addons</a></li>
                                <li><a href="./typo.html">Typoi</a></li>
                                <li><a href="./layouts.html">Layouts</a></li>
                            </ul>
                        </li>
                        <li><a href="./contact.html">Contakt</a></li>
                    </ul>
                </nav>
Logged
unawave2

Offline Offline

Posts: 82


« Reply #1 on: May 29, 2011, 08:54:03 AM »

I need to make a site that has a header image which isn't supposed to be displayed anywhere but on the front page.
When your front page has page id=1 then enter this into your index.php of your template:
Code:
<?php if(PAGE_ID == 1) {echo '<img src="..." />';} ?>
or this
Code:
<?php if(PAGE_ID == 1) {echo '<img src="..." />';}
else {echo 
'<img src="..." />';} ?>
Logged
pjok

Offline Offline

Posts: 5


WWW
« Reply #2 on: May 29, 2011, 11:59:06 AM »

Thanks, does anyone have a solution to my second problem about the menu?
Logged
DarkViper
Development Team
*****
Offline Offline

Posts: 1253


« Reply #3 on: May 29, 2011, 07:14:44 PM »

to use a hard coded page_id is a solution, but never the best one because the ID of the start page will change if another language is selected... and some more reasons too.
It's more sure an flexible to get the ID from database / page-tree like the core and SM2 do it also.

Code: (request ID of the startup page)
<?php

$iStartPage intval(show_menu2(1SM2_ROOTSM2_STARTSM2_ALL|SM2_NUMCLASS|SM2_BUFFER,
                                '[if(class==menu-0 && class==menu-first){[page_id]}]'''''''''''));


based on this you can select your image

Code:
<?php
if( PAGE_ID == $iStartPage ) {
   echo 
'<img src="..." />';
}else {
   echo 
'<img src="..." />';
}


this should create your menu:
Code:
<?php
$sMenu 
show_menu2(1SM2_ROOTSM2_ALLSM2_TRIM|SM2_PRETTY|SM2_BUFFER,
                    
'[li][if(class==menu-expand){[MENU_TITLE]}else{[a][MENU_TITLE]</a>}]',
                    
'</li>',falsefalse,falsefalse);

« Last Edit: May 29, 2011, 09:35:15 PM by DarkViper » Logged

Anleitungen lesen und selber nachdenken ist anstrengend...  Da lass ich doch lieber andere für mich denken...

In 1984:  Nineteen Eighty-Four is a unrealistic utopia!!
In 2012:  Nineteen Eighty-Four is a little piece only of our reality!!
pjok

Offline Offline

Posts: 5


WWW
« Reply #4 on: May 30, 2011, 08:28:57 AM »


this should create your menu:
Code:
<?php
$sMenu 
show_menu2(1SM2_ROOTSM2_ALLSM2_TRIM|SM2_PRETTY|SM2_BUFFER,
                    
'[li][if(class==menu-expand){[MENU_TITLE]}else{[a][MENU_TITLE]</a>}]',
                    
'</li>',falsefalse,falsefalse);



Nope, that menu didn't even display.

The only area i'm trying to focus on is this one:

Code:
<li><a href="./index.html">Home</a></li>
                        <li><a href="./sidebar.html">Sidebar</a></li>
                        <li><a href="#">Properties</a>
                            <ul>
                                <li><a href="./features.html">HTML addons</a></li>
                                <li><a href="./typo.html">Typoi</a></li>
                                <li><a href="./layouts.html">Layouts</a></li>
                            </ul>
                        </li>
                        <li><a href="./contact.html">Contakt</a></li>
Logged
pcwacht
AddOn Development
*
Online Online

Posts: 2859



WWW
« Reply #5 on: May 30, 2011, 09:58:48 AM »

Copy your template to a new one, install it and change whatever is needed and set the startpage to that new template.
Is really the best way to do this without getting headaches !



Showmenu2 question, this is the standard default way how showmenu2 would make a menu
only thing is to change the classnames to showmenu2 ones, or tell showmenu2 your classes.
Try this for size:
Code:
<ul class="nav">
<?php 
show_menu2
(2SM2_ROOTSM2_ALLSM2_ALL'<li><a href="[url]" title="[menu_title]">[menu_title]</a></li>','','','',false,'');
?>

</ul>
Just substitute your  outside <ul.... </ul>


John
Logged

http://www.ictwacht.nl = Dutch ICT info
http://www.pcwacht.nl = My first
both still work in progress, since years.....
Pages: [1]   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!