Add Partial Support #63
Comments
Would it be possible to add a data-hook to the page and get Deface to insert the partial there? |
that could only be done on the page/show file. not in the page.body that gets saved in the database. |
Indeed, but you could add an element to that page which is unique to that particular static page and define a Deface hook for that unique element. Unless I'm missing something super obvious? |
I don't think it will work (and I just tried). The content is pulled from the database after the Deface overrides are applied. It does not locate the elements in the page. I tried both the static_content/show and layouts/spree_application virtual paths. |
I don't think this would be that difficult. Maybe modify the determine_layout method to return the spree_application + layout file, rather than just the layout file itself? Unless I'm missing something... |
The content is pulled after the deface overrides are run? What code is doing the content loading? Deface overrides are applied when the template is being rendered, which is (I thought) after ERB pre-processing has been completed. |
It certainly looks like it. The static_content/show view is rendered through spree_application so using either as a virtual_path does not work in Deface. The static_content/show view includes a raw insert on the page content from the database. If you include a data-hook in that content, Deface will not see it and apply the override. I've sent a pull request that adds some partial support. See 65. |
Issue #63 - Add partial support
It would be great if there was a way to insert a partial into the page body. This would allow static page to show information that may need to be calculated in real time and be able to reuse some content that is already available through other partials.
The text was updated successfully, but these errors were encountered: