Problems with anchor tags on generated pages like News
Problems with anchor tags on generated pages like News
There would appear to be a problem with anchor tags on generated pages like News or Album
Check out this news index page and look at the 'Top' anchor link in the footer - OK...
http://www.cms.shoesforindustry.net/cmsmodules/news/
Now click on an Article to view the atricle in detail and then look at the 'Top' anchor in the footer, which of course remains the same. This applies to the anchor tags as well. It seems to make no difference if you use 'pagealias' either...
Any ideas?
Russ
Check out this news index page and look at the 'Top' anchor link in the footer - OK...
http://www.cms.shoesforindustry.net/cmsmodules/news/
Now click on an Article to view the atricle in detail and then look at the 'Top' anchor in the footer, which of course remains the same. This applies to the anchor tags as well. It seems to make no difference if you use 'pagealias' either...
Any ideas?
Russ
Re: Problems with anchor tags on generated pages like News
Use a relative URL:
Code: Select all
<a href="#content" title="Jump to top of page" class="noprint">Top</a>
Re: Problems with anchor tags on generated pages like News
Thanks for the suggestion mahjong, but I'm using clean url's and hence the {metadata} tag in my template, (at least I think it was to correct the image locations...) which sets a base tag. Can anyone remember if this was the sole reason for the {metadata} tag????:
This puts stuff before the relative href, so even is I set:
I actually get (as expected)
I've tried removing this on my local copy, (the metadata tag), and the anchors are now OK, but the path to images fail. The one's inserted via FCKeditor?
Here is FCKeditors stuff...
It should be etc. surely. Now is this the only reason for the metadata tag or are there others. If it is just this then I guess we can alter FCKEditor.
When I correct the path - they show up and work on the website but not in FCKeditor... arggh...
Any other suggestions?
Russ
Code: Select all
<base href="http://macweb/cms/" />
Code: Select all
<a href="#content" title="Jump to top of page" >Top</a>
Code: Select all
<a href="http://www.cms.shoesforindustry.net/home/#content" title="Jump to top of page">Top</a>
Here is FCKeditors stuff...
Code: Select all
<a title="A Sheep" href="uploads/images/404sheep/sheep2.jpg">
<img width="96" height="64" alt="Sheep" title="Some Sheep" src="uploads/images/404sheep/thumb_sheep2.jpg" /></a>
Code: Select all
'../uploads/images/404sheep/sheep2.jpg"
When I correct the path - they show up and work on the website but not in FCKeditor... arggh...
Any other suggestions?
Russ
Re: Problems with anchor tags on generated pages like News
i'm thinking it's from the news showing up on top of the page, sort of, and so the basic stucture hasn't changed hence it takes you back to the page you came from... if you need a top link for long articles you could put a top link in the news detail template...
- Elijah Lofgren
- Power Poster
- Posts: 811
- Joined: Mon Apr 24, 2006 1:01 am
- Location: Deatsville, AL
Re: Problems with anchor tags on generated pages like News
In CMSMS 1.0-svn an "anchor" tag/plugin has been added which gives a solution to this problem introduced by using the metadata tag.Russ wrote: There would appear to be a problem with anchor tags on generated pages like News or Album
Check out this news index page and look at the 'Top' anchor link in the footer - OK...
http://www.cms.shoesforindustry.net/cmsmodules/news/
Now click on an Article to view the atricle in detail and then look at the 'Top' anchor in the footer, which of course remains the same. This applies to the anchor tags as well. It seems to make no difference if you use 'pagealias' either...
Any ideas?
Russ
I have attached a file called "function.anchor.php.txt" which you can download, rename to "function.anchor.php" and then copy into your "plugins" folder.
Then from the help:
For your case you'd probably want to call it like this:How do I use it?
Just insert the tag into your template/page like: {anchor anchor='here' text='Scroll Down'}
Code: Select all
{anchor anchor='content' text='Top'}

[attachment deleted by admin]
Note: I don't have time to take on any more projects. I'm quite busy. I may be too busy to reply to emails or messages. Thanks for your understanding. 

Re: Problems with anchor tags on generated pages like News
does this work in 0.13-beta4 "Canary"....
- Elijah Lofgren
- Power Poster
- Posts: 811
- Joined: Mon Apr 24, 2006 1:01 am
- Location: Deatsville, AL
Re: Problems with anchor tags on generated pages like News
I just tested it with CMSMS 0.13 and it works fine. That means it should also work with 0.13-beta4 since they likely handly plugins/tags the same way.mark wrote: does this work in 0.13-beta4 "Canary"....
Note: I don't have time to take on any more projects. I'm quite busy. I may be too busy to reply to emails or messages. Thanks for your understanding. 

Re: Problems with anchor tags on generated pages like News
Thanks Elijah, save's me writing one myself
Well actually I needed a few more features so attached is a revised version 1.1 which has the ability to include a class, a title and a tabindex for the anchor. (Sometimes I use it in a menu for skip to contents and skip to sub menu type of links as well as in the footer. )
Hope this helps, I've no access to SVN at work.
Just out of curiosity, why was the ordinary cms self link not altered?
Russ
[attachment deleted by admin]

Hope this helps, I've no access to SVN at work.
Just out of curiosity, why was the ordinary cms self link not altered?
Russ
[attachment deleted by admin]
Re: Problems with anchor tags on generated pages like News
Russ,
Your amendments are added to svn. Thanks!
And as for the exercise Calguy gave me, glad you did that before me.
Too much to do with finishing up the new default templates for 1.0 anyway... 
Your amendments are added to svn. Thanks!
And as for the exercise Calguy gave me, glad you did that before me.

