Skip to content
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

Backend preview stylesheet #302

Closed
yellowled opened this issue Feb 13, 2015 · 11 comments
Closed

Backend preview stylesheet #302

yellowled opened this issue Feb 13, 2015 · 11 comments
Milestone

Comments

@yellowled
Copy link
Member

Pretty sure the preview in the entry editor is bugged at least for some themes. I did some tests and could not get the backend iframe preview to generate the proper stylesheet.

See http://board.s9y.org/viewtopic.php?p=10441958#p10441958

@yellowled yellowled added this to the 2.0.x milestone Feb 13, 2015
@yellowled
Copy link
Member Author

Seems like the issue here is that some templates now use {$serendipityHTTPPath}{$serendipityRewritePrefix}serendipity.css, which does not have a cache busting version string. With these themes, the entry preview needs a hard refresh in the browser for the stylesheet to be loaded properly. However, in these themes (in their preview_iframe.tpl), {$head_link_stylesheet} does not work properly, either.

@yellowled
Copy link
Member Author

I think the best solution here would be a generic function to add the cache busting version string to any CSS or JS asset in Smarty templates. That would also be helpful for frontend theme authors.

@garvinhicking
Copy link
Member

Sadly that's not easy, it would require all custom getfile calls with a new param; because the cache string needs to be appended with "?" For url-rewritten blogs but "&" for non-rewritten ones...

On 14.03.2015, at 14:29, Matthias Mees notifications@github.com wrote:

I think the best solution here would be a generic function to add the cache busting version string to any CSS or JS asset in Smarty templates. That would also be helpful for frontend theme authors.


Reply to this email directly or view it on GitHub.

@yellowled
Copy link
Member Author

Well, the option would be to find out how to make {$head_link_stylesheet} work in these themes' preview_iframe.tpl or to just live with it for the time being and see if we can find a way to implement a better preview (see #218).

garvinhicking added a commit that referenced this issue Mar 18, 2015
     CSS file, including cache-busting version string when changing
     themes

References #302
garvinhicking added a commit that referenced this issue Mar 18, 2015
     CSS file, including cache-busting version string when changing
     themes

References #302
@garvinhicking
Copy link
Member

I've now committed a new tpl var that properly references the frontend, and includes the cache-busting string... please check and reopen if it doesn't work for you guys or I misunderstood

cc @donchambers

@yellowled
Copy link
Member Author

Works. Excellent, I had already given up on this. ;-)

Why do we still need the fallback to serendipity.css?

@garvinhicking
Copy link
Member

For users with s9y < 2.0.2

(we could remove that fallback for 2k11 and other themes, but I'm too afraid that users will user that as a copy&paste draft, and then a fallback could help...)

@yellowled
Copy link
Member Author

Wouldn't it make more sense to incorporate the version check and fallback into the generation of {$head_link_stylesheet_frontend} so that theme authors can only use that variable in preview_iframe.tpl? I.e. if version < 2.0.2, $head_link_stylesheet_frontend == serendipity.css …?

@garvinhicking
Copy link
Member

$head_link_stylesheet_frontend does not exist in < 2.0.2, so no.

@donchambers
Copy link
Member

It does seem to work.. however, the html being emitted upon save (and perhaps other states, such as error) is coming from 2k11: <span class="msg_success"><span class="icon-ok-circled"></span> Your entry has been saved</span>

So, unless a template has those classes, they will not appear as they do in the 2k11 theme.

So, can we get those messages emitted by a theme's specific preview_iframe instead of 2k11?

@yellowled
Copy link
Member Author

That is a different issue, though. This should probably be discussed along with #218.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants