Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#16 2009-08-13 17:01:34

AdamK
Member
From: Kraków, Poland
Registered: 2009-08-11
Posts: 47

Re: smd_pagicle: automatic (jQuery) pagination of articles

Hi.

The plugin is great, but I found a strange problem: when paginating a text divided in more than 2 divisions, IE 7 shows only two of them

example:

http://haiku.art.pl/o-haiku

I can see 4 sections in FF3+, Chrome and Safari (OS: Vista), not in IE 7 (you can see the 1st and the 3rd section there).

Greetings

Adam

Offline

#17 2009-08-13 17:09:58

AdamK
Member
From: Kraków, Poland
Registered: 2009-08-11
Posts: 47

Re: smd_pagicle: automatic (jQuery) pagination of articles

How I call the plugin:

In the <head. I put
<txp:smd_pagicle container=”#haiku_static” splitwraptag=”“ splitat=”#” header=“h2” navdisplay=“p # n” navtext=“p:Poprzednia, n:Następna”/>

and in the body
<div id=“smd_pagnav”></div>

Adam

P.S. As the site went public, I have removed pagination due the IE issue. I can re-enable it on e-mail demand (kuchar at interlinia dot pl)
thanks
A.

Last edited by AdamK (2009-08-19 11:08:00)

Offline

#18 2009-08-18 10:08:13

ultramega
Member
Registered: 2006-02-26
Posts: 221

Re: smd_pagicle: automatic (jQuery) pagination of articles

Any ideas why using shadowbox image viewer doesn’t work when pagicle enabled? I have a thumbnail image inside text. It links to original sized image. If pagicle is disabled, image opens to shadowbox overlay as intended. If pagicle enabled, the link just opens plain image. Wouldn’t mind to let go either one of these..

Edit. Moving the shadowbox script to the bottom of the page seems to helps a little: the link to overlay works on the first time, but after visiting some pagicle “pages” and coming back, makes it a basic link again.

Last edited by ultramega (2009-08-18 10:28:19)

Offline

#19 2009-08-19 21:04:18

ultramega
Member
Registered: 2006-02-26
Posts: 221

Re: smd_pagicle: automatic (jQuery) pagination of articles

One other thing: normally “focusing” the page top/html is what we propably want. But when we are previewing comments, we may want to focus on comment preview area… I noticed the plugin forces page always to scroll up, even when previewing a comment on bottom of the page.

Offline

#20 2009-08-19 21:27:25

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 12,479
Website GitHub

Re: smd_pagicle: automatic (jQuery) pagination of articles

ultramega wrote:

I noticed the plugin forces page always to scroll up, even when previewing a comment on bottom of the page.

Well, “forcing” is perhaps a little harsh — you can turn it off with the focus attribute :-) But I guess if you had the comment form at the ‘end’ of your article, perhaps on Page 4, and someone submitted a comment then I’m not sure what the plugin would do. I never tested it but I will.

I do have another version that is stupidly close to being finished (fixes kostas45’s request and adds a bunch of other stuff) but I found a daft bug that prevented the links from working unless something appeared above the DOCTYPE in the browser. If you put debug on or have an error in one of the tags on your site the plugin works flawlessly, but as soon as your page validates and renders fine, the paging stops working :-s Go figure.

I can’t for the life of me find out why. This might be releated to AdamK’s findings or could be some obscure jQuery or plugin logic bug that I can’t see.

Regarding your shadowbox thing I really don’t know: again I’ll have to try it out. Might be some weirdness going on because we’re manipulaing the DOM — switching divs on and off, injecting markup, etc — and shadowbox probably assumes the structure remains constant. That could be why moving it to the bottom of the page helped because smd_pagicle had a chance to screw around with the markup before shadowbox saw what was going on.

woof

Did you try the tabs thing? I don’t know how/if it would work out of the box but you’re right that it would make sense for the plugin to be able to fashion the output into something that UI Tabs could render. If it can’t manage it now, I can certainly look at adding it in future, thanks for the idea.

Last edited by Bloke (2009-08-19 21:29:00)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Hire Txp Builders – finely-crafted code, design and Txp

Offline

#21 2009-08-20 10:18:51

ultramega
Member
Registered: 2006-02-26
Posts: 221

Re: smd_pagicle: automatic (jQuery) pagination of articles

I have comment area under pagicle pages – visible all the time. I like to keep the focus feature on – as it clearly indicates clicking changes something. So I tried this: Focusing to comment preview area. It works: when cpreview is not defined, it focuses to the page top. (but js-errors are presented because “pos is undefined “.) If previewing comment, it focuses to the right place also. So maybe it could be fixed: “firstly focus to area set in options – if not found then focus to page top”?

Please try the shadowbox thing when having time. It is sad that it almost works when the script is at the bottom…

Offline

#22 2009-08-25 09:10:56

ultramega
Member
Registered: 2006-02-26
Posts: 221

Re: smd_pagicle: automatic (jQuery) pagination of articles

Hmm… little more bad news for you :) IE6 (…yeah, still have to think about it) is not compatible either: When other browsers divide lengthy article in 7 blocks, IE6 makes only 4 AND doesn’t open any of them. It shows every time the first page.

Offline

#23 2009-08-25 09:22:31

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 12,479
Website GitHub

Re: smd_pagicle: automatic (jQuery) pagination of articles

ultramega wrote:

little more bad news for you :) IE6

Au contraire! It’s not bad news, because I gave up caring about IE6 in 2001… approximately 5 hours after it was released ;-)

Seriously though, I never tested it. You’re right: in fact in the latest version of the (still in dev) plugin it doesn’t even render the pagination at all — just one loooong article. I’ll see if I can at least make IE limp along, albeit with a gammy leg and rickets.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Hire Txp Builders – finely-crafted code, design and Txp

Offline

#24 2009-09-11 07:35:12

kostas45
Member
From: Greece
Registered: 2007-11-08
Posts: 61

Re: smd_pagicle: automatic (jQuery) pagination of articles

Hi Stef,

It seems only smd_pagicle would work with smd_query.
As you are overhauling smd_pagicle, please also consider this:

Say we go to page 3 of articles listing, then to an individual article. If we now click browser’s Back button, we go to page 1 instead of page 3.

I believe this is the jQuery history issue, just wondering if smd_pagicle can cater for this ;-)

Thanks,
Kostas

Offline

#25 2009-09-11 07:54:54

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 12,479
Website GitHub

Re: smd_pagicle: automatic (jQuery) pagination of articles

kostas45 wrote:

Say we go to page 3 of articles listing, then to an individual article. If we now click browser’s Back button, we go to page 1 instead of page 3.

Yes, as you say, there’s nothing I can do about this :-(

When you page through stuff it’s really a ‘fake’ page that just divides your whole page into your chosen chunks and then turns divs on and off to display data. All the data has been loaded already to the page and everything you do from that point is client-side trickery. So when you click Back you go to the last real, physically downloaded page in your browser’s history.

Unfortunately, providing javascript history is problematic. The two main ones being:

  1. javascript cannot talk to or intercept the browser’s Back button
  2. javascript has no write access whatsoever to the browser’s history object

Even if we create our own internal js history, visitors would have to use the dedicated Back button inside the web page and not the familiar browser’s Back button. Both of the above restrictions are in place for so-called ‘security’ in our wonderful nanny-state world, and I’m quietly convinced have been the single biggest reason behind preventing AJAX and jQuery being truly useful in this kind of situation.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Hire Txp Builders – finely-crafted code, design and Txp

Offline

#26 2009-09-11 08:38:02

kostas45
Member
From: Greece
Registered: 2007-11-08
Posts: 61

Re: smd_pagicle: automatic (jQuery) pagination of articles

Stef, I was thinking somehow using jQuery history plugin

-K

Offline

#27 2009-09-11 08:45:42

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 12,479
Website GitHub

Re: smd_pagicle: automatic (jQuery) pagination of articles

kostas45 wrote:

I was thinking somehow using jQuery history plugin

Ah, that’s different. I’m not using hash states but I guess I could if it means we can cheat like that! I’d forgotten about hash states.

The library itself would have to be optional as I don’t want to redistribute the jQuery plugin with this plugin. Leave it with me. When I go hunting for the bug in the new code I’ll see if it’s possible to add this functionality.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Hire Txp Builders – finely-crafted code, design and Txp

Offline

#28 2009-09-11 09:03:41

kostas45
Member
From: Greece
Registered: 2007-11-08
Posts: 61

Re: smd_pagicle: automatic (jQuery) pagination of articles

Bloke wrote:

When I go hunting for the bug in the new code I’ll see if it’s possible to add this functionality.

Great news! Thanks a lot Stef :-)

-K

Offline

#29 2009-09-30 12:39:17

Fede
Member
From: BA
Registered: 2009-09-28
Posts: 10

Re: smd_pagicle: automatic (jQuery) pagination of articles

Sorry for the dumb question, but, could this be used for paginating file and links lists ? Im trying to achieve this task without luck

thankyou!

Last edited by Fede (2009-09-30 12:39:54)

Offline

#30 2009-09-30 13:03:53

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 12,479
Website GitHub

Re: smd_pagicle: automatic (jQuery) pagination of articles

Fede wrote:

Sorry for the dumb question, but, could this be used for paginating file and links lists

In theory yes, since it’s all jQuery. Just output every item in your list and wrap it in a div. Give smd_pagicle the reference to that div in the element attribute. All you then have to do is inject a break in your list every 5th item via your list form. You could use zem_nth for this, or perhaps smd_if to insert {page} after every 5th item.

Last edited by Bloke (2009-09-30 13:04:28)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Hire Txp Builders – finely-crafted code, design and Txp

Offline

Board footer

Powered by FluxBB