Page 1 of 2
Anchors in Articles
Posted: Fri 27. Aug 2004, 06:19
by macangelo
Hi
PHPWCMS has been great since I know it. It is improving rapidly. I have a request that is somehow like a nostalgic feature of the old plain html days. Who needs it when you have a cms with articles, content parts and so on? - I'm talking about anchors.
Well, I have a client who is running a portal for expats in Germany - promoting her new book and hosting events, information and so on. Her articles are pretty long some time and she is longing for a way to structure them. ( e.g.
http://www.vitalissues-germany.com/inde ... _president )
Is there a chance? Thanks a lot!
Macangelo
Posted: Fri 27. Aug 2004, 08:03
by brans
you could use hidden tables and open them up via javascript (like used on:
http://www.counter-strike.ch look for: "Lineup Lanfan - mBs" and click on it)
a link to the top of the page is easily created through:
[TOP]{IMAGE:top_link_.gif}[/Top]
or [TOP]YOURTEXT[/TOP]
Posted: Fri 27. Aug 2004, 15:30
by pSouper
For an inter-article anchor you can use {A:AnchorName} then call it from anywhere in the article with [INT #AnchorName]go to anchor[/INT]
Not sure of any 'pan-article' anchoring or JUMP to ANCHOR.
There is a JUMP to article thing somewhere but I am not sure if you can parse an achor name to it though.
Posted: Fri 27. Aug 2004, 19:16
by tyr
worked just fine -- the achnor was added correctly. However,
did not work for me -- no hyperlink was formed.
Posted: Fri 27. Aug 2004, 19:24
by pSouper
they must both be in the same article to work: just like top/bottom etc
They probably should be case sensitive case too (I only mention this becaue you exapmle is not)
it does work for me so must be valid

Posted: Sat 28. Aug 2004, 08:51
by macangelo
Thanks y'all
What I tried so far is - the link:
Code: Select all
[ID comm_president#overseas2004]Voting from Overseas in 2004[/ID]
with comm_president beeing the alias of the article and overseas2004 the anchor name.
The anchor is:
which is in a different content part (is that the problem?)
the problem is: the ID-replacemt-tag is not replaced - it is displayed as put into the article in the backend - but: when I delete the part #overseas2004 it works.
Thank you all for your support
Macangelo
Posted: Sat 28. Aug 2004, 09:00
by pSouper
That's your problem

and haveing read my
For an inter-article anchor
&
they must both be in the same article to work: just like top/bottom
you knew this

it is always good to see 'experimentation' but it's better from a working start point

Posted: Sat 28. Aug 2004, 09:02
by macangelo
Thanks pSouper!
just to make sure: same article but different content part does not work?
Macangelo
Posted: Sat 28. Aug 2004, 09:09
by macangelo
I just tried the same thing in the same content part. Does not work either.
any ideas?
Macangelo
Posted: Sat 28. Aug 2004, 09:10
by pSouper
yup: different contents part within the article is fine.
once a page is processed by phpWCMS it is effectivly sent to the browser as a single HTML page. this means that in theory (untested by me) you can also use Anchors in the template and link to them from any article that uses that temple.
e.g: somewhere in the right you may use an anchor and for every article that uses that structure/template you can use a link to that anchor.
Posted: Sat 28. Aug 2004, 09:19
by macangelo
Ok, but do you have an Idea why my Link + anchor do not work? - (I would prefer to edit anchor an link in the article so that the user can do it...)
Thanks a lot
Macangelo
Posted: Sat 28. Aug 2004, 09:42
by pSouper
SORRY: my fault, I was drunk, possessed by drunk deamons & being internally expored by aliens at the time of writing my first post
it should be..
{A: myAnchor} called by [INT #myAnchor]go to my anchor[/INT]
Posted: Sat 28. Aug 2004, 10:35
by macangelo
Hi pSouper,
you deserve an another drink - it works! At least - it jumps - but not where it is supposed to be! The problem might be: my
Code: Select all
[INT #overseas2004]go to my anchor[/INT]
shows, when parsed, a target="_top":
<a href="#overseas2004" target="_top">
Where the hell does that come from?
Thanks a lot!
Macangelo
Posted: Sat 28. Aug 2004, 10:45
by pSouper
The just goes to where you place the anchor: no text is visible to indicate this, it just jumps there.
try it out on a very long article: place an anchor in the middle so that the top of the page is NOT visible then set the [INT] at top pf the page -if the page jumps down it works fine: if not then the _top is taking presidence and makes this all useless
not sure about the _top (it is in the reptag)
i could write you a new reptag if you like but it you would need to re-insert it with every update.
Posted: Sat 28. Aug 2004, 10:56
by macangelo
Thanks for the offer - I'm not sure that's the reason
I made the browser window smaller so the anchor is no longer visible.
I replaced the INT-replacement-tag with
Code: Select all
<a href="#overseas2004">Voting from Overseas in 2004</a><br>
<a href="#uselection">U.S. PRESIDENTIAL ELECTION</a><br>
it jumps allways to the same place. Something seems to be screwed up!
Check it out:
http://www.vitalissues-germany.com/inde ... _president
the first 2 links below the title...