-
Notifications
You must be signed in to change notification settings - Fork 10
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
ElementHelper 2.0 #31
Comments
For me it is not working at fully.... 2.3.1 on localhost... It is creating categories and if I create a chunk in the manager a file get created, but if I create a file, it does not create a chunk in MODX... Snippets and plugins are also not created for me.. Template variables are working fine. I got the following errors on install, might be the issue?
|
UPDATE! So it does not work with names like this:
This works fine
|
One thing I'm finding a bit tricky still, is renaming templates.. I want these names to be as clear as possible for clients, so sometimes I change their names to be more descriptive. To do that, you have to disable ElementHelper (to keep ID's the same), change filename to match, and change all template_access references in template_variables.json.. A bit cumbersome. Might it be possible to reference templates by ID for example, and add the name the same way you add a description? Btw: can confirm that EH works the same as above here on localhost with 2.3.1. Same installation errors too.. |
@hugopeek I'm in the same boat in terms of needing to rename templates for clients, I just don't see a clean way to achieve the behaviour, I think you need to maintain the |
@JayCarney Thanks. Can imagine how that would be difficult to implement. Will survive without it though ;) |
@JayCarney & @hugopeek I'm also doing this quite often and never had to disable ElementHelper (at least when I'm the only Admin in the system), ElementHelper just runs for specified user groups (system settings), by default only members of Administrator, so if you need to rename a template, just rename it first in the tree, then rename the file on the server and after that reload the manger page (but don't do it inbetween!), I'm not really using the TV JSON feature, so problems coming from there are not considered in this "workflow". Had a quick scan trough the new code, and would like to say NICE WORK @roryg, looks much cleaner! But did no testing for functionality yet... |
@DESIGNfromWITHIN Nice catch, I've just fixed it so you can include dots in element file names now. The install errors are unrelated but will need to be fixed too! @hugopeek That's a good point, I'll have to think about the best way to achieve that. Adding the ID to a doc comment at the top of the template files might be a possibility but that would mean having something like the following at the top of each template file:
Perhaps that's too much clutter though? @exside Cheers! |
@roryg I wouldn't mind that, but other users might find that to be too much clutter, yes.. Perhaps control this with a system setting? I also found a little quirk when re-installing on 2.3.1: it didn't set the system events of the plugin (onWebPageInit and onManagerPageInit). And another question: EH automatically makes all snippets static now too.. Will this be OK when you update the snippets that were installed through package manager? Or are there scenario's imaginable when the old static file would override the updated database entry? |
I found a big issue! When I use the latest version of Element Helper snippets like Wayfinder become static and get comments on top of the file... This actually breaks the functionality! |
Thanks @DESIGNfromWITHIN @Qaraqter I've made a note of both issues, I haven't had much time to work on it the past couple of weeks but should be able to sort these bugs out hopefully next weekish. Just as a word of caution the plugin hasn't been heavily tested yet and is expected to have several bugs so if you're using it with your work beyond just testing it I would advise keeping regular backups! If you'd like it to ignore plugins and snippets you could try changing the respective paths in the settings to a directory that doesn't exist. |
@roryg I've just recently switched to a MODx setup and came across EH when searching best workflows... seeing the last discussion was 7 months ago, I was curious to find out if you've had any additional time to further develop this? I have the current version running and I love it, but of course, I am looking forward to a production release. Thanks. |
@kevinhamil Yikes time flies! Apologies to all for neglecting this so badly, I'm definitely not abandoning it. I have projects coming up that I'll need ElementHelper for so I will be working on it soon. |
Minor update available here - https://db.tt/SBKhONkV Template Variables will now sync both ways including MIGX tvs. Unfortunately I haven't come up with a good way to sync template variable changes that have been made in the manager yet as Modx doesn't store a timestamp for them, but new TVs made in the manager will be synced to the TV json file. |
@roryg awesome, great news! Thanks. |
I don't know if this is the place to post a question like this, but I'm not sure where else it would be relevant to ask. In the template_variable.json, how would I define a specific Media Source? I can't seem to find how this would be included, or if it can be. Something like... If there's a more appropriate place to ask questions like this let me know. Thanks. |
@kevinhamil There's no way to do that yet but it's definitely a feature I want to include. |
Updated package available here - https://www.dropbox.com/s/8nn1s6k162ynov6/elementhelper-2.0.0-alpha-2.transport.zip?dl=0 I've added a setting for controlling template variable access and fixed the installation errors people were having. I've also added a category whitelist setting which allows you to whitelist categories for ElementHelper to work with. This should help prevent tracking elements that have been created by other Modx extras. |
Any update on this? Can it be made available from within MODX? |
It's almost ready to be available within Modx but there was an issue reported here - #38 - that I'll need to work out first. Hopefully before the year ends! |
Hello @roryg, I definitely second th request from @kevinhamil. |
@jchirschy Yes, it's actually already available in the latest alpha version which you can find here - https://www.dropbox.com/s/5x627zz1cnq1rxw/elementhelper-2.0.0-alpha-3.transport.zip?dl=0 - it probably needs further testing but should hopefully work :) Using it you add a media source to your TV json with the |
Hello @roryg I must say this is a great plugin. I installed from the test build posted above for Modx 2.4.2 However, the error log reports (ERROR @ /manager/index.php) [OnManagerPageInit]. and right after this the log prints the entire code from the articles plugin. If I remove the articles extra, it then starts reporting on the Ace plugin and so on. Anyone experiencing this? |
Hi @Izacktly try adding the plugins causing the issues to the Element Blacklist setting, that should prevent ElementHelper from trying to process them. You might need to uninstall and reinstall the plugins after you've done that. |
Understood. Thank you very much for the quick response! |
ElementHelper 2 is now up on the 2.0 branch, it's not quite finished yet but you can download a transport package for it here (tested and working on Revo 2.3.1). The code has been completely reworked/refactored and I think is much easier to work with now.
One of the biggest differences feature wise is that elements will now be synced both ways, so if you create an element in the manager a static file will be created for the element and vice versa. (This doesn't work for template variable elements to the template_variables.json file yet.)
There are a number of things still left to do:
The text was updated successfully, but these errors were encountered: