Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When calling an article by url, the TOC does not detect the order where the current article is. #316

Open
davidjonas opened this issue May 8, 2013 · 8 comments

Comments

@davidjonas
Copy link

Basically, with 0.10.0. If I have my toc linked in all pages with the order:

article1
article2
article3
article4

and If I visit mysite.com/article3 I see the publication order as (always clicking the next button):
article3
article1
article2
article3
article4

The expected behaviour is what was happening before updating to 0.10.0:
I would visit mysite.com/article3 click next and I would get:
article3
article4

Am I doing something wrong? My toc.json is the same linked on every page and has the format:

{"contents": [
{"url": "/article1"},
{"url": "/article2"},
{"url": "/article3"},
{"url": "/article4"}
]
}

@pph7
Copy link

pph7 commented May 8, 2013

Somehow the link of the current page seems not to match the url in the
toc.json. Can you try in the toc.json without a leading '/'? E.g.
"url":"article1" etc.

Otherwise, can you put it online somewhere?

@davidjonas
Copy link
Author

Wow!! Thanks for the really quick reply!! :D You guys are amazing!

Actually I think I am on to the problem now. The URLs are pointing in the
right direction, I tried taking the slash off and I get 404's instead of
the articles (cause actually is more like "/2012/article/articleName". I
just wanted to simplify things)

My toc had the wrong format I guess:

{"contents": [
{"url": "/article1"},
{"url": "/article2"},
{"url": "/article3"},
{"url": "/article4"}
]
}

should be only:

[
{"url": "/article1"},
{"url": "/article2"},
{"url": "/article3"},
{"url": "/article4"}
]

right??

I changed it now but now it doesn't read at all I get only one article and
the next/prev are disabled.

Here is my Real toc output directly copied from the site as it is right now:

[{"url": "/2012/article/cover"}, {"url": "/2012/toc/"}, {"url":
"/2012/article/beeldimpressie"}, {"url": "/2012/article/inleiding"},
{"url": "/2012/article/tentoonstellingen"}, {"url":
"/2012/article/de-ouderwetse-kamer"}, {"url":
"/2012/article/verzameld-werk"}, {"url": "/2012/article/underground"},
{"url": "/2012/article/eilanden"}, {"url":
"/2012/article/christien-meindertsma-vlas"}, {"url":
"/2012/article/willem-van-oranje-heerser-en-huisvader"}, {"url":
"/2012/article/eenmaal-andermaal"}, {"url":
"/2012/article/waterstad"}, {"url":
"/2012/article/nieuwe-inrichting-van-de-zilverkast"}, {"url":
"/2012/article/hart-voor-veere"}, {"url":
"/2012/article/nieuwe-inrichting-van-de-wonderkamers"}, {"url":
"/2012/article/jaaragenda"}, {"url": "/2012/article/collectie"},
{"url": "/2012/article/behoud-en-Beheer"}, {"url":
"/2012/article/Onderzoek"}, {"url": "/2012/article/aankopen"}, {"url":
"/2012/article/schenkingen"}, {"url": "/2012/article/bruiklenen"},
{"url": "/2012/article/uitgaande-bruiklenen"}, {"url":
"/2012/article/publiek"}, {"url": "/2012/article/educatie"}, {"url":
"/2012/article/organizatie"}, {"url":
"/2012/article/vrienden-van-het-zeeuws-museum"}, {"url":
"/2012/article/met-dank-aan"}, {"url": "/2012/article/colofon"}]

I've tested all the URL's and order are all correct and show the right
article and were ported directly from the old 0.9.2 TOC to the new
JSON format.

Any idea of what I might be doing wrong?

On Wed, May 8, 2013 at 2:46 PM, pph7 [email protected] wrote:

Somehow the link of the current page seems not to match the url in the
toc.json. Can you try in the toc.json without a leading '/'? E.g.
"url":"article1" etc.

Otherwise, can you put it online somewhere?


Reply to this email directly or view it on GitHubhttps://github.com//issues/316#issuecomment-17603063
.

@pph7
Copy link

pph7 commented May 8, 2013

Actually your toc.json syntaxt was right in the first place. Which browser
are you using? You should turn on debugging and watch the Javascript
console output. That should help to clarify the problem.

@davidjonas
Copy link
Author

Yes, you are right :) I just managed to solve it by using the first format
of the toc and absolute URL's instead of relative. It is really not ideal
though. I would really like to be able to use relative URLs because it
makes it much more manageable in terms of dev / production instances of the
same site.

I will fidget with it a bit more.

Thank you very very much!!!

On Wed, May 8, 2013 at 3:10 PM, pph7 [email protected] wrote:

Actually your toc.json syntaxt was right in the first place. Which browser
are you using? You should turn on debugging and watch the Javascript
console output. That should help to clarify the problem.


Reply to this email directly or view it on GitHubhttps://github.com//issues/316#issuecomment-17604339
.

@pph7
Copy link

pph7 commented May 8, 2013

I think by "absolute" urls you mean an url including the domain part too?
It should work without that. I still recommend checking out Javascript
console.
You are welcome!

@davidjonas
Copy link
Author

Yes, I meant that I added the whole URL including http:// and the domain name. can't get it to work without it somehow. Could it be because I am using a non standard port?

Because I made a treesaver integration with Django and I am now updating it to work with 0.10.0 while running on port 9081 so my url is like example.com:9081/2012/article/articleName

By the way, did you guys change anything in the way that the lightbox works? I had a bunch of lightboxes with an iframe inside and now they do not show the iframe anymore. Instead they show the first image that is used to trigger the lightbox in the first place.

You can see the production site that is working fine with 0.9.2 (except in FF of course) at http://jaarverslag.zeeuwsmuseum.nl/

If you browse through the articles you will see some images with a "Slideshow" button that opens the lightbox with the iframe. Now, with 0.10.0 it just shows the same image with the same slideshow button inside the lightbox. (I am unsure if it is tidy to discuss this here or create another issue. I'm sorry)

@pph7
Copy link

pph7 commented May 8, 2013

The port can be definetely the issue Can you try to run it on the standard
port?

Sorry, I m not from the core dev team so I can not answer your questions
regarding the lightbox.

Mark

On Wed, May 8, 2013 at 3:48 PM, David Jonas [email protected]:

Yes, I meant that I added the whole URL including http:// and the domain
name. can't get it to work without it somehow. Could it be because I am
using a non standard port?

Because I made a treesaver integration with Django and I am now updating
it to work with 0.10.0 while running on port 9081 so my url is like
example.com:9081/2012/article/articleName

By the way, did you guys change anything in the way that the lightbox
works? I had a bunch of lightboxes with an iframe inside and now they do
not show the iframe anymore. Instead they show the first image that is used
to trigger the lightbox in the first place.

You can see the production site that is working fine with 0.9.2 (except in
FF of course) at http://jaarverslag.zeeuwsmuseum.nl/

If you browse through the articles you will see some images with a
"Slideshow" button that opens the lightbox with the iframe. Now, with
0.10.0 it just shows the same image with the same slideshow button inside
the lightbox. (I am unsure if it is tidy to discuss this here or create
another issue. I'm sorry)


Reply to this email directly or view it on GitHubhttps://github.com//issues/316#issuecomment-17606603
.

@andreacampi
Copy link
Member

FWIW, I always use absolute URLs just in case--that is guaranteed to always work :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants