Karelia Community Forum

Join a conversation, pose a question, or help a fellow user: The best place to discuss all things Karelia.

You are not logged in.

#1 May 12, 2012 11:07 am

joljol2
Member

link to a fragment

Is there any progress toward linking to a specific location within a text document, like <a href="#item 12...></a>
to be inserted into html ?

Offline

#2 May 12, 2012 11:12 am

macdafydd
Avenger

Re: link to a fragment

There is no built-in way to do it, but it can be achieved with some Raw HTML.


It says "Avenger," but I am just a Sandvox user who has been assigned the title of Avenger here in order to be able to delete spam messages. http://davidneale.eu/

Offline

#3 May 12, 2012 3:10 pm

seanc
Hero

Re: link to a fragment

Anchors can be done with Raw HTML elements.

First insert your anchors, each in its own Raw HTML element, placed where ever you want in-between the other "content" elements.

Then link to them thru the built-in link inspector "external URL" with a simple "#anchorName".

Demo page: Anchors in Sandvox

Offline

#4 May 12, 2012 5:18 pm

joljol2
Member

Re: link to a fragment

This may not be currently working with a link in the Sidebar trying to target the bottom of another page in the Site Menu?

Offline

#5 May 13, 2012 2:59 am

macdafydd
Avenger

Re: link to a fragment

I don't think that sort of link will work when you're actually in Sandvox. Try exporting and then checking if the link works in the exported site.


It says "Avenger," but I am just a Sandvox user who has been assigned the title of Avenger here in order to be able to delete spam messages. http://davidneale.eu/

Offline

#6 May 13, 2012 6:39 am

joljol2
Member

Re: link to a fragment

Did publish the site. www.worldshaman.org/betaTest

Link in Sidebar item "Climb one with me" just opens a new instance of the whole site.
NOT going to raw html target at bottom of a mixed graphic and text page titled "Sketch"

Thanks for your interest,

Offline

#7 May 13, 2012 7:12 am

macdafydd
Avenger

Re: link to a fragment

I don't see a "Climb one with me" item in the sidebar. There is an "Ascend with me," and that seems to work, though it is not a link to an anchor.


It says "Avenger," but I am just a Sandvox user who has been assigned the title of Avenger here in order to be able to delete spam messages. http://davidneale.eu/

Offline

#8 May 13, 2012 7:59 am

joljol2
Member

Re: link to a fragment

Thanks Avenger, for checking,

"Ascend with me" IS the current naming of the Sidebar item. (I switch them, but don't remember my whims always)

As you say, it does not link to an anchor, although I would like it to go to the raw html at the bottom of the Sketch page.

Offline

#9 May 13, 2012 9:07 am

macdafydd
Avenger

Re: link to a fragment

I have made a page, showing how to use anchor tags with Sandvox. It includes a link from a sidebar and a link from a graphics object. You'll find it at http://davidneale.eu/sandvox/index.html


It says "Avenger," but I am just a Sandvox user who has been assigned the title of Avenger here in order to be able to delete spam messages. http://davidneale.eu/

Offline

#10 May 13, 2012 12:39 pm

seanc
Hero

Re: link to a fragment

David:

Nice write-up!  There's a bit more to "linking to anchors on other other pages" though, unless v2.5 acts differently than 2.2.

As long as all anchors & links are on the same page, you can use the link inspector to create the links, but if the anchors are on a different page, you can't use the link inspector on a random bit of text (it will mangle the URL), those links have to be manually entered in another Raw HTML element (I believe your sidebar link is Raw HTML?).

There is a workaround, but not totally w/in Sandvox.  Requires exporting w/standard "page" links, then editing the exported pages to add the anchor tags to each link.

I believe simple anchors & links-to could be easily added to Sandvox, w/in the current link inspector, but we'd have to lobby Karelia to investigate :-)

Sean

Offline

#11 May 13, 2012 12:51 pm

seanc
Hero

Re: link to a fragment

joljol2 wrote:

This may not be currently working with a link in the Sidebar trying to target the bottom of another page in the Site Menu?

Links to an anchor on another page anchor are not as easy.  You cannot use the link inspector to create those links, but there are 2 ways to get it done.

A) use another Raw HTML element for the link (you have to figure out the correct "path" to enter)

... or ...

B) create standard "page in this site" links to those pages with anchors, then

  • export the site

  • edit each exported html page

  • add the appropriate "#anchorname" tag to the end of each link

  • TEST locally

  • upload to your host with standard FTP protocol

