Jump to content

Page Field => bidirectional


berechar
 Share

Recommended Posts

Hello everyone,

I'm currently linking several templates to each other thanks to the Page Field.

Whenever I link a Page (A) to another Page (B), I can only see/edit/remove this relationship at Page A, but not on Page B.

Is it possible to also create/see/edit/remove this relationship from Page B? Thus, having a bidirectional Page Field?

Hopefully this is possible, it would be of major help in the administation workflow.

Greetings,

Charlie

Link to comment
Share on other sites

@berechar,

Not possible out of the box, you need to build a module for that.

The good thing is I have a gist that does bidirectional save / remove for 2 pagefields and 2 templates.

You have to change the hard coded values in that gist or B) write a proper configurable module for that.

(Code a module for this? someone? me not having much time, sorry  )

  • Like 4
Link to comment
Share on other sites

What is the reason you need this? If it's for the admin and it would be handy to be able to add links on either page A or B then that makes sense. However if you only need it in a frontend template there are other ways to find what page B is linked to without the need for having the field in both templates.

EDIT: Martijn's code looks like it would do what you want though :)

Link to comment
Share on other sites

  • 2 weeks later...

What is the reason you need this? If it's for the admin and it would be handy to be able to add links on either page A or B then that makes sense. However if you only need it in a frontend template there are other ways to find what page B is linked to without the need for having the field in both templates.

EDIT: Martijn's code looks like it would do what you want though :)

Yes, it's for the admin. This might become a summer project :-)

  • Like 2
Link to comment
Share on other sites

  • 1 year later...

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...