Problem mit Ankern

Hier bekommst Du deutschsprachigen Support. Keine Fehlermeldungen oder Erweiterungswünsche bitte!
Post Reply
User avatar
Marceau
Posts: 201
Joined: Sun 23. Apr 2006, 01:52
Location: Leipzig, Germany
Contact:

Problem mit Ankern

Post by Marceau »

Hallo Freunde der Sonne!

Mir ist aufgefallen, dass meine Anker nicht mehr gehen.
Sie verlinken seit neuesten nur noch auf http://www.example.com/#top obwohl ich mich auf einer Unterseite befinde. Habe ich irgendwas übersehen in der config?

Liebe Grüße


p.s. verwendetes release: 1.5.4 r488
There are 10 types of people in the world: Those who understand binary and those who don't
pepe
Posts: 3954
Joined: Mon 19. Jan 2004, 13:46

Re: Problem mit Ankern

Post by pepe »

MIT oder OHNE mod_rewrite?
User avatar
Marceau
Posts: 201
Joined: Sun 23. Apr 2006, 01:52
Location: Leipzig, Germany
Contact:

Re: Problem mit Ankern

Post by Marceau »

Mit mod_rewrite
There are 10 types of people in the world: Those who understand binary and those who don't
pepe
Posts: 3954
Joined: Mon 19. Jan 2004, 13:46

Re: Problem mit Ankern

Post by pepe »

Schalte mal mod_rewrite ab... und wie sieht's dann aus?
User avatar
Oliver Georgi
Site Admin
Posts: 9889
Joined: Fri 3. Oct 2003, 22:22
Contact:

Re: Problem mit Ankern

Post by Oliver Georgi »

Rewrite aktiviert den Base Href Meta Tag. Für Anker sollte man sich angewöhnen, auch wirklich die betreffende Unterseite anzusprechen. Also statt nur #anker > index.php?alias#anker.
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn | Систрон
User avatar
Marceau
Posts: 201
Joined: Sun 23. Apr 2006, 01:52
Location: Leipzig, Germany
Contact:

Re: Problem mit Ankern

Post by Marceau »

Dann melde ich mich nochmal zu Wort.

Bei mir speziell geht es um den "Top-Anker", also der der meine Seite nach oben springen lässt.

@pepe Wenn ich mod_rewrite ausschalte wird der Anker immernoch zu example.com/#top verlinkt
@Oliver wenn ich richtig verstehe was du meinst, soll ich jetzt <base href="[PHP]echo $_SERVER['REQUEST_URI'];[/PHP]"> in meinen HTML-Kopf schreiben!?


p.s. Das funktioniert das im übrigen auch, aber sieht irgendwie unschön aus....
There are 10 types of people in the world: Those who understand binary and those who don't
User avatar
Oliver Georgi
Site Admin
Posts: 9889
Joined: Fri 3. Oct 2003, 22:22
Contact:

Re: Problem mit Ankern

Post by Oliver Georgi »

Base Href wird bereits automatisch vom System generiert. Einfach mal die HTML Source anschauen.

Und für den Toplink einen Replacer nutzen, wenn es nicht anders geht. Ich würde es aber mit JavaScript abfangen. Werde aber dort noch etwas Arbeit investieren.
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn | Систрон
User avatar
Marceau
Posts: 201
Joined: Sun 23. Apr 2006, 01:52
Location: Leipzig, Germany
Contact:

Re: Problem mit Ankern

Post by Marceau »

Du hast Recht, der Base-HREF steht schon drin <base href="www.example.com"> allerdings funktioniert es dann nicht...
Für den Top-Link habe ich den Replacer [TOP]...[/TOP] verwendet... :/
There are 10 types of people in the world: Those who understand binary and those who don't
User avatar
Oliver Georgi
Site Admin
Posts: 9889
Joined: Fri 3. Oct 2003, 22:22
Contact:

Re: Problem mit Ankern

Post by Oliver Georgi »

…ich schaue es mir die Tage an.
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn | Систрон
User avatar
Marceau
Posts: 201
Joined: Sun 23. Apr 2006, 01:52
Location: Leipzig, Germany
Contact:

Re: Problem mit Ankern

Post by Marceau »

Alles klar. Danke schon mal im Voraus
There are 10 types of people in the world: Those who understand binary and those who don't
pepe
Posts: 3954
Joined: Mon 19. Jan 2004, 13:46

Re: Problem mit Ankern

Post by pepe »

Ich hatte doch schon vor ein paar Tagen bezüglich des TOP-Links von OG eine Lösung erhalten,
die bei mir wunderbar funktioniert :D

http://forum.phpwcms.org/viewtopic.php?p=135523#p135523

SO hab ich meine Datei rt_top-link_replace.php jetzt im frontend_render-Ordner stehen:

Code: Select all

<?php
// -----------------------------------------------------------------------------
// TOP-Link den "neueren" phpwcms-Versionen "angepassen"
// -----------------------------------------------------------------------------

// -----------------------------------------------------------------------------
// obligate check for phpwcms constants
   if (!defined('PHPWCMS_ROOT')) {
      die("You Cannot Access This Script Directly, Have a Nice Day.");}
// -----------------------------------------------------------------------------
 
   $content['all'] = str_replace('"#top"', '"'.$_SERVER['REQUEST_URI'].'#top"', $content['all']);
?>
User avatar
Marceau
Posts: 201
Joined: Sun 23. Apr 2006, 01:52
Location: Leipzig, Germany
Contact:

Re: Problem mit Ankern

Post by Marceau »

Danke pepe, so habe ich es vorerst auch gelöst!

Grüße!
There are 10 types of people in the world: Those who understand binary and those who don't
Post Reply