Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove site dependency on element select field #44

Closed
monachilada opened this issue Nov 23, 2018 · 7 comments
Closed

Remove site dependency on element select field #44

monachilada opened this issue Nov 23, 2018 · 7 comments

Comments

@monachilada
Copy link

Would you consider removing the hardcoded relation criteria to elements within the current site, to enable selecting elements across sites?

Looking into the code, it appears even if this were to be accepted, it would require a change in core that would allow the _includes/forms/elementSelect macro to respect the showSiteMenu setting in the Craft.BaseElementSelectInput JS function.

I've filed a pull request for that anyway, as it seems like an oversight: craftcms/cms#3494. If this were to be accepted it would pave the way to implementing something like this in the plugin.

@sebastian-lenz
Copy link
Owner

sebastian-lenz commented Nov 23, 2018

Hi and thank you for your suggestion. Sounds like a good idea, I'll have an eye on your pull request.

@monachilada
Copy link
Author

UPDATE: Pull request was accepted and will be in the next release: craftcms/cms#3494

To the plugin changes needed, is it just a matter of removing the site related conditions in the ElementLinkType model and updating the templates to take advantage of the change? If so I'm happy to give it a go and make a pull request. Or am I missing something?

@sebastian-lenz
Copy link
Owner

Well, if I understand your problem correctly we also would have to store the id of the site the user has selected? That's also what Brandon Kelly mentioned in the other issue.

@monachilada
Copy link
Author

You're right. I just played around on a local fork and it would indeed have to store a reference to the siteId. I got stuck on what to do next at that point though, it's outside of my understanding of the plugin (and plugins) in general on where that type of thing would be stored.

@sebastian-lenz
Copy link
Owner

Yeah, I will have to take a look at this. The element selection currently only stores an integer as this is all what's needed to refer to another element. In this case we must store a small structure but obviously we don't want to break existing installations.

I also want to add the ability to add custom queries and fragments to those element urls (as I just stumbled upon this problem in a current project)and this functionality also requires the ability to store extra data along the element id. Once we have this, storing the site id should be easy.

@monachilada
Copy link
Author

That's great. Let me know if you want help testing or anything like that.

@sebastian-lenz
Copy link
Owner

This feature is part of the 2.0 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants