My own url in the menu

About the template and stylesheet - and changing the menu
mads
Posts: 22
Joined: Wed Jun 04, 2008 11:47 pm
Location: Århus Denmark
Contact:

My own url in the menu

Post by mads » Tue Jun 17, 2008 12:01 am

What is the trick if I want to make a item (the main item) to be a link to a specific URL?
Normally the homepage, the index.php vil be there. But can I (hardcode) an item into the menu?

:-) Mads

johnjdoe
Posts: 571
Joined: Tue May 20, 2008 6:32 am

Re: My own url in the menu

Post by johnjdoe » Tue Jun 17, 2008 6:33 am

You could use this code:

Code: Select all

<H1>External link</h1>
#CMSimple header('Location:http://www.externallink.com'); #

Holger
Site Admin
Posts: 3211
Joined: Mon May 19, 2008 7:10 pm
Location: Hessen, Germany
Contact:

Re: My own url in the menu

Post by Holger » Tue Jun 17, 2008 8:35 am

Or you could use a more flexible toc-script:
http://cmsimplewiki.com/doku.php/addons/advanced_toc

Holger

ZiPs
Posts: 633
Joined: Thu May 22, 2008 6:17 pm
Location: Faxe, Denmark
Contact:

Re: My own url in the menu

Post by ZiPs » Wed Jun 18, 2008 5:27 pm

Hi mads

I am not quite sure what you question is?
but would you like the first link in your menu to be a link to another site or to a page in your site?

as I see it, is h1 in an array which chooses the first h1 as a start page, so if you write this code into the content as the first h1
it will be redirected to the url in the code

Code: Select all

<h1>External link</h1>
#CMSimple header('Location:http://www.externallink.com');#
I have not tested advanced_toc yet, but will try to see if it can do the job

/ZiPs
Preben Dahl | Webmaster cmsimple.dk | Projekt-og domæne ejer Gert Ebersbach

Tata
Posts: 3188
Joined: Tue May 20, 2008 5:34 am
Location: Slovakia
Contact:

Re: My own url in the menu

Post by Tata » Wed Jun 18, 2008 7:53 pm

There is also a way to have the link placed in the tempalte.htm and styled to the same look like the items in the menu.
E.g.:

Code: Select all

...
<a href="path_to_the_URL_od_your_choice" class="item">Your Item<a><br>
<?php echo toc();?>
<a href="path_to_the_URL_od_your_choice" class="item">Another Item<a><br>
...
You need to add the class "item" into your stylesheet.css and style it properly.
CMSimple.sk
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.

ZiPs
Posts: 633
Joined: Thu May 22, 2008 6:17 pm
Location: Faxe, Denmark
Contact:

Re: My own url in the menu

Post by ZiPs » Thu Jun 19, 2008 9:41 pm

Hi mads

I've got the first h1 to be
<h1>External link</h1>
#CMSimple header('Location:http://www.externallink.com');#

But because it is the first h1, it will redirected to the url in the code, but by changing the cms.php you can choose which menu it will start in.

in line 290 in cms.php you finde this

Code: Select all

	$duplicate = 1;
	$empty = 1;
	$s = -1;
	$ta = array();
	$cl = count($c);
if you change $s = -1; to 1, it will start at the second menu, 2 = 3 menu, etc.

Hope this is something you can use, otherwise you have to write a little more so I understand :?

/ZiPs
Preben Dahl | Webmaster cmsimple.dk | Projekt-og domæne ejer Gert Ebersbach

Tata
Posts: 3188
Joined: Tue May 20, 2008 5:34 am
Location: Slovakia
Contact:

Re: My own url in the menu

Post by Tata » Thu Jun 19, 2008 10:45 pm

There is another way too. Make the first page with some "Welcome" content and hide the page from the menu (<h1 style=display:none>Welcome</h1>).
CMSimple.sk
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.

mads
Posts: 22
Joined: Wed Jun 04, 2008 11:47 pm
Location: Århus Denmark
Contact:

Re: My own url in the menu

Post by mads » Thu Jun 19, 2008 11:47 pm

Hi guys,

Sorry for the delay in response, and thanks a lot for your many good ideas!
I turned out that this was exactly what I was looking for :-)

Code: Select all

<h1>External link</h1>
#CMSimple header('Location:http://www.externallink.com');#
Its doing the exact joc of being the start page / splashpage
It all running (with the splash page as first H1) here: http://www.locomo.dk

:-) Mads

ZiPs
Posts: 633
Joined: Thu May 22, 2008 6:17 pm
Location: Faxe, Denmark
Contact:

Re: My own url in the menu

Post by ZiPs » Fri Jun 20, 2008 9:04 am

Hey mads

Super it works as you want, I can now see your idea and it really great looking. :D

/ZiPs
Preben Dahl | Webmaster cmsimple.dk | Projekt-og domæne ejer Gert Ebersbach

mads
Posts: 22
Joined: Wed Jun 04, 2008 11:47 pm
Location: Århus Denmark
Contact:

Re: My own url in the menu

Post by mads » Sun Jun 22, 2008 4:21 pm

Hi Zip!

Thanks for the roses!
I'm happy that my intension came through, and you got my point!

Enjoy your day!

:-) Mads

Post Reply