Jump to content
bytesource

PageTable Documentation

Recommended Posts

Hi, 

I have heard about the new field type PageTable available in the next version of Processwire (2.5) that is supposed to work like repeaters but with much better performance characteristics. 

That got me interested, but I haven't been able to find any further information of how to use this new field type.  

Did I miss some thread, or does PageTable work just like a Repeater? 

Cheers, 

Stefan

Share this post


Link to post
Share on other sites

Not sure if there are any instructions posted yet, but if you install the module from the core list, the setup of a new field with this type is well documented. I am sure you'll get the hang of things from playing around for a few minutes.

There is some discussion about PageTables from this post onwards:

https://processwire.com/talk/topic/6417-processwire-profields-table/?p=62890

  • Like 2

Share this post


Link to post
Share on other sites

adrian, 

Thanks for your answer. Now I have a good reason to play around with the dev branch  ;)

Cheers, 

Stefan

Share this post


Link to post
Share on other sites

I finally found some time to try out the new PageTable field type, but I ran into some problems.

I created a field sidebar_slogans of type PageTable and set up the table fields like this:

headline=33
summary=33
image=33

However, after assiging sidebar_slogans to a template, I was not able to add any data in the admin. Clicking on the cells did nothing (please see the attached screenshot).

Maybe PageTitle does not support the field types of my custom fields? These field types are as follows:

headline: TextLanguage

summary: TextareaLanguage

image: PageImage

I have installed Processwire version 2.4.3.

Any ideas of how to solve this problem are highly welcome!

Cheers,

Stefan

post-855-0-02029700-1403080563_thumb.png

post-855-0-83261600-1403080604_thumb.png

Share this post


Link to post
Share on other sites

I found my mistake.

I assumed adding the names of the custom fields to be displayed in the admin would automatically add them to the selected template. This, however, is not the case. So after also adding each custom field to the template, everything was working.

  • Like 1

Share this post


Link to post
Share on other sites

Did you manage to get it to actually display an image?

Share this post


Link to post
Share on other sites

Hi Pete,

In the end I only needed the two textarea fields headline and summary, so I did not try out the image field.

Cheers,

Stefan

Share this post


Link to post
Share on other sites

Image fields work fine, just not very practical to display on the table if you have multiple images. In that case it's better just remove them from the list.

post-88-0-05855200-1408693578_thumb.png

post-88-0-58490700-1408693578_thumb.png

Share this post


Link to post
Share on other sites

Hmm... didn't work with a single image for me. Do you just put in "image" (my field name) to have it display?

Share this post


Link to post
Share on other sites

I'm wondering about the page tables and how it closes when you hit save - i think it would be better if this behavior was configurable, because some of my templates run actions on save, so i sometimes need to save a page a few times when editing..

but then the modal window closes every time i hit save, so i basically end up going over to the child pages tab and editing directly on the page to avoid editing in the modal with the close issue...

Share this post


Link to post
Share on other sites

On 2.5.3 the images don't seem to be respecting their widths, which is odd. Inspect element is telling me the column is 20% width but the reality is a huge image. Strange.

Share this post


Link to post
Share on other sites

I'm wondering about the page tables and how it closes when you hit save - i think it would be better if this behavior was configurable, because some of my templates run actions on save, so i sometimes need to save a page a few times when editing..

but then the modal window closes every time i hit save, so i basically end up going over to the child pages tab and editing directly on the page to avoid editing in the modal with the close issue...

Provided an example on this post how to prevent it using hooks. It would be great to have this supported natively though, so such "hacky" tricks wouldn't be needed.

  • Like 2

Share this post


Link to post
Share on other sites

can anybody confirm that images don't display when you have them in the first column?

post-2137-0-16918600-1424168415_thumb.pn

post-2137-0-14373900-1424168414_thumb.pn

v2.5.19

Share this post


Link to post
Share on other sites

I think this is on purpose. The first row does always provide the link, which does show/hide the edit / view links. I think it was different some time ago, but it didn't feel nice, to be honest, to click the image and have the extra links appearing besides it, maybe even barely fitting in the rows. I really don't remember images in the first row being a good idea.

  • Like 1

Share this post


Link to post
Share on other sites

hm.. you're right, those links would maybe feel strange beside the image - but i don't have those links in my setup. it just opens a modal to edit the item and that would totally be ok with a linked image in my opinion :)

Share this post


Link to post
Share on other sites

Just found that with 2.6.13 dev the image preview is broken...see

https://github.com/ryancramerdesign/ProcessWire/issues/1353

can anybody confirm this?

Another question - wich isn't much a problem for me but if you upload a image in a pagetable page imagefield - i first get the image preview if i save the pagetable page?

Using PageTableExented module, too.

regards mr-fan

Share this post


Link to post
Share on other sites

hi mr-fan,

seems that you are using croppableimage - have you tried it with the standard image field? maybe i can try to reproduce it lateron.

ps: ads, not adds ;)

Share this post


Link to post
Share on other sites

Ok i', little silly on my english labels...thanks for that... :-[

created a new normal image field on this and it looks the same...

Share this post


Link to post
Share on other sites

Hmm... didn't work with a single image for me. Do you just put in "image" (my field name) to have it display?

Hi... like Pete I have trouble putting images in PageTable to display in the frontend. How did you do it?

Edit:

Got it solved. It had to do with my syntax. Now it works without any problems.

Share this post


Link to post
Share on other sites
On 3.9.2017 at 5:10 PM, hellomoto said:

Oh is it only supposed to populate via api? 

You need a bit of coding experience but we can help you.

 

Share this post


Link to post
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

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...