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
[Doc] EZP-27293: Add content and edit views #31
[Doc] EZP-27293: Add content and edit views #31
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very minor language fixes
docs/add_content_and_edit_views.md
Outdated
# Add content and edit views | ||
|
||
To able to add and edit Content Item with our Field Type using PlatformUI, we need to create an edit view. | ||
The content view will also be needed to display correct information when viewing Content Item in "Content structure" tab in PlatformUI. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The content view will also be needed to display correct information when viewing the Content item in the "Content structure" tab in PlatformUI.
docs/add_content_and_edit_views.md
Outdated
|
||
### Template file | ||
|
||
First, we need to add template file that will be responsible for displaying an edit form: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First, we need to add a template file that will be responsible for displaying an edit form:
docs/add_content_and_edit_views.md
Outdated
path: bundles/ezsystemstweetfieldtype/js/views/fields/ez-tweet-editview.js | ||
``` | ||
|
||
We need to prepend this configuration, analogically like we did with our template. To do this, we have to edit dependency injection extension: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to prepend this configuration, like we did with our template. To do this, we have to edit dependency injection extension:
docs/add_content_and_edit_views.md
Outdated
``` | ||
|
||
Remember to dump your assets before trying to run this code for the first time. | ||
After this is done, we should be able to edit Content Item containing our Tweet Field Type. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After this is done, we should be able to edit the Content Item containing our Tweet Field Type.
docs/add_content_and_edit_views.md
Outdated
|
||
### Template file | ||
|
||
First, we need to add template file that will be responsible for displaying content of our Field Type: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First, we need to add a template file that will be responsible for displaying the content of our Field Type:
docs/add_content_and_edit_views.md
Outdated
|
||
### Registering the view | ||
|
||
We also need to add to the already created configuration information about our freshly created files. To achieve this, let's add the following snippet to the `yui.yml` file: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We also need to add information about our freshly created files to the already created configuration.
``` | ||
|
||
After these steps you should see correct information when viewing Content Item in "Content structure" tab in PlatformUI. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe worth repeating the warning about dumping assets (if it applies here as well)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, this is just necessary after creating the first file Resources/public directory. After the first dump, the symlink is created, so it is no longer necessary.
The above is true unless someone is installing assets as hard copies instead of symlinks, but then he/she should be already aware that he/she should dump the assets every time any file from the Resources/public directory is changed or added.
I have added your fixes. Thanks @DominikaK! |
1984d98
to
d9c14d2
Compare
docs/add_content_and_edit_views.md
Outdated
|
||
### Registering the view | ||
|
||
We also have to create the YML file where we will tell the system to use our files. The example configuration looks like this: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the YAML file (with an A)
docs/add_content_and_edit_views.md
Outdated
path: bundles/ezsystemstweetfieldtype/js/views/fields/ez-tweet-editview.js | ||
``` | ||
|
||
We need to prepend this configuration, like we did with our template. To do this, we have to edit dependency injection extension: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding some link to this topic from our Documentation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It isn't documented in our documentation since it's a Symfony feature. Also, it was already done in the previous step, here we are just adding next config file.
I will update the code snippet to include the whole class so it's more clear what is edited.
docs/add_content_and_edit_views.md
Outdated
|
||
### Javascript view file | ||
|
||
Next, we need to implement Javascript file that will be responsible for hendling the template: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo here: "handling" with an a
@mere-teresa thanks for the review. I have added the fixes you requested. |
a0f7bf8
to
bb7da07
Compare
Documentation changes reflecting code changes from #30.