Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
It would be really great if we could panelize the file/%file pages. This is different from #1314876: Provide some ctools content type plugins for working with files in that Panelizer integration is different.
Comment | File | Size | Author |
---|---|---|---|
#24 | file_entity-panels_panelizer_support-1564456-24.patch | 11.95 KB | krisahil |
#17 | 1564456-panels-panelizer-17.patch | 11.84 KB | Lukas von Blarer |
#14 | 1564456-panels-panelizer-14.patch | 11.71 KB | Lukas von Blarer |
#11 | 1564456-panels-panelizer-11.patch | 11.64 KB | logaritmisk |
Comments
Comment #1
Dave ReidActually looks like this might depend on #1314876: Provide some ctools content type plugins for working with files first.
Comment #2
Dave ReidI've pushed what I have so far to a new Git feature branch: http://drupalcode.org/project/file_entity.git/shortlog/refs/heads/156445...
Comment #3
Dave ReidAdding sprint tags.
Comment #4
Dave ReidSo right now, if I go to admin/structure/pages and enable the file/%file page and then click 'Edit', this is what I see and I believe that I should be seeing a 'File panelizer' under 'Variants'
Comment #5
stevectorThere's a module that provides a task plugin to replace other task plugins: Page manager existing pages.
I'm not sure of Earl's opinion as to whether contrib modules should still provide their own task plugins or use something like this instead.
Comment #6
Dave ReidThe view point I'm looking at here is that the majority of file_entity is targeted to move to D8 core. At that time we'll have to move the support for Panels (or whatever we're using in core at that point) to the contrib module out of file_entity, which is consistent with what Panels and Panelizer already do. How does Page manager existing pages change that assumption? I'm confused now on what's the responsibility between the two modules with regards to supporting core entities?
Comment #7
Dave ReidSo one thing I'm blocked on is #1566112: ctools_entity_field_extra_content_type always assumes extra fields are only available from hooks. I've also filed a couple of unrelated PHP notices in CTools and Panelizer.
Comment #8
Dave ReidOnce I added just a normal Panel variant to file/%file, I was able to add file content except for the File > File extra field which I commented on in #7.
Comment #9
Dave ReidComment #10
Dave ReidI need to make sure to include some credit to EclipseGc for the initial patch at #1058098: Add ctools page_manager support for file/%file path
Comment #11
logaritmisk CreditAttribution: logaritmisk commentedMerged branch 1564456-panels-panelizer with 7.x-2.x and created a patch.
Comment #12
Devin Carlson CreditAttribution: Devin Carlson commentedComment #13
Lukas von BlarerAfter applying this patch, I am getting this error:
Fatal error: Declaration of PanelizerEntityFile::get_default_display() must be compatible with that of PanelizerEntityInterface::get_default_display() in /sites/all/modules/file_entity/plugins/entity/PanelizerEntityFile.class.php on line 123
After downgrading Panelizer from 7.x-3.x to 7.x-2.x, it worked. I will try to look into this. Any help is appreciated.
Comment #14
Lukas von BlarerI fixed the error. But Panelizer does not override the normal display mode. What could be missing to do that?
And when using the file template I get this error:
Fatal error: Call to undefined function file_entity_view_page() in /sites/all/modules/file_entity/plugins/tasks/file_view.inc on line 108
Comment #15
Lukas von BlarerI am sorry, the Panelizer functionality does work. But i am not able to actually display the file. When using "File" pane nothing is being displayed. Basically I would like to get the output according to the settings at "Manage file display".
@Dave Reid can you tell me how to do this and I will create a ctools content type plugin for it.
Comment #16
gmclelland CreditAttribution: gmclelland commented@Lukas von Blarer - I haven't tried this, but did you happen to add a file entity context first? See #1314876: Provide some ctools content type plugins for working with files
Comment #17
Lukas von Blarer@gmclelland you are a life safer. Thank you!
I fixed the error in the patch I encountered on the file template as well. What do you think of it?
Comment #18
aaron CreditAttribution: aaron commented#17: 1564456-panels-panelizer-17.patch queued for re-testing.
Comment #20
SocialNicheGuru CreditAttribution: SocialNicheGuru commentedpatch no longer applies to the newest ctools
Comment #21
DamienMcKennaIn case it isn't obvious, please only work on patches to integrate with Panelizer v3, v2 is deprecated and will be marked as "unsupported" RSN: #2151825: META: Drop support for v2?
Comment #22
SocialNicheGuru CreditAttribution: SocialNicheGuru commentedI have gone to admin/structure/pages
I enabled /file/%file
I enable panelizer for file: admin/config/content/panelizer
drush cc
drush rr --fire-bazooka
I now goto /file/add and I am able to add a file ok
I goto node/add and click on my-media content type
I have added field_mymedia of type media
I upload the picture and I get a major error:
PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'file-132-0-page_manager' for key 'PRIMARY': INSERT INTO {panelizer_entity} (entity_type, entity_id, revision_id, name, no_blocks, css_id, css, pipeline, contexts, relationships, did, view_mode, css_class, title_element, link_to_entity, extra) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5, :db_insert_placeholder_6, :db_insert_placeholder_7, :db_insert_placeholder_8, :db_insert_placeholder_9, :db_insert_placeholder_10, :db_insert_placeholder_11, :db_insert_placeholder_12, :db_insert_placeholder_13, :db_insert_placeholder_14, :db_insert_placeholder_15); Array ( [:db_insert_placeholder_0] => file [:db_insert_placeholder_1] => 132 [:db_insert_placeholder_2] => 0 [:db_insert_placeholder_3] => file:image:default [:db_insert_placeholder_4] => 0 [:db_insert_placeholder_5] => [:db_insert_placeholder_6] => [:db_insert_placeholder_7] => standard [:db_insert_placeholder_8] => a:0:{} [:db_insert_placeholder_9] => a:0:{} [:db_insert_placeholder_10] => 0 [:db_insert_placeholder_11] => page_manager [:db_insert_placeholder_12] => [:db_insert_placeholder_13] => H2 [:db_insert_placeholder_14] => 1 [:db_insert_placeholder_15] => a:0:{} ) in drupal_write_record() (line 7219 of /var/aegir/platforms/7/servers/sng-contrib/sng-d7.26-oa-dev/includes/common.inc).
Comment #23
DamienMcKenna@SocialNicheGuru: That was a bug in Panelizer (#2227637: Duplicate entry 'user-1-0-page_manager' for key 'PRIMARY': INSERT INTO {panelizer_entity} ), which was fixed a few days ago. You might try again with a fresh copy of -dev.
Comment #24
krisahil CreditAttribution: krisahil commentedI re-rolled and tested the patch from #14 against latest panelizer 7.x-3.x and file_entity 7.x-2.x.
The Panels and Page Manager integration works well. However, there is still work to do on Panelizer integration (Need Panelizer tab to display when editing a file type; need default variant to display on file_view ctools task, etc.).
Comment #25
DamienMcKennaComment #26
jwang100 CreditAttribution: jwang100 commentedHello, I have applied the latest patch file_entity-panels_panelizer_support-1564456-24.patch and I am not able to get the file page to show up under admin/structure/pages.
I am currently using file entity 7.x-2.0-beta1, panelizer 7.x-3..1, and ctools 7.x-1.5.
Any guidance on this would be appreciated.
Thanks
edit:
I decided to go a different route since I was still not able to get it to work.
I do appreciate the support though.
Thanks!
Comment #27
DamienMcKenna@jwang100: Please don't change the issue category to ask a question. After applying the patch you'll probably need to clear the site's caches in order for the new "file_view" item to show on admin/structure/pages.
Comment #28
jenlamptonI'm not using panelizer, just panels + page manager. Just noting that I'm using this patch and it's working so far, we're overriding file/% and the file view mode is looking great. Thanks for the good work so far!
edit: For those who try this, I should note that I am using the
Entity: Rendered entity
content pane, since both theFile: File
content pane and theFile: File content
content panes were not working yet.Comment #29
DamienMcKennaI suggest this is good to go as-is, and to work on Panelizer improvements in the Panelizer issue queue.
Comment #31
aaron CreditAttribution: aaron commentedCommitted to http://drupalcode.org/project/file_entity.git/commit/9edf35f.
Comment #33
Elijah LynnThis is in 7.x-2.0-beta2 for anyone wondering.