Anchors in Articles

Use GitHub to post feature requests for phpwcms.
macangelo
Posts: 756
Joined: Sat 29. Nov 2003, 14:19
Location: Düsseldorf
Contact:

Anchors in Articles

Post 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
Webdesign from Düsseldorf - made with phpwcms (most of it):
http://eyelikeit.com/index.php?de_beispiele-webdesign
brans

Post 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]
Last edited by brans on Fri 27. Aug 2004, 15:40, edited 2 times in total.
User avatar
pSouper
Posts: 1552
Joined: Tue 11. Nov 2003, 15:45
Location: London
Contact:

Post 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.
Last edited by pSouper on Sat 28. Aug 2004, 09:41, edited 2 times in total.
tyr
Posts: 31
Joined: Tue 9. Dec 2003, 04:36
Location: Pennsylvania, USA

Post by tyr »

Code: Select all

{A:AnchorName}
worked just fine -- the achnor was added correctly. However,

Code: Select all

[ID #Anchorname]go to anchor[/ID]
did not work for me -- no hyperlink was formed.
User avatar
pSouper
Posts: 1552
Joined: Tue 11. Nov 2003, 15:45
Location: London
Contact:

Post 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 :D
macangelo
Posts: 756
Joined: Sat 29. Nov 2003, 14:19
Location: Düsseldorf
Contact:

Post 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:

Code: Select all

{A:#overseas2004}
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
Webdesign from Düsseldorf - made with phpwcms (most of it):
http://eyelikeit.com/index.php?de_beispiele-webdesign
User avatar
pSouper
Posts: 1552
Joined: Tue 11. Nov 2003, 15:45
Location: London
Contact:

Post 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 :)
macangelo
Posts: 756
Joined: Sat 29. Nov 2003, 14:19
Location: Düsseldorf
Contact:

Post by macangelo »

Thanks pSouper!

just to make sure: same article but different content part does not work?

Macangelo
Webdesign from Düsseldorf - made with phpwcms (most of it):
http://eyelikeit.com/index.php?de_beispiele-webdesign
macangelo
Posts: 756
Joined: Sat 29. Nov 2003, 14:19
Location: Düsseldorf
Contact:

Post by macangelo »

I just tried the same thing in the same content part. Does not work either.

any ideas?

Macangelo
Webdesign from Düsseldorf - made with phpwcms (most of it):
http://eyelikeit.com/index.php?de_beispiele-webdesign
User avatar
pSouper
Posts: 1552
Joined: Tue 11. Nov 2003, 15:45
Location: London
Contact:

Post 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.
macangelo
Posts: 756
Joined: Sat 29. Nov 2003, 14:19
Location: Düsseldorf
Contact:

Post 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
Webdesign from Düsseldorf - made with phpwcms (most of it):
http://eyelikeit.com/index.php?de_beispiele-webdesign
User avatar
pSouper
Posts: 1552
Joined: Tue 11. Nov 2003, 15:45
Location: London
Contact:

Post 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]
macangelo
Posts: 756
Joined: Sat 29. Nov 2003, 14:19
Location: Düsseldorf
Contact:

Post 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
Webdesign from Düsseldorf - made with phpwcms (most of it):
http://eyelikeit.com/index.php?de_beispiele-webdesign
User avatar
pSouper
Posts: 1552
Joined: Tue 11. Nov 2003, 15:45
Location: London
Contact:

Post 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.
macangelo
Posts: 756
Joined: Sat 29. Nov 2003, 14:19
Location: Düsseldorf
Contact:

Post 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...
Webdesign from Düsseldorf - made with phpwcms (most of it):
http://eyelikeit.com/index.php?de_beispiele-webdesign
Locked