^Top link at the bottom of the page
^Top link at the bottom of the page
Hi,
how I can replace the ^Top link at the bottom of the page with an image?
Thanks . . . .
how I can replace the ^Top link at the bottom of the page with an image?
Thanks . . . .
Re: ^Top link at the bottom of the page
I think you could just replace the smarty markup with plain old html
{anchor anchor='main' text='^ Top'}
Kevin
{anchor anchor='main' text='^ Top'}
Kevin
Re: ^Top link at the bottom of the page
Not sure if that will work
...
{anchor anchor='main' text=''}
Maybe " must be masked. Not tried yet.

{anchor anchor='main' text=''}
Maybe " must be masked. Not tried yet.
Re: ^Top link at the bottom of the page
Hi cyberman,
thanks, it works
thanks, it works

Re: ^Top link at the bottom of the page
Both will work. But you'll need to deal with the templating engine doing more work for something that can just be plain HTML. For a simple little tag like that you probably won't notice a difference unless you have a really high traffic site and then PHP and MySQL will probably get crushed long before Smarty takes a dive.
Warning, unrealistic and stupid test ahead....
When I changed my template and did a quick test of adding 310 of those links I saw a .01 second speed increase in using plain HTML versus Smarty markup.
That was with a really scientific test... 310 links happened to be how many times I copied and pasted. I applied the changes to the template using Smarty markup, reloaded the page several times, never getting below .16xxx seconds. Then I applied the changes to the template using plain HTML and reloaded the page several times, staying in the high .14xxx and low .15xxx time frame.
Mind you I only did that to see if there was a difference, there is, but it's so small it's all going to get down to personal preference. I prefer plain HTML as it's easier to read the template.
Warning, unrealistic and stupid test ahead....
When I changed my template and did a quick test of adding 310 of those links I saw a .01 second speed increase in using plain HTML versus Smarty markup.
That was with a really scientific test... 310 links happened to be how many times I copied and pasted. I applied the changes to the template using Smarty markup, reloaded the page several times, never getting below .16xxx seconds. Then I applied the changes to the template using plain HTML and reloaded the page several times, staying in the high .14xxx and low .15xxx time frame.
Mind you I only did that to see if there was a difference, there is, but it's so small it's all going to get down to personal preference. I prefer plain HTML as it's easier to read the template.
Re: ^Top link at the bottom of the page
Must be (note the "#"):nivekiam wrote: I think you could just replace the smarty markup with plain old html
{anchor anchor='main' text='^ Top'}
Kevin
Code: Select all
<p><a href="#main" title="top"><img src=/path/to/image"></a>
I'd prefer plain HTML, too. Correct me if I'm wrong, but IMO it absolutely makes no sense using smarty here.
Cheers,
Alex
Last edited by faglork on Fri Jan 11, 2008 9:32 am, edited 1 time in total.
Re: ^Top link at the bottom of the page
True. Thanks. The haste of typing and not testing...
I don't understand why Smarty is used there either. The name "main" still has to be specified so it's not like some magical tag you put in there and it's dynamically getting the anchor's name so if you change the name of the anchor at the top, it will automatically update all references to it.
I don't understand why Smarty is used there either. The name "main" still has to be specified so it's not like some magical tag you put in there and it's dynamically getting the anchor's name so if you change the name of the anchor at the top, it will automatically update all references to it.
Re: ^Top link at the bottom of the page
Aaaah, I think I got it ...
if you use the plain href solution, it will not work with the normal installation since a base href is inserted as soon as you use {metadata}.
The base href refers to the domain, so a simple #main will always lead to the top of the HOMEPAGE.
I have not tested this. Anyone?
Cheers,
Alex
if you use the plain href solution, it will not work with the normal installation since a base href is inserted as soon as you use {metadata}.
The base href refers to the domain, so a simple #main will always lead to the top of the HOMEPAGE.
I have not tested this. Anyone?
Cheers,
Alex
Last edited by faglork on Fri Jan 11, 2008 11:14 pm, edited 1 time in total.
Re: ^Top link at the bottom of the page
Just tested, yes with the default install this will not work. Looks like you can change it in plugins/function.metadata.php. That file has a comment mentioning that you can change this setting in config.php. There is currently nothing in config.php where you can change showbase, so I tried adding: $config['showbase'] = false; and that didn't work (don't know if I did that right or not). But setting the linke $showbase = true to false did made the base URL go bye-bye.
I'd like to change this setting in config.php so I don't have to always update a core file when I upgrade. This should be a setting that one can either change in config.php or the admin interface, right along with entering the rest of the global metadata there.
Personal preference, but I don't like using base. But I'm also the type of guy who doesn't like using relative URLs... No, I'm not going to get into nor am I trying to start a petty debt about absolute vs relative URLs, each have their merit.
I'd like to change this setting in config.php so I don't have to always update a core file when I upgrade. This should be a setting that one can either change in config.php or the admin interface, right along with entering the rest of the global metadata there.
Personal preference, but I don't like using base. But I'm also the type of guy who doesn't like using relative URLs... No, I'm not going to get into nor am I trying to start a petty debt about absolute vs relative URLs, each have their merit.
Re: ^Top link at the bottom of the page
I second that ...nivekiam wrote: I'd like to change this setting in config.php so I don't have to always update a core file when I upgrade. This should be a setting that one can either change in config.php or the admin interface, right along with entering the rest of the global metadata there.
Alex
Re: ^Top link at the bottom of the page
OK, another puzzled solutionfaglork wrote: Must be (note the "#"):Code: Select all
<p><a href="#main" title="top"><img src=/path/to/image"></a>
Code: Select all
<a href="{root_url}/index.php?{$query_var}={$page_alias}#main">^ Top</a>
Re: ^Top link at the bottom of the page
Thank you calguy1000 for pointing me to this.
In your template, if you set {metadata showbase='false'} then it won't generate the troublesome base tag.
No need to edit config.php or function.metadata.php.
In your template, if you set {metadata showbase='false'} then it won't generate the troublesome base tag.
No need to edit config.php or function.metadata.php.
Re: ^Top link at the bottom of the page
Ahhhh ...!
Sometimes it is just too easy.
Thx,
Alex
Sometimes it is just too easy.
Thx,
Alex