1 frsurfer May 01, 2009 17:32
3 frsurfer May 01, 2009 17:51
Sorry, this doesn't help at all!
I say "Anchor... Simply" and I'm afraid the link you gave is pure charabia to me (I'm not an expert, mind you) :-)
What I mean is: In any normal web page, the simple anchor works, but NOT within B2... Why and what fix?
4 edb May 01, 2009 18:08
Because the base tag is needed to fix relative links b2evolution generates. It generally works in other webs because generally speaking the base tag is left out. Not saying that is good or bad - it just is.
There is no 'easy fix'. I thought I had one somewhere but I guess not.
By the way I feel obligated to point out that you probably weren't born knowing about anchor tags. Learning happens eh?
Hey that's not a very much older version after all! I got this feeling it'll be reasonably easy (which is a relative term eh?) to take that info and turn it into a couple of files. I like anchor tags so I think I'll give it a go. Dunno when though. I'm kinda into reskinning my ugly old web and maybe starting a web services business. "YahGooZon" :) And maybe getting some sleep secure in the knowledge that the flood that happened will eventually dry up :(
5 yabba May 01, 2009 18:19
frsurfer wrote:
[Hi, I wish I could write something like this within a post:
<a href="#Sport">Sport</a>
It'd fail even if you could do it, all skins have a <base> tag that points to the skins folder so your links would become something like http://your-domain.com/skins/my_cool_skin/#foo ;)
¥
*edit*
ack, that'll teach me to read the answers before I share my genius, EdB's right the base tag is what screws you ;)
6 frsurfer May 01, 2009 18:24
Hey, I was born - long time ago - with no knowledge at all - espacially HTML!
So when I need I go to W3C recommendations and read. This for example:
Excerpt from page:
http://www.w3.org/TR/html401/struct/links.html
Quote:
====
Thus, for example, an author might create a table of contents whose entries link to header elements H2, H3, etc., in the same document. Using the A element to create destination anchors, we would write:
<H1>Table of Contents</H1>
<P><A href="#section1">Introduction</A><BR>
<A href="#section2">Some background</A><BR>
<A href="#section2.1">On a more personal note</A><BR>
...the rest of the table of contents...
...the document body...
<H2><A name="section1">Introduction</A></H2>
...section 1...
<H2><A name="section2">Some background</A></H2>
...section 2...
End of quote
========
Which - to me at least - means this IS the actual standard, isn't it?
Anyway, thanks for helping.
7 yabba May 01, 2009 18:27
It is, but the <base> tag pwns all ;)
¥
8 frsurfer May 01, 2009 18:56
Well, that <base> redirection I suppose its here to fix up another issue with skins, but its *not* a nice IT solution if it goes against the W3C compliance standards.
Now question: Can I write something like:
<a href=this() + "#Sport"> in order to fix up the problem?
Sorry I don't *even* know the syntax for that.
I mean all I want is avoid the page to flicker and the user to redo the whole path for just an anchor!
9 edb May 01, 2009 19:07
http://www.w3.org/TR/html401/struct/links.html#edef-BASE Same standard :(
Anyway it doesn't work because b2evolution uses the base tag for other stuff in a standards-compliant way.
Using any sort of php in a post won't work, so that path is out. The thing to do will be to write a little plugin that renders acceptable bits into useful bits. So like you would write in your blog post
[href:whatever:My Linked Text]
some random text
then further down
[name:whatever:optional text]
Obviously that all by itself is useless, but a groovy renderer would be able to turn it into a link to the post's permalink with a #whatever tacked on the end, and a name="whatever" inside the document.
I think. That *always* gets me in trouble.
My plumbing is stupid. NOTHING in this house has the little hole that stops the sink or tub from overflowing if you start playing fetch with the dog and forget you turned the water on. Well, I think it's my plumbing thats stupid :roll:
10 yabba May 01, 2009 19:47
frsurfer wrote:
Now question: Can I write something like:
<a href=this() + "#Sport"> in order to fix up the problem?
To do that you need to remove the base tag and then overcome IE's ineptitude by making all img (et al) urls in your css absolute ( or rel to / ), it's what I did on my blog ;)
¥
11 frsurfer May 02, 2009 02:12
Ok then... Where do I remove that <base> tag from?
And what wil then not work properly?
I mean can you (please) be more specific and give some example?
Thanks in advance!
12 frsurfer May 02, 2009 02:14
I mean, for instance:
In the skin's style.css there is rhis line:
background:#283956 url(images/background.png) repeat-x;
How should I then write it if I remove the <base> tag?
13 edb May 08, 2009 13:21
Removing the existing base tag will be in /skins/_html_header.inc.php or maybe /skins/yourskin/ and will look something like this:
<?php skin_base_tag(); /* Base URL for this skin. */ ?>
What you would replace the bits in the style sheet is ... I dunno! But hey if you tinker with it a bit you'll probably figure it out yah? There might also be relative references to images in other files in the skin by the way. Depends on the skin I guess. Stuff like xml feed or permalink icons is what I'm thinking of. All depends on the skin...
Also how the base tag is interpreted depending on what type of URL configuration you've selected will have to be taken into account. Meaning I've no idea what the base tag will be considered if the URL seems to have folders in in the way "clean URLs" do. It's all fake so maybe the basics of how browsers work figure that out, or maybe they don't.
14 amoun Feb 18, 2014 15:01
Hi Just checking on this.
Yes my old hack, mentioned in the first response calls the whole page again, has there been any update on this issue.
So is the issue around the function that interprets a link?
Should it respond, if the requesting URL starts with a hash, by not using the base URL and just scrolling ????
1. It seems b2evo automatically adds the base URL if none is specified
2. If it didn't would the browser just scroll to the in-page anchor?
3. If so where is this pescy code?
4. Checked the database, the added base URL is it in the rendering
5. What is this in the database {field name[post_renderers] value=[b2evALnk.b2WPAutP.evo_code]}
Maybe this is the value that needs to be null when href="#****"
6. Found only one occurrence in /inc/tools/model/_phpbb.funcs.php so that looks like a distraction
So Looking at a post title to see how it links and how links are rendered
7. so is it in the $Item variable?
8. Looking at /inc/_blog_main.inc.php [lines 342 to 357]
9. No it's not in the rendering as the source code shows just the href="#****"
The above is me deprecating my ideas that were fruitless but led me to here, how embarrassing?
I think when the browser sees the # it adds the current URL, so all that has to be done I think is to automate the post title into the link ahrgg!
But doesn't that call the page again unless it is cached, which is the initial problem ??
Will continue this on my old post http://forums.b2evolution.net/topic-15293#75861
15 amoun Feb 23, 2014 03:05
See http://forums.b2evolution.net/quicktags-la-name-quot-quot-g-hack
This hack enables the ability to enter a #bookmark as the URL, but I think, noticing the browser link status, that it reads the whole page. I am not sure if it just scrolls or reloads. It's so quick I think it scrolls.
I know I'll disconnect from the web and see if the link still works ????
Yes disconnected and the bookmark works, so although the browser shows the whole URL it takes a shortcut and scrolls to the bookmark
Perhaps http://forums.b2evolution.net/viewtopic.php?p=75861#75861 will lend appropriate info even though it refers to an older version?