Using cms_selflink to link to an anchor on another page

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.
Locked
cyberman

Re: Using cms_selflink to link to an anchor on another page

Post by cyberman »

hmm, what have you done - this works for me (v0.13):
{cms_selflink dir="anchor" page="aboutme" anchorlink="#location" text="613 N. Broadway, Suite E, Pittsburg, KS 67662" label="How to find us: "}
But attribute text does not support html tags like
.
cyberman

Re: Using cms_selflink to link to an anchor on another page

Post by cyberman »

Tygger2512 wrote: Am I just not understanding the syntax
Think so  8) ... that

Code: Select all

<div id="location">
is not an anchor, but that

Code: Select all

<a name="location">test</a>
What have I done to get an anchor:

1. I've set a page with "aboutme" in page alias.
2. I put this inside

Code: Select all

<a name="location">test</a>
3. I've set now a second page "test 2"
4. There I've put this inside

Code: Select all

{cms_selflink dir="anchor" page="aboutme" anchorlink="#location" text="613 N. Broadway, Suite E, Pittsburg, KS 67662" label="How to find us: "}
or

Code: Select all

{cms_selflink dir="anchor" page="aboutme" anchorlink="#location" text="613 N. Broadway, Suite E, Pittsburg, KS 67662" title="How to find us: "}
And it works ... if you wanna only set an anchor to current page you don't need the page attribute.
cyberman

Re: Using cms_selflink to link to an anchor on another page

Post by cyberman »

You were right - you can make only a link to page or a page internal anchor  :-\. Please look at help file
Note! Only one of the above may be used in the same cms_selflink statement!!
Think this have nothing to do with pretty_urls or other config.php options ...
cyberman

Re: Using cms_selflink to link to an anchor on another page

Post by cyberman »

For an internal page anchor please try to kill the page parameter ...
kendo451

Your test has a problem

Post by kendo451 »

Not sure that you are/were aware that CMS selflink chops out the page content above the anchor.

Your test page does not have enough content in it to test properly.  Make a full page with several anchors and a list of self-links to the anchors at the top of the content block.

You will see that in both Firefox and IE CMSMS chops the content above the anchor. ( I am using CMSMS version 1.1.2)  I'm not sure if this is a bug or on purpose.

Ken
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: Using cms_selflink to link to an anchor on another page

Post by Dr.CSS »

You do have the {metadata} tag in the ?...

I put mine right after {metadata}  this should give you a
Locked

Return to “CMSMS Core”