I use the second method (letting Sandvox create the page proper paths/URLS, so I can't make mistakes).  I've added an example to my demo page: Anchors in Sandvox

got to Paragraph 2, there's a link to an anchor on another page: "Jump to Book 2 Chapter 2"

in that page "chapter", there's a link back to paragraph 2 on the first page: "Go back to Index Table of Contents, Paragraph 2"

Sean

Last edited by seanc (May 13, 2012 1:01 pm)

Offline

#12 May 13, 2012 2:16 pm

macdafydd
Avenger

Re: link to a fragment

seanc wrote:

(I believe your sidebar link is Raw HTML?).

I believe simple anchors & links-to could be easily added to Sandvox, w/in the current link inspector, but we'd have to lobby Karelia to investigate :-)

Sean

Yes, the sidebar link and all others with the exception of the graphics link, were done with Raw HTML.

I actually didn't think about a graphics link until I put the "thumbs up" graphic on the page, which made me consider how to tack some HTML onto it. Then I realised that I might be able to fool the Link Inspector, so I added the down arrow graphic and it was a very easy solution (of course, Raw HTML was still needed to place the anchor). I've not tried, but I should think that all jumps, even those from texs,mcould be achieved through the Link Inspector, including those to other pages.

Jumps to other pages aren't all that difficult to do. Sandvox shows the URL of the other page if you go to it, so it's easy enough to copy the relevant part in order to create the relative link required in the href.


It says "Avenger," but I am just a Sandvox user who has been assigned the title of Avenger here in order to be able to delete spam messages. http://davidneale.eu/

Offline

#13 May 13, 2012 2:55 pm

joljol2
Member

Re: link to a fragment

The result of the Link Inspector "mangling the URL" is seen in a browser error message that the URL is not on the server or e.g. "Safari can't open the page because sees the link as  "http://xn--<a%20href=photo-br6g.html/" because the page's address is not valid"

Confusing to I, a novice.

Offline

#14 May 13, 2012 3:02 pm

macdafydd
Avenger

Re: link to a fragment

Does this error originate from a published site, an exported sit, or from testing a link within Sandvox itself? If it's from a published site, what's the URL of the page on which the offending link is found and where on the page is the link?

In the othet two cases, take a screenshot (partial) of the contents of the Link Inspector for the offending link.


It says "Avenger," but I am just a Sandvox user who has been assigned the title of Avenger here in order to be able to delete spam messages. http://davidneale.eu/

Offline

#15 May 13, 2012 3:47 pm

joljol2
Member

Re: link to a fragment

Since this beta test site is not mission critical I just publish and republish - instead of testing locally.

The URL of the home page of the site is "http://www.worldshaman.org/betaTest/"

The offending link is in the Sidebar, "Climb one" of  Climb one with me .

Thanks,

Offline

#16 May 13, 2012 4:03 pm

seanc
Hero

Re: link to a fragment

macdafydd wrote:

.. I've not tried, but I should think that all jumps, even those from texs,mcould be achieved through the Link Inspector, including those to other pages.

I have tried, and it does not work (at least, not in v2.2.x, don't know about 2.5.x), and I think that's where joljol2 is running into trouble.

Links to anchors within the same page work fine via link inspector "external URL".  It accepts the anchor tag as-is, does not "meddle" with it in any way:

As typed: good-before.jpg
Accepted: good-after.jpg

But ... if you try to prepend a relative path to another page, it "meddles" with the address:
As typed: bad-before-1.jpg
Mangled: bad-after-1.jpg

Or a doc root path to another page:
As typed: bad-before-2.jpg
Mangled: bad-after-2.jpg

The only way it won't "meddle" is with absolute path:
As typed: works-before.jpg
Accepted: works-after.jpg

Sean

Offline

#17 May 13, 2012 4:09 pm

seanc
Hero

Re: link to a fragment

joljol2 wrote:

The offending link is in the Sidebar, "Climb one" of  Climb one with me ...

You're linking a pagelet "Title" text to another page anchor: it will not work via the link inspector.  The link inspector will only work when the anchor is on the same page.

You'll have to use either a Raw HTML element for the link, or use method "B" as I outlined above.

Sean

Offline

#18 May 13, 2012 5:01 pm

joljol2
Member

Re: link to a fragment

Wow !

I just wanted  way to point to the bottom of the upcoming page.

Easy as the links in the other Pagelet's titles in the Sidebar.

Thanks for the tutoring,

joljol2

Offline

#19 May 14, 2012 2:27 am

macdafydd
Avenger

Re: link to a fragment

I've not tried using the Link Inspector to link to another page (yet!), but your URLSs look very strange, so it might be that the link simply is not specified correctly. Here's the link that I placed in the sidebar of my demo page, using RAW HTML:

<span><a href="column-layouts/2-columns-2.html#2col">2-column layout</a></span>

The link is a relative link and must be bang on for it to work correctly.

Hang on, I'll try the same link, using the Link Inspector, to see if it works…

No. Sandvox changes the relative link to an absolute link, but misses part of the URL. You can enter the absolute URL yourself, but then Sandvox cuts it off after so many characters, thereby breaking the link again. At the moment, then, all you can do is to use Raw HTML, I think.

I shall add something about this to the demo page when I have time.


It says "Avenger," but I am just a Sandvox user who has been assigned the title of Avenger here in order to be able to delete spam messages. http://davidneale.eu/

Offline

#20 May 14, 2012 3:52 am

joljol2
Member

Re: link to a fragment

I changed the Pagelet title to Photo because Sketch.html was not getting published.

In the text under the title I entered
<span><a href=“betaTest/Photo.html#Sketch-bottom>Climb one with me</a></span>

Upon publishing the error came: The requested URL /betaTest/“betaTest/Photo.html was not found on this server.
plus the 404 code

Offline

#21 May 14, 2012 4:31 am

macdafydd
Avenger

Re: link to a fragment

Your URL is incorrect. Checking the source code, it reads:

<a href="“betaTest/Photo.html#Sketch-bottom">Climb one with me</a>

Note the two quotes (one plain, the other heaven knows what) after href=.


It says "Avenger," but I am just a Sandvox user who has been assigned the title of Avenger here in order to be able to delete spam messages. http://davidneale.eu/

Offline

#22 May 14, 2012 5:10 am

joljol2
Member

Re: link to a fragment

Och !

Perhaps "mingling" could be a relevant term, instead of mangling.

Trying to get the link to work,

1st in Safari

then 2nd in view/edit on the Photo.html file seen with FileZilla

there are a variety of reported URLs that are not found; such as:

Safari can't find the file. ?
No file exists at the address
“/var/folders/hk/v1d ct0n3gv10cg10g8vrczs45s40000gn/T/fz3temp-1/photo.html/Photo.html".

Last edited by joljol2 (May 14, 2012 5:46 am)

Offline

#23 May 14, 2012 10:16 am

macdafydd
Avenger

Re: link to a fragment

joljol2, it is extremely difficult, sometimes impossible, to provide answers when insufficient data is available, so I can't offer a solution to your latest post.

As for your anchor link in the sidebar, currently, your link, "Climb one with me," points to http://www.worldshaman.org/betaTest/Pho … tch-bottom and this returns a not found error.

So, taking that URL, instead of going to a specific location (Sketch-bottom) on the page, I try to go to the page itself, using http://www.worldshaman.org/betaTest/Photo.html and also receive a not found error.

If the page can't be found, the a location on it will certainly also not be found!

After some time and investigation of your other links, I thought I'd try the page URL, but with a lower-case "p" instead of the upper-case: http://www.worldshaman.org/betaTest/photo.html

And it worked! So then I tried adding the anchor-name and that worked, too.

You must take care with URLs to get them absolutely correct.


It says "Avenger," but I am just a Sandvox user who has been assigned the title of Avenger here in order to be able to delete spam messages. http://davidneale.eu/

Offline

#24 May 14, 2012 1:46 pm

joljol2
Member

Re: link to a fragment

Macdaffyd, looks like they ought to create a new category just for you - SuperSleuth !

Thank you so much for your continuing involvement in unraveling this.

I'll bear the on-going trauma of all this in mind as a caution to myself.

Thanks again, and to all those imposed on throughout.

joljol2

Offline

#25 May 16, 2012 8:08 am

francotton
Hero

Re: link to a fragment

seanc wrote:
macdafydd wrote:

.. I've not tried, but I should think that all jumps, even those from texs,mcould be achieved through the Link Inspector, including those to other pages.

I have tried, and it does not work (at least, not in v2.2.x, don't know about 2.5.x), and I think that's where joljol2 is running into trouble.

Links to anchors within the same page work fine via link inspector "external URL".  It accepts the anchor tag as-is, does not "meddle" with it in any way:

As typed: http://www.macalchemy.com/sandvox/ancho … before.jpg
Accepted: http://www.macalchemy.com/sandvox/ancho … -after.jpg

But ... if you try to prepend a relative path to another page, it "meddles" with the address:
As typed: http://www.macalchemy.com/sandvox/ancho … fore-1.jpg
Mangled: http://www.macalchemy.com/sandvox/ancho … fter-1.jpg

Or a doc root path to another page:
As typed: http://www.macalchemy.com/sandvox/ancho … fore-2.jpg
Mangled: http://www.macalchemy.com/sandvox/ancho … fter-2.jpg

The only way it won't "meddle" is with absolute path:
As typed: http://www.macalchemy.com/sandvox/ancho … before.jpg
Accepted: http://www.macalchemy.com/sandvox/ancho … -after.jpg

Sean

This works great, to points in the same page or other pages! Nice one!

All you need is an external link with #name or full url#name to link to a point on another page, where name is the anchor tag as described here http://davidneale.eu/sandvox/anchor-tags.html#par1

or you can do it the html link way

Cheers again!

Last edited by francotton (May 17, 2012 1:26 am)

Offline

Board footer

Powered by FluxBB