0
Participant
,
/t5/dreamweaver-discussions/include-current-page-name-in-link-address/td-p/1016547
Sep 18, 2006
Sep 18, 2006
Copy link to clipboard
Copied
is there a piece of code I can use to include the current
page name in a link to another folde rwhich contains and mirror
image of the site structure but in a different language?
something like this:
<a href="../english/current-page.php">
That way whenever someone clicks on the link they will go to the right (same-name) page in whichever language they want. If it's possible I can simply add this lineto the template that governs each language an dmy job is done. If it's not possible, I have a long slog ahead of me, typing in each one individually.
Can anyone help?
Cheers
Dave
something like this:
<a href="../english/current-page.php">
That way whenever someone clicks on the link they will go to the right (same-name) page in whichever language they want. If it's possible I can simply add this lineto the template that governs each language an dmy job is done. If it's not possible, I have a long slog ahead of me, typing in each one individually.
Can anyone help?
Cheers
Dave
TOPICS
Server side applications
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
1 Correct answer
Participant
,
Oct 06, 2006
Oct 06, 2006
I owe you an apolgy David,
I couldn't get to the bottom of what was going wrong, so I reconstructed the templates very carefully and included the echo basename($_SERVER['SCRIPT_NAME']) bit that you suggested. It works absolutely perfectly now.
Thanks very much for your help.
Dave
I couldn't get to the bottom of what was going wrong, so I reconstructed the templates very carefully and included the echo basename($_SERVER['SCRIPT_NAME']) bit that you suggested. It works absolutely perfectly now.
Thanks very much for your help.
Dave
LEGEND
,
/t5/dreamweaver-discussions/include-current-page-name-in-link-address/m-p/1016548#M108921
Sep 18, 2006
Sep 18, 2006
Copy link to clipboard
Copied
If you are using PHP, it's a simple matter to include a
language variable on
each page, and then to echo that variable in the link, e.g.,
$language = 'urdu'
....
<a href="../<?php echo($language); ?>/current-page.php">
--
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================
"davecheet" <webforumsuser@macromedia.com> wrote in message
news:eem112$oc5$1@forums.macromedia.com...
> is there a piece of code I can use to include the current page name in a
> link
> to another folde rwhich contains and mirror image of the site structure
> but in
> a different language?
>
> something like this:
>
> <a href="../english/current-page.php">
>
> That way whenever someone clicks on the link they will go to the right
> (same-name) page in whichever language they want. If it's possible I can
> simply
> add this lineto the template that governs each language an dmy job is
> done. If
> it's not possible, I have a long slog ahead of me, typing in each one
> individually.
>
>
> Can anyone help?
>
> Cheers
>
>
> Dave
>
>
>
each page, and then to echo that variable in the link, e.g.,
$language = 'urdu'
....
<a href="../<?php echo($language); ?>/current-page.php">
--
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================
"davecheet" <webforumsuser@macromedia.com> wrote in message
news:eem112$oc5$1@forums.macromedia.com...
> is there a piece of code I can use to include the current page name in a
> link
> to another folde rwhich contains and mirror image of the site structure
> but in
> a different language?
>
> something like this:
>
> <a href="../english/current-page.php">
>
> That way whenever someone clicks on the link they will go to the right
> (same-name) page in whichever language they want. If it's possible I can
> simply
> add this lineto the template that governs each language an dmy job is
> done. If
> it's not possible, I have a long slog ahead of me, typing in each one
> individually.
>
>
> Can anyone help?
>
> Cheers
>
>
> Dave
>
>
>
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
LEGEND
,
/t5/dreamweaver-discussions/include-current-page-name-in-link-address/m-p/1016549#M108922
Sep 18, 2006
Sep 18, 2006
Copy link to clipboard
Copied
Murray *ACE* wrote:
> If you are using PHP, it's a simple matter to include a language variable on
> each page, and then to echo that variable in the link, e.g.,
>
> $language = 'urdu'
> ....
> <a href="../<?php echo($language); ?>/current-page.php">
In addition, you may find this useful:
echo basename($_SERVER['SCRIPT_NAME']);
That gives you the name of the current page.
--
David Powers
Adobe Community Expert
Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
http://foundationphp.com/
> If you are using PHP, it's a simple matter to include a language variable on
> each page, and then to echo that variable in the link, e.g.,
>
> $language = 'urdu'
> ....
> <a href="../<?php echo($language); ?>/current-page.php">
In addition, you may find this useful:
echo basename($_SERVER['SCRIPT_NAME']);
That gives you the name of the current page.
--
David Powers
Adobe Community Expert
Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
http://foundationphp.com/
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
davecheet
AUTHOR
Participant
,
/t5/dreamweaver-discussions/include-current-page-name-in-link-address/m-p/1016561#M108936
Sep 22, 2006
Sep 22, 2006
Copy link to clipboard
Copied
Thanks David,
I added the echo basename($_SERVER['SCRIPT_NAME']); lineto a simple text link at the top of the page and it work perfectly first click.
However, it seems to have affected the menu on every page too, making every item in the menu go other language too.
The menu system I used is a project VII Tree Menu Magic set-up which obviously is affected by this piece of code.
Interestingly, after I removed the ($_SERVER['SCRIPT_NAME'] line from the site, the menu continues to function incorrectly.
Do you have any ideas how I can fix the menu and possible a way to isolate the code in question so that it works but doesn't affect anything else?
Thanks for your help though, it's always hugely appreciated.
Cheers
Dave
I added the echo basename($_SERVER['SCRIPT_NAME']); lineto a simple text link at the top of the page and it work perfectly first click.
However, it seems to have affected the menu on every page too, making every item in the menu go other language too.
The menu system I used is a project VII Tree Menu Magic set-up which obviously is affected by this piece of code.
Interestingly, after I removed the ($_SERVER['SCRIPT_NAME'] line from the site, the menu continues to function incorrectly.
Do you have any ideas how I can fix the menu and possible a way to isolate the code in question so that it works but doesn't affect anything else?
Thanks for your help though, it's always hugely appreciated.
Cheers
Dave
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
LEGEND
,
/t5/dreamweaver-discussions/include-current-page-name-in-link-address/m-p/1016562#M108937
Sep 22, 2006
Sep 22, 2006
Copy link to clipboard
Copied
davecheet wrote:
> I added the echo basename($_SERVER['SCRIPT_NAME']); lineto a simple text link
> at the top of the page and it work perfectly first click.
>
> However, it seems to have affected the menu on every page too, making every
> item in the menu go other language too.
If you put this in a page, you'll see exactly what it does:
<?php echo basename($_SERVER['SCRIPT_NAME']); ?>
It simply displays the name of the file. There is no way that putting
that information in a link could affect other pages too.
> Interestingly, after I removed the ($_SERVER['SCRIPT_NAME'] line from the
> site, the menu continues to function incorrectly.
Sounds like a browser cache problem to me.
--
David Powers
Adobe Community Expert
Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
http://foundationphp.com/
> I added the echo basename($_SERVER['SCRIPT_NAME']); lineto a simple text link
> at the top of the page and it work perfectly first click.
>
> However, it seems to have affected the menu on every page too, making every
> item in the menu go other language too.
If you put this in a page, you'll see exactly what it does:
<?php echo basename($_SERVER['SCRIPT_NAME']); ?>
It simply displays the name of the file. There is no way that putting
that information in a link could affect other pages too.
> Interestingly, after I removed the ($_SERVER['SCRIPT_NAME'] line from the
> site, the menu continues to function incorrectly.
Sounds like a browser cache problem to me.
--
David Powers
Adobe Community Expert
Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
http://foundationphp.com/
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
davecheet
AUTHOR
Participant
,
/t5/dreamweaver-discussions/include-current-page-name-in-link-address/m-p/1016563#M108938
Sep 22, 2006
Sep 22, 2006
Copy link to clipboard
Copied
Okay,
I replaced the entire language folder with a back up and immediately the problem was solved. then I recreated the link but this time putting it as an item within the main menu. The same thing happens. Incidentally it happens in every browser I use IE, Safarai, Firefox, AOL; so I guess it can't be a browser issue
I know I can easliy change things so that the language button takes you back to the homepage for each language but that seems a bit of a cop out.
Should I look at adding the code as an include or something like that?
Cheers
Dave
I replaced the entire language folder with a back up and immediately the problem was solved. then I recreated the link but this time putting it as an item within the main menu. The same thing happens. Incidentally it happens in every browser I use IE, Safarai, Firefox, AOL; so I guess it can't be a browser issue
I know I can easliy change things so that the language button takes you back to the homepage for each language but that seems a bit of a cop out.
Should I look at adding the code as an include or something like that?
Cheers
Dave
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
davecheet
AUTHOR
Participant
,
/t5/dreamweaver-discussions/include-current-page-name-in-link-address/m-p/1016564#M108939
Sep 22, 2006
Sep 22, 2006
Copy link to clipboard
Copied
Iive just quickly looked at it on 3 other machines and the
same happens on each one, so it's not specific to my system either.
Wierd.
Cheers
Dave
Cheers
Dave
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Participant
,
/t5/dreamweaver-discussions/include-current-page-name-in-link-address/m-p/1016565#M108940
Oct 06, 2006
Oct 06, 2006
Copy link to clipboard
Copied
I owe you an apolgy David,
I couldn't get to the bottom of what was going wrong, so I reconstructed the templates very carefully and included the echo basename($_SERVER['SCRIPT_NAME']) bit that you suggested. It works absolutely perfectly now.
Thanks very much for your help.
Dave
I couldn't get to the bottom of what was going wrong, so I reconstructed the templates very carefully and included the echo basename($_SERVER['SCRIPT_NAME']) bit that you suggested. It works absolutely perfectly now.
Thanks very much for your help.
Dave
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
LEGEND
,
LATEST
/t5/dreamweaver-discussions/include-current-page-name-in-link-address/m-p/1016566#M108941
Oct 06, 2006
Oct 06, 2006
Copy link to clipboard
Copied
davecheet wrote:
> I couldn't get to the bottom of what was going wrong, so I reconstructed the
> templates very carefully and included the echo
> basename($_SERVER['SCRIPT_NAME']) bit that you suggested. It works absolutely
> perfectly now.
Glad to hear you finally got it sorted. Often it's a tiny mistake that
causes something to go wrong. Sometimes it's faster to start from
scratch than look for that tiny needle in a haystack.
--
David Powers
Adobe Community Expert
Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
http://foundationphp.com/
> I couldn't get to the bottom of what was going wrong, so I reconstructed the
> templates very carefully and included the echo
> basename($_SERVER['SCRIPT_NAME']) bit that you suggested. It works absolutely
> perfectly now.
Glad to hear you finally got it sorted. Often it's a tiny mistake that
causes something to go wrong. Sometimes it's faster to start from
scratch than look for that tiny needle in a haystack.
--
David Powers
Adobe Community Expert
Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
http://foundationphp.com/
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Explorer
,
/t5/dreamweaver-discussions/include-current-page-name-in-link-address/m-p/1016550#M108923
Sep 18, 2006
Sep 18, 2006
Copy link to clipboard
Copied
I put a tutorial on my PHP site about how to do this:
http://www.php-newbie.com/index.php?option=com_content&task=view&id=17&Itemid=26
http://www.php-newbie.com/index.php?option=com_content&task=view&id=17&Itemid=26
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Explorer
,
/t5/dreamweaver-discussions/include-current-page-name-in-link-address/m-p/1016551#M108924
Sep 18, 2006
Sep 18, 2006
Copy link to clipboard
Copied
I put a tutorial on my PHP site about how to do this:
http://www.php-newbie.com/index.php?option=com_content&task=view&id=17&Itemid=26
http://www.php-newbie.com/index.php?option=com_content&task=view&id=17&Itemid=26
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Explorer
,
/t5/dreamweaver-discussions/include-current-page-name-in-link-address/m-p/1016552#M108925
Sep 18, 2006
Sep 18, 2006
Copy link to clipboard
Copied
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Explorer
,
/t5/dreamweaver-discussions/include-current-page-name-in-link-address/m-p/1016553#M108926
Sep 18, 2006
Sep 18, 2006
Copy link to clipboard
Copied
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Explorer
,
/t5/dreamweaver-discussions/include-current-page-name-in-link-address/m-p/1016554#M108927
Sep 18, 2006
Sep 18, 2006
Copy link to clipboard
Copied
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Explorer
,
/t5/dreamweaver-discussions/include-current-page-name-in-link-address/m-p/1016555#M108928
Sep 18, 2006
Sep 18, 2006
Copy link to clipboard
Copied
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Explorer
,
/t5/dreamweaver-discussions/include-current-page-name-in-link-address/m-p/1016556#M108929
Sep 18, 2006
Sep 18, 2006
Copy link to clipboard
Copied
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Explorer
,
/t5/dreamweaver-discussions/include-current-page-name-in-link-address/m-p/1016557#M108930
Sep 18, 2006
Sep 18, 2006
Copy link to clipboard
Copied
sorry about all those links. the forum is under maintainance,
and i will remove the duplicates as soon as i can get in.
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
LEGEND
,
/t5/dreamweaver-discussions/include-current-page-name-in-link-address/m-p/1016558#M108931
Sep 18, 2006
Sep 18, 2006
Copy link to clipboard
Copied
Don't bother. You cannot remove them.
--
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================
"forumnotifier" <webforumsuser@macromedia.com> wrote in message
news:eemkdi$ive$1@forums.macromedia.com...
> sorry about all those links. the forum is under maintainance, and i will
> remove the duplicates as soon as i can get in.
--
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================
"forumnotifier" <webforumsuser@macromedia.com> wrote in message
news:eemkdi$ive$1@forums.macromedia.com...
> sorry about all those links. the forum is under maintainance, and i will
> remove the duplicates as soon as i can get in.
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Explorer
,
/t5/dreamweaver-discussions/include-current-page-name-in-link-address/m-p/1016559#M108933
Sep 18, 2006
Sep 18, 2006
Copy link to clipboard
Copied
sorry about the 8 duplicate posts. adobe is having some
issues right now.
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
LEGEND
,
/t5/dreamweaver-discussions/include-current-page-name-in-link-address/m-p/1016560#M108935
Sep 18, 2006
Sep 18, 2006
Copy link to clipboard
Copied
You mean as opposed to the standard boring issues they have
with the
webforum? 8)
--
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================
"digitalus media" <webforumsuser@macromedia.com> wrote in message
news:eempjh$p50$1@forums.macromedia.com...
> sorry about the 8 duplicate posts. adobe is having some issues right now.
webforum? 8)
--
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================
"digitalus media" <webforumsuser@macromedia.com> wrote in message
news:eempjh$p50$1@forums.macromedia.com...
> sorry about the 8 duplicate posts. adobe is having some issues right now.
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

