[SOLVED] Problems using Anchor Link tags

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
CapereSpiritum
Forum Members
Forum Members
Posts: 223
Joined: Wed Dec 28, 2011 12:11 pm

[SOLVED] Problems using Anchor Link tags

Post by CapereSpiritum »

Hi

I am trying to add a link to a footer with a named anchor.

The page I'm linking to is called index.php?page=FAQ
The anchor is secure
I have adde this at the appropriate place on the page <a name="#secure"></a>

The link in the footer has the text 'Secure Online Purchase'.

I cannot fathom how to add {anchor anchor='secure' text='Secure Online Purchase'} to the <a> tag...

Looked in the past posts, sorry it escapes me...
???
Last edited by CapereSpiritum on Wed Aug 29, 2012 11:10 am, edited 1 time in total.
gianpiero
Forum Members
Forum Members
Posts: 221
Joined: Sun Jan 07, 2007 4:32 pm

Re: Problems using Anchor Link tags

Post by gianpiero »

CapereSpiritum
Forum Members
Forum Members
Posts: 223
Joined: Wed Dec 28, 2011 12:11 pm

Re: Problems using Anchor Link tags

Post by CapereSpiritum »

Hi gianpiero

I'd seen that and inserted the following.

LINK HTML = <a href="/index.php?page=FAQ#secure">Secure Online Purchase</a>

ANCHOR HTML = {anchor anchor='secure' text='Is Your Website Secure'}
Also tried <a name="{anchor anchor='secure' text='Is Your Website Secure'}"></a> 'which does throw up an 'anchor' in WYSIWYG mode but with a visible ">.

None of the above does more than arrive at the FAQ page. They don't find the anchor...!

I know it's just my syntax, but I just can't get it right...
User avatar
Jo Morg
Dev Team Member
Dev Team Member
Posts: 1973
Joined: Mon Jan 29, 2007 4:47 pm

Re: Problems using Anchor Link tags

Post by Jo Morg »

CapereSpiritum wrote:Hi gianpiero

I'd seen that and inserted the following.

LINK HTML = <a href="/index.php?page=FAQ#secure">Secure Online Purchase</a>

ANCHOR HTML = {anchor anchor='secure' text='Is Your Website Secure'}
Also tried <a name="{anchor anchor='secure' text='Is Your Website Secure'}"></a> 'which does throw up an 'anchor' in WYSIWYG mode but with a visible ">.

None of the above does more than arrive at the FAQ page. They don't find the anchor...!

I know it's just my syntax, but I just can't get it right...
You have seen but not read properly ;)
It's not the syntax but how you are using it...
anchor tag
Purpose

The anchor tag makes a proper anchor link to an anchor on the same page
How to use?

Insert the tag into your template/page like:

Code: Select all

    {anchor anchor='here' text='Scroll Down'}
In the pagesource you will get:

Code: Select all

<a href="/path/to/current/page#here">Scroll Down</a>
An anchor is created using the <a> tag.
If you want to create an anchor called here, you simply add this line where you want the anchor to be:

Code: Select all

<a name="here"></a> 
HTH
"There are 10 types of people in this world, those who understand binary... and those who don't."
* by the way: English is NOT my native language (sorry for any mistakes...).
Code of Condut | CMSMS Docs | Help Support CMSMS
My developer Page on the Forge
GeekMoot 2015 in Ghent, Belgium: I was there!
GeekMoot 2016 in Leicester, UK: I was there!
DevMoot 2023 in Cynwyd, Wales: I was there!
CapereSpiritum
Forum Members
Forum Members
Posts: 223
Joined: Wed Dec 28, 2011 12:11 pm

Re: Problems using Anchor Link tags

Post by CapereSpiritum »

Hmmm, does that mean I can't have a link outside the page containing the anchor?

i.e. the link I'm trying to set up is in the footer global content block and so will appear on every page.

The anchor is on FAQ...
gianpiero
Forum Members
Forum Members
Posts: 221
Joined: Sun Jan 07, 2007 4:32 pm

Re: Problems using Anchor Link tags

Post by gianpiero »

jo morg explained well ;)

I put anchors this way:

1) position the mouse where I need the anchor is, and define it

Code: Select all

<a name="name_of_anchor"></a>

text between a and a is not needed

2) Select the text that you want to call the anchor and define link

Code: Select all

<a href="path_and_name_of_page#name_of_anchor">test calling anchor</a>
hi
thanks to jo morg
gianpiero
Forum Members
Forum Members
Posts: 221
Joined: Sun Jan 07, 2007 4:32 pm

Re: Problems using Anchor Link tags

Post by gianpiero »

CapereSpiritum wrote:Hmmm, does that mean I can't have a link outside the page containing the anchor?
yes you can, add the path before,

or absolute path that open new window
User avatar
Jo Morg
Dev Team Member
Dev Team Member
Posts: 1973
Joined: Mon Jan 29, 2007 4:47 pm

Re: Problems using Anchor Link tags

Post by Jo Morg »

gianpiero wrote:
CapereSpiritum wrote:Hmmm, does that mean I can't have a link outside the page containing the anchor?
yes you can, add the path before,

or absolute path that open new window
Precisely. You just don't use the tag {anchor anchor='here' text='Scroll Down'} from a different page AFAIK...
"There are 10 types of people in this world, those who understand binary... and those who don't."
* by the way: English is NOT my native language (sorry for any mistakes...).
Code of Condut | CMSMS Docs | Help Support CMSMS
My developer Page on the Forge
GeekMoot 2015 in Ghent, Belgium: I was there!
GeekMoot 2016 in Leicester, UK: I was there!
DevMoot 2023 in Cynwyd, Wales: I was there!
CapereSpiritum
Forum Members
Forum Members
Posts: 223
Joined: Wed Dec 28, 2011 12:11 pm

Re: [SOLVED] Problems using Anchor Link tags

Post by CapereSpiritum »

Thanks for the help guys.
All sorted with:
Link = <a href="index.php?page=FAQ#secure">Secure Online Purchase</a>
Anchor = <a name="secure"></a>
Post Reply

Return to “CMSMS Core”