Jump to content

Connect Page Fields


Robin S

Recommended Posts

1 minute ago, a-ok said:

Is there a way to donate to the module’s development or to yourself?

Thanks, but not necessary. Pretty much all my modules get created because I have a need for them in work that I get paid to do, and it doesn't cost me anything to make them available for others to use too.

  • Like 9
Link to comment
Share on other sites

10 hours ago, Robin S said:

Thanks, but not necessary. Pretty much all my modules get created because I have a need for them in work that I get paid to do, and it doesn't cost me anything to make them available for others to use too.

You are why the internet thrives. Thanks, Robin.

  • Like 2
Link to comment
Share on other sites

  • 1 month later...

@Robin S Thanks for an awesome module! ?

Would it somehow be possible to show thumbnails from an image field from the pages? Equal to the Admin on Steroids PageListThumbs?

(Multiple page select, AsmSelect, allow new pages to be created from field)

934747279_Skrmbillede2020-04-23kl_01_33_44.thumb.png.bea8c34c6f35591a00d3160e697ba8b1.png

As you can see when the PageLisThumbs is activated it actually already also applies to the AsmSelect "+ Add" pages overview. 
What I'm interested in knowing is if it could be possible to be able to show these thumbs (from a specified Images-type page field) next to the title in the overview?...

Thanks a lot ?

 

Best,
Jonatan

Link to comment
Share on other sites

Set this up for the first time tonight, works really well over here. Just to save someone else some head-scratching, if you do this:

On 9/14/2017 at 12:30 AM, Robin S said:

If you already have some Page Reference values in place before you start using the module on those fields then you can get things set up with a one-off API operation:


// Get all pages where page_field_a is not empty
$pgs = $pages->find("page_field_a.count>0");
...

Consider adding include=all to your selector to also iterate through unpublished and hidden pages when synchronizing your relationships..

// Get all pages where page_field_a is not empty, including hidden and unpublished pages
$pgs = $pages->find("page_field_a.count>0, include=all");
...

Great work on the module @Robin S, coming in very handy ?

  • Like 3
Link to comment
Share on other sites

4 minutes ago, Andi said:

Consider adding include=all to your selector to also reiterate through unpublished and hidden pages when synchronizing your relationships.

Yes, good tip - thanks.

Also note that if unpublished pages are to be included then the Page Reference fields in question would need to be configured to allow them, because by default they are not.

2020-04-24_095959.png.f43118c3d7591825f59a48d1a695f488.png

  • Like 2
Link to comment
Share on other sites

  • 2 months later...

I just wanted to let you know I ran into an unusual error message with PW 161 revolving around selectors. I was getting a strange popup whenever page creation was operating - stating there was an invalid selector : |

I uninstalled and then reinstalled the plugin and the problem went away. Not entirely sure why that would happen (I clear compiled files, cache etc)

Just thought I would put a note here in case you were able to replicate the issue. I was upgrading from 160 to 161 and I know Ryan was doing a lot of selector work.

  • Like 1
Link to comment
Share on other sites

  • 3 months later...
  • 2 weeks later...

Hi,
Thanks for your module.
I have a question. Does it have a way to sync already existing relationships? Just saving again the page doesn't seems to work, I have to remove and re-add the value.

Thanks!

Link to comment
Share on other sites

  • 9 months later...

@neonwired, as explained a couple of posts above yours, you need to be using PW 3.0.166 or newer (currently on the PW dev branch) to install or upgrade to v0.3.2 of Connect Page Fields.

If you don't want to use the PW dev version then you can manually download Connect Page Fields v0.3.1 by browsing back in the commit history: https://github.com/Toutouwai/ConnectPageFields/tree/99f5e06b959d100a57ab130fa6e6f57ffea19dc9
After you download make sure you rename the module folder from "ConnectPageFields-99f5e06b959d100a57ab130fa6e6f57ffea19dc9" to "ConnectPageFields" before you copy it to /site/modules/ and install it (see "Installing manually").

Link to comment
Share on other sites

  • 2 weeks later...
On 8/4/2021 at 5:54 PM, Robin S said:

@neonwired, as explained a couple of posts above yours, you need to be using PW 3.0.166 or newer (currently on the PW dev branch) to install or upgrade to v0.3.2 of Connect Page Fields.

If you don't want to use the PW dev version then you can manually download Connect Page Fields v0.3.1 by browsing back in the commit history: https://github.com/Toutouwai/ConnectPageFields/tree/99f5e06b959d100a57ab130fa6e6f57ffea19dc9
After you download make sure you rename the module folder from "ConnectPageFields-99f5e06b959d100a57ab130fa6e6f57ffea19dc9" to "ConnectPageFields" before you copy it to /site/modules/ and install it (see "Installing manually").

How come it has that version if it doesn't require it?

Link to comment
Share on other sites

8 hours ago, neonwired said:

How come it has that version if it doesn't require it?

I don't understand the question.

ConnectPageFields <= v0.3.1 requires PW >= v3.0.0

ConnectPageFields >= v0.3.2 requires PW >= 3.0.166

Link to comment
Share on other sites

  • 3 months later...
On 3/4/2020 at 5:53 AM, Robin S said:

v0.3.0 released. Notable changes in this version:

1. Fix for page clone issue reported by @a-ok in the post above.

Thank you for the great module!

Should it still be updating connected fields correctly when duplicating a page with the ProcessPageClone module? I'm on 3.0.186 dev and can't get it to update when cloning a page.

  • Like 1
Link to comment
Share on other sites

1 hour ago, taotoo said:

Should it still be updating connected fields correctly when duplicating a page with the ProcessPageClone module? I'm on 3.0.186 dev and can't get it to update when cloning a page.

I think I've found a fix for this. Please update to v0.3.3 and let me know if that version resolves the issue for you.

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

  • 3 weeks later...

This is a real go-to module - I have used on almost every site! Today maybe I was trying to be a bit too clever and have one of the fields locked (visibility: Open when populated + Closed when blank + Locked (not editable)). I just want the back-link to be viewable, not editable. However, this threw up a fatal error:

Too few arguments to function ProcessWire\RepeaterPageArray::__construct(), 0 passed in M:\laragon\www\Cider\wire\core\WireData.php on line 438 and exactly 2 expected search►

Is there any way of doing this? I guess I can restrict access for certain user types - is that the only way?

Link to comment
Share on other sites

25 minutes ago, MarkE said:

I just want the back-link to be viewable, not editable. However, this threw up a fatal error

I'm not clear on how this relates to the Connect Page Fields module. Could you explain a bit more about how the module is involved in the error?

Link to comment
Share on other sites

11 hours ago, Robin S said:

Could you explain a bit more about how the module is involved in the error?

Sorry @Robin S- it was late at night and the error only happened after I installed ConnectPageFields. On closer inspection this morning, it seems that the error might have been caused by something else. Will report back.

EDIT: The problem seems to be with Repeaters, not ConnectPageFields. Not pursued this further as my solution was to use hidden visibility (which does not cause errors) together with another excellent little module: FieldtypeRuntimeOnly to display the hidden field in a non-editable way, with the link back ?

Edited by MarkE
Update
Link to comment
Share on other sites

  • 3 months later...

I seem to have encountered another problem with repeaters. I am creating repeater matrix items in the API. Different types of such items have different fields which are linked using ConnectPageFields to fields other templates. On creating some matrix types, I am encountering the error "Call to a member function find() on null" for line 132 of ConnectPageFields (v0.3.3), which is

$added = $new_value->find("id!=$old_value");

This error seems to be triggered by $new_value being null. $new_value is set on line 127 as 

$new_value = $page->getUnformatted($this_fname);

With a bit of debugging, it is clear that the module is trying to establish a link for a $this_fname which does not exist for the particular matrix type being added in the API. 

I think I have resolved this by saving the new matrix item before setting its type (so that all fields are present) and then saving again after setting its type.

However, I wonder if it would be better to fix it by a module update. I think that changing line 130 to 

if($this_is_multi && $new_value && $old_value) {

has the desired effect, but have not completely tested it.

Thoughts?

  • Like 1
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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...