| Admin Generator: Further enhancement beyond symfony's capability [message #33583] |
Fri, 17 August 2007 19:22  |
sfxpt Messages: 339 Registered: January 2007 Location: Canada |
Faithful Member |
|
|
Hi,
I had always been wondering, how can I make use of the existing Admin Gen generated code, save and use them somewhere else, then twist it further which might beyond symfony's capability, or as the last step to arrange the input fields better, eg, group several entries on one line instead of spreading them vertically, etc.
Plese help/comment.
In the meantime, I notice an interesting topic going on at:
http://www.symfony-project.com/forum/index.php?t=msg&th= 7947&start=0&
Which indicates that, there are at least 3 ways doing so:
- twist directly in cache, which face the problem that the changes can be overwritten at any moment.
- copy them to myapp/modules/module/template folder, and twist there.
- or change theme if you want to make the changes happen automatically.
Furthermore, instead of the current list/edit actions, can we add our own actions, eg, view1, view2, so that we can have multiple views to the same module? Ref, currently the symfony AdminGen interface lacks the possibility to have multiple views to the same module (msg posted at http://www.symfony-project.com/forum/index.php?t=msg&th= 7705),
thanks
[Updated on: Fri, 17 August 2007 19:26] http://xpt.sourceforge.net/techdocs/
http://xpt.sourceforge.net/tools/
|
|
|
| Re: Admin Generator: Further enhancement beyond symfony's capability [message #34330 is a reply to message #33583 ] |
Tue, 28 August 2007 14:39   |
 |
lvanderree Messages: 651 Registered: June 2007 Location: Netherlands |
Faithful Member |
|
|
I think you answered your first question yourself.
You can copy the files from cache to your module/template folder and alter them there.
If you want to have multiple items in one column I think you should take a look at http://www.symfony-project.com/book/trunk/14-Generators#List View-Specific Customization and see how you can use a "stacked" layout.
If you want to have these changes in more than one module it is wise to change your theme instead.
--
about your second question, about I think a good solution is to create a second module for the same object, but give it an other name. So
symfony propel-init-admin app module2 Object
and edit your generator too match it for your other view, maybe change the action.yml file to redirect the edit action to the first module and change the actions.yml file of the first module to redirect you back to module2 once you have saved your changes.
An other solution for your second problem would be to add this capability in your theme as well. Which is probably even nicer.
[Updated on: Tue, 28 August 2007 14:45] Leon
|
|
|
| Re: Admin Generator: Further enhancement beyond symfony's capability [message #34345 is a reply to message #34330 ] |
Tue, 28 August 2007 16:12   |
sfxpt Messages: 339 Registered: January 2007 Location: Canada |
Faithful Member |
|
|
about your second question, about I think a good solution is to create a second module for the same object, but give it an other name. So
symfony propel-init-admin app module2 Object
yeah, that's a good idea, I thought of that after my OP, and tested it. Unfortunately, I wasn't able to make it working.
I didn't trying the action.yml method, but I just checked:
Search www.symfony-project.com/book/trunk/
Your search - action.yml - did not match any documents.
http://www.google.com/search?ie=UTF-8&oe=UTF-8&domai ns=www.symfony-project.com%2Fbook%2Ftrunk%2F&sitesearch= www.symfony-project.com%2Fbook%2Ftrunk%2F&q=action.yml&a mp;btnG=search
I actually don't want any redirection. I want the new "view" has a different list view and different edit fields. For ex, I'd like to have the 2nd view to have most fields readonly, ie, only able to change selected few fields, and disable the "create" action.
I managed to get the module2 working by inherit the db object back from module (the original one), but the problem is that the config/generator.yml was from the original one as well. I don't know how to tell symfony to use the generator.yml from my module2, so the new view is useless to me for my above request.
http://xpt.sourceforge.net/techdocs/
http://xpt.sourceforge.net/tools/
|
|
|
|
|
| Re: Admin Generator: Further enhancement beyond symfony's capability [message #34352 is a reply to message #34348 ] |
Tue, 28 August 2007 17:31   |
sfxpt Messages: 339 Registered: January 2007 Location: Canada |
Faithful Member |
|
|
| lvanderree wrote on Tue, 28 August 2007 10:44 | . . . Both fields and actions can be linked to a credential and if the user doesn't have the credential the field or button won't be shown. . .
|
Hmm, I want the create button not shown to everybody, So I just tried:
object_actions:
_edit: ~
actions:
_create: { credentials: [no_exist] }
But the create button is still there.
any suggestions?
http://xpt.sourceforge.net/techdocs/
http://xpt.sourceforge.net/tools/
|
|
|
| Re: Admin Generator: Further enhancement beyond symfony's capability [message #34353 is a reply to message #34352 ] |
Tue, 28 August 2007 17:37   |
sfxpt Messages: 339 Registered: January 2007 Location: Canada |
Faithful Member |
|
|
| sfxpt wrote on Tue, 28 August 2007 11:31 | . . . I want the create button not shown to everybody, So I just tried:
_create: { credentials: [no_exist] }
|
It works.
> But the create button is still there.
do not log in as admin.
http://xpt.sourceforge.net/techdocs/
http://xpt.sourceforge.net/tools/
|
|
|
|
| Re: Admin Generator: Further enhancement beyond symfony's capability [message #34374 is a reply to message #34355 ] |
Tue, 28 August 2007 21:26   |
sfxpt Messages: 339 Registered: January 2007 Location: Canada |
Faithful Member |
|
|
hmm, strange, strange. I tried in my demo project with
symfony propel-init-admin backend post2 Post
and it works as you described.
I'm wondering why it didn't work when I first tried. Here is the log that I dig out.
symfony propel-init-admin management art_imgs ArtInfo
>> dir+ /var/www/art/apps/management/modules/art_imgs/actions
>> file+ /var/www/art/apps/management/mo..._imgs/actions/actions.class.php
>> dir+ /var/www/art/apps/management/modules/art_imgs/config
>> file+ /var/www/art/apps/management/mo...s/art_imgs/config/generator.yml
>> tokens /var/www/art/apps/management/mo..._imgs/actions/actions.class.php
>> tokens /var/www/art/apps/management/mo...s/art_imgs/config/generator.yml
but when browsing
http://localhost/art/management_dev.php/art_imgs/
I get:
Fatal error: Class 'autoart_imgsActions' not found in /var/www/art/apps/management/modules/art_imgs/actions/action s.class.php on line 11
hmm. I'm so curious why it didn't work that I redid it again, and it works this time!
Thanks again for helping out. Otherwise, I'd still have the wrong impression, and will carry it on forever...
Thanks!
[Updated on: Tue, 28 August 2007 21:27] http://xpt.sourceforge.net/techdocs/
http://xpt.sourceforge.net/tools/
|
|
|
|
|
|