Jump to content

PageArray field, and loading template is slow


Hari KT
 Share

Recommended Posts

Hi Guys,

So I have a template lots of articles .  Approximately 23559 pages .

I have a field article_id in say example template which is of type of PageArray to the articles template.

Now when you try to load that particular template ( example ) PW is becoming slow....

And yes another server we have around 293363 pages and this can grow. So what is the best way to get much speed, or say the PageArray not to load all the stuffs for this is mainly used from an admin point of view.

Any suggestions is welcome.

Thanks

Link to comment
Share on other sites

I have a car loaded with 23 tons of rocks. Now the.car is slow..

PW doesn't load stuff in PageArray except autoload fields. You don't want to load that much pages in memory anyway so you should use limits.

  • Like 1
Link to comment
Share on other sites

@apeisa the template is created via add template . See the edit image .

pw_edit.png

See the article field, which is a PageArray . To load this page (only ) it is slow. I feel the reason is to populate the select box. My question is, whether there is a way not to populate it, and only load a few ones on the initial load.

@Soma : Sorry for the vague question.

Thank you.

Link to comment
Share on other sites

I would suggest changing your input field type (on the page field's Input tab) to PageSelectlist. It is going to be an impossible user experience for someone to scroll down through a select with 23559 items, let alone 293363 items.

Another possibility might be to a Page Auto Complete input field type. This is included in the core modules section, but must be installed before it will be available from the Page field's input tab.

Try those and let us know how you go.

  • Like 1
Link to comment
Share on other sites

@adrain this is basically not shown to users. So no more scrolling. The article field is intended to make it as save an article for future use by the user.

I will look into the Page Auto Complete .

Thanks for the suggestion.

Link to comment
Share on other sites

@apeisa I eneded up at PageListSelect .

Thank you for the suggestion.

@adrian the idea is when a user save an article, we need to get the date and time when the user saved the article.

Say there is a list of articles. When X saved the article for future ( say like twitter favourite ) and at some point of time, he needs to look into the details when he saved it etc.

I have a similar discussion at http://processwire.com/talk/topic/5301-looking-for-some-suggestions-help/

Thank you to all for the help.

Link to comment
Share on other sites

@apeisa I eneded up at PageListSelect .

Hey - that's what I suggested in post #5 above :)

I just typed it as PageSelectlist accidentally!

Anyway, glad you have it working now.

EDIT: Looking at that other post, I think I finally understand things. If you are not actually ever changing the value of this field manually, you could also just store the page ID of the article in a simple text field. You might even want to make it a hidden or locked field.

Edited by adrian
  • Like 2
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...