Skip to content
This repository has been archived by the owner on Aug 10, 2021. It is now read-only.

Add Partial Support #63

Closed
tfitts opened this issue Jul 3, 2012 · 7 comments
Closed

Add Partial Support #63

tfitts opened this issue Jul 3, 2012 · 7 comments

Comments

@tfitts
Copy link

tfitts commented Jul 3, 2012

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.

@radar
Copy link

radar commented Jul 4, 2012

Would it be possible to add a data-hook to the page and get Deface to insert the partial there?

@peterberkenbosch
Copy link
Member

that could only be done on the page/show file. not in the page.body that gets saved in the database.

@radar
Copy link

radar commented Jul 5, 2012

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?

@ethier
Copy link

ethier commented Jul 19, 2012

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.

@ethier
Copy link

ethier commented Jul 19, 2012

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...

@radar
Copy link

radar commented Jul 20, 2012

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.

@ethier
Copy link

ethier commented Jul 23, 2012

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.

peterberkenbosch added a commit that referenced this issue Jul 24, 2012
Issue #63 - Add partial support
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants