In Message Anchor

Author
APGvNext Sam
vNext Owner
  • Total Posts : 12842
  • Joined: 2001/05/23 00:00:00
  • Status: offline
2008/09/18 11:10:44 (permalink) PGDCode
0

In Message Anchor

You can create anchors in post when you post instructions or articles that are very long. Users will be able to jump to the desired section of your article without having to manually scroll or use Ctrl-F to locate sections.

We will need 2 separate PGDCode's to achieve this, one for marking anchors in post and the other for adding the link to jump to the anchor.

The PGDCodes:

1. Marking an anchor

Pattern:
\[anchor\=(\w+)\]

Replace With:
<span id="$1" style="visibility:hidden;"></span>

Purpose: Mark an anchor for your document
Example: [anchor=Name of Anchor]
Begin Tag: [anchor=anchor_name
End Tag: ]
Show on Popup, ECMAScript Compliant, Ignore Case checked.

2. Link to go to an anchor

Pattern: 
\[(goto)\=(\w+)\](.+?)\[\/\1\]

Replace With:
<a href="#$2">$3</a> 

Purpose: Create link to go to an anchor
Example: [goto=Name Of Anchor]Go to the anchor[/goto]
Begin Tag: [goto=anchor_name]
End Tag: [/goto]
Show on Popup, ECMAScript Compliant, Ignore Case checked.

When you mark an anchor, you don't have to surround any text. Just focus your cursor where you want the anchor to be set at and insert the PGDCode.

Example:

Click here to go to the beginning of the PGDCodes
#1

0 Replies Related Threads

    Jump to:
    © 2014 APG vNext Commercial Version 5.0