Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#25 2011-11-14 23:49:24

tye
Member
From: Pottsville, NSW
Registered: 2005-07-06
Posts: 859
Website

Re: smd_browse_by: browse articles, images, files and links by category

I like masa’s solution too :) – but am just wondering what would happen to the table layout if you had a long names in the drop downs… would it break the layout or can you fix that with css?

Offline

#26 2011-11-15 00:00:39

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,250
Website GitHub

Re: smd_browse_by: browse articles, images, files and links by category

tye wrote:

what would happen to the table layout if you had a long names in the drop downs

It’d probably get bigger! And my CSS-fu isn’t that clever to fix it.

One other drawback I just figured of this layout is that you have to have Show Detail on to be able to filter by cat. As it stands you can filter by category without actually seeing the categories on the screen, which is an advantage for small displays. Hmmmmm. Any clever ideas anyone?

Last edited by Bloke (2011-11-15 00:00:59)


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

Txp Builders – finely-crafted code, design and Txp

Offline

#27 2011-11-15 00:05:56

tye
Member
From: Pottsville, NSW
Registered: 2005-07-06
Posts: 859
Website

Re: smd_browse_by: browse articles, images, files and links by category

ok – back to thinking board for me

Offline

#28 2011-11-15 00:14:15

masa
Member
From: Asturias, Spain
Registered: 2005-11-25
Posts: 1,091

Re: smd_browse_by: browse articles, images, files and links by category

Bloke wrote:

One other drawback I just figured of this layout is that you have to have Show Detail on to be able to filter by cat. As it stands you can filter by category without actually seeing the categories on the screen, which is an advantage for small displays.

I was hoping I could sneak this one past you somehow ;)

Any clever ideas anyone?

Couldn’t the categories be displayed by default?

I had noticed that the selects get wider the longer your cat names are or the deeper they’re nested, but I thought there’s a way to limit the select element’s width e.g. max-width?!

Offline

#29 2011-11-15 00:23:37

tye
Member
From: Pottsville, NSW
Registered: 2005-07-06
Posts: 859
Website

Re: smd_browse_by: browse articles, images, files and links by category

masa wrote:

I thought there’s a way to limit the select element’s width e.g. max-width?!

I haven’t tested in a while – but IE (surprize surprize) used to have a huge problem with this – it would make the select and dropdown to the set width, truncating any options which were longer than the width :(

Offline

#30 2011-11-15 10:34:00

sacripant
Plugin Author
From: Rhône — France
Registered: 2008-06-01
Posts: 479
Website

Re: smd_browse_by: browse articles, images, files and links by category

@ Masa: great idea

@ Bloke:

I never understood why there is a pagination? Why limit the number of results? 15 – 50 – 100?

Why not show all by default, even if 1000 results. I can understand for images: too many thumbnails to display. But for the articles, files and links, I see no advantage.

If there are all results.
  • It is possible to use the search function of the browser.
  • It’s easier to just scroll to find. Rather than combine “next page” + scroll, “next page” scroll, etc..
  • It is possible to filter with Javascript (jQuery) without server request.
  • It is possible to filter with multiple criteria (allways with jquery).

I wish this plugin provides an option to remove the pagination and return all results.

what is your opinion?

Offline

#31 2011-11-15 10:49:09

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,250
Website GitHub

Re: smd_browse_by: browse articles, images, files and links by category

sacripant wrote:

I never understood why there is a pagination?

Speed. Displaying thousands of articles takes time and requires lots of scrolling. Also, on mobile devices we don’t want to send squillions of bytes over the wire.

Granted, Txp should allow you to define the limits instead of them being hard-coded at 15, 25, 50 and 100. If that was possible you could remove the limits yourself based on your application. I think that’s the way I’d prefer to go in future.

It’s easier to just scroll to find. Rather than combine “next page” + scroll, “next page” scroll, etc..

You can jump to page, although that can be hit and miss if you have a lot of results! Certainly in modern browsers, the find-in-page feature is very handy, but some people just don’t like typing so we need to cater for the point ‘n’ clickers and, as mentioned above, mobile users.

It is possible to filter with Javascript (jQuery) without server request. It is possible to filter with multiple criteria (allways with jquery).

True and true. But it makes the page heavy. I know people with a few thousand articles. Waiting to load the list and then filtering in jQuery with that amount of data is s-l-o-w. I’ve done that kind of filtering with smd_featured: version one had a live search. In the second version I added a paginated result option because, even with 500 articles, the find operation took a significant time — some seconds. That may not seem a lot, but it’s everything to the perceived speed of the app. Frustrated users are unhappy users.

[EDIT: That’s no disrespect to jQuery: I may have been using a slow approach to filtering and could probably improve things if I re-ordered the data into a Binary Tree or something, instead of a straight list]

I wish this plugin provides an option to remove the pagination and return all results.

That’s not going to happen. The 15, 25, 50 and 100 are so ingrained in the current Txp core that it’s not possible to circumvent it. Sorry.

Last edited by Bloke (2011-11-15 10:52:59)


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

Txp Builders – finely-crafted code, design and Txp

Offline

#32 2011-11-15 16:04:55

sacripant
Plugin Author
From: Rhône — France
Registered: 2008-06-01
Posts: 479
Website

Re: smd_browse_by: browse articles, images, files and links by category

Little test:
list with 15 results: index.php = 6.6ko
list with 50 results: index.php = 9.4 KB
1 result = (9.4-6.6) / 35 = 0.08kb
500 results = 40KB
1000 results = 80KB

Speed. Displaying thousands of articles takes time and requires lots of scrolling. Also, on mobile devices we don’t want to send squillions of bytes over the wire.

In fact (I don’t no if 40kb or 80kb = squillions of bytes :-p)…
I thought to bring a complete list was not so heavy. Just a few extra KB, only code.
And that this would provide a best usability and less server requests.
A single query server, and the page is cached (Edit : No, the browser does not cache the page).

finaly, it’s a bad idea.

Offline

#33 2011-11-15 19:03:56

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,303

Re: smd_browse_by: browse articles, images, files and links by category

I must admit that I tend to set my list prefs to the highest possible values, be it Google search results, be it forum entries, be it TXP’s lists.
I just come from learning that TXP stores the article_list_pageby value in the DB. Could the list speed problem be mitigated by rolling out the storing place from DB (centralised) to a cookie (individualised) like it’s done with toggle_articles_detail? Could the plugin overrule TXP’s reading in data from the DB so that a cookie pref would work independently of an optional, necessary TXP update?


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#34 2011-11-16 12:07:34

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,303

Re: smd_browse_by: browse articles, images, files and links by category

Bloke wrote:

The 15, 25, 50 and 100 are so ingrained in the current Txp core that it’s not possible to circumvent it. Sorry.

Must have managed somehow to miss that out. Forget my post.


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#35 2011-11-16 12:21:30

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,250
Website GitHub

Re: smd_browse_by: browse articles, images, files and links by category

uli wrote:

I tend to set my list prefs to the highest possible values, be it Google search results, be it forum entries, be it TXP’s lists.

Me too.

TXP stores the article_list_pageby value in the DB

Yes. But if you arbitrarily assign any value to it and it doesn’t match one of the 4 pre-defined values, you’ll get the default 15 results out per page. This needs to be altered in the next version of Txp (cf. this closely related topic which also need attention imo)

Last edited by Bloke (2011-11-16 12:21:41)


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

Txp Builders – finely-crafted code, design and Txp

Offline

#36 2012-02-14 16:53:50

philwareham
Core designer
From: Haslemere, Surrey, UK
Registered: 2009-06-11
Posts: 3,564
Website GitHub Mastodon

Re: smd_browse_by: browse articles, images, files and links by category

Really handy plugin. But to be consistent with Txp code structure (such as the core .search-form), the code of the plugin should really have <p> tags included and &nbsp; removed like so…

<div class="smd_browse_by">
    <form method="get" action="index.php">
        <p>Browse by Category: <select name="crit" class="list" onchange="submit(this.form);">
            ...
            </select>
        </p>
        <input type="hidden" value="list" name="event">
        <input type="hidden" value="list" name="step">
        <input type="hidden" value="categories" name="search_method">
        <input type="hidden" value="1b5b962ed1b3e4b3688d7c4fcf67364b" name="_txp_token">
    </form>
    <form method="get" action="index.php">
        <p>Browse by Section: <select name="crit" class="list" onchange="submit(this.form);">
	    ...
            </select>
        </p>
        <input type="hidden" value="list" name="event">
        <input type="hidden" value="list" name="step">
        <input type="hidden" value="section" name="search_method">
        <input type="hidden" value="1b5b962ed1b3e4b3688d7c4fcf67364b" name="_txp_token">
    </form>
</div>

FYI removing the &nbsp; helps admin theme authors when they start looking a creating responsive admin-side themes ;)

Cheers!

Offline

Board footer

Powered by FluxBB