Page 1 of 1
no css styles in news details
Posted: Sun May 12, 2024 2:00 pm
by thomahawk
I just installed cmsms 2.2.19
After setting up my templates and some content, I struggle now with the news detail view, it shows up without css. I have already set up a specific page to display it in and made sure that page is used and it is
{news detailpage="news-detail"}
now what specially confuses me is, in content editor when I look at the preview tab of the news article, it looks perfectly fine including CSS styles.
But when I go to the frontend of my website and click the detail link from the news summary, the page comes up without any CSS. The link to the stylesheets looks fine when I check the sourcecode, it looks identical to the normal content pages which show correctly with CSS.
I already deleted the cache in cmsms. No change.
Appreciate any hints.
Regards
Tom
Re: no css styles in news details
Posted: Sun May 12, 2024 2:14 pm
by DIGI3
Hard to say without seeing it, but perhaps there's a mixed content issue? Check the console to see if there's any warnings. If that's not it, make sure the html validates. Feel free to share a link if you need further help.
Re: no css styles in news details
Posted: Sun May 12, 2024 2:19 pm
by thomahawk
thanks for the input, Digi
So far I found no other solution then to hardcode the link to all stylesheets in the main template of my site. Not how it should be, but it works for now.
Looks like a bug to me, specially because it works in the preview.
this is the site in progress
https://www.ziegelei-museum.ch/2024/index.php
Re: no css styles in news details
Posted: Mon May 13, 2024 10:55 am
by creopard
Looking at the HTML source shows that the "<!DOCTYPE" header uses XHTML syntax and it does not start at line 1.
This will switch browsers into "quirks mode"
you should replace the XHTML doctype by:
your template should start with {process_pagedata} using {strip} and {/strip}:
Code: Select all
{strip}{process_pagedata}
<!DOCTYPE html>
.....
{/strip}<head>{strip}
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>{$title}</title>
{metadata|strip}
{cms_stylesheet|strip}
....
{/strip}</head>
When using {cms_stylesheet} you can open the CSS file "/tmp/cache/stylesheet_combined_longstring.css" and see if any linked CSS file in your design manager is missing. Also the sorting in the design manager could be relevant.
Re: no css styles in news details
Posted: Mon May 13, 2024 4:52 pm
by thomahawk
thank you creopard, but the template is exactly like your example
<!DOCTYPE html ...
identical to the standard minimal template that comes with cmsms
Re: no css styles in news details
Posted: Mon May 13, 2024 4:55 pm
by DIGI3
I wasn't able to reproduce this as a bug, but if you're able to make a copy of the page and template with the cms_stylesheet method so we can see the problem in action, that would be helpful (we may notice something you missed). Otherwise if you can give us steps to reproduce the problem in a clean installation, please file a bug report so we can work on a fix.
Re: no css styles in news details
Posted: Mon May 13, 2024 10:49 pm
by Dr.CSS
I see this on all your page sources...
Re: no css styles in news details
Posted: Mon May 13, 2024 10:51 pm
by thomahawk
yes like I said, the styles links are correct, and the pages are displayed correctly in preview, but from the frontend, CSS is not rendered.
Re: no css styles in news details
Posted: Tue May 14, 2024 6:15 am
by thomahawk
well I must correct my last post: Right now the css links are hardcoded and that way everything is working. It was before with relative links that css was not rendered in the frontend, only in backend preview, despite the links in sourcecode looked exactly the same as they do now.
Re: no css styles in news details
Posted: Tue May 14, 2024 7:55 am
by creopard
thomahawk wrote: ↑Mon May 13, 2024 4:52 pm
thank you creopard, but the template is exactly like your example
<!DOCTYPE html ...
identical to the standard minimal template that comes with cmsms
I'm puzzled, because your current site does not look as it's based on the minimal template.
As Dr. CSS already mentioned, the HTML source looks completely different.
You can also try to set
Code: Select all
<base href="https://www.ziegelei-museum.ch/">
in the <head> section of your template and see if that helps when using the {cms_stylesheet} tag.
or use
in your config.php respectively.
Re: no css styles in news details
Posted: Thu May 16, 2024 8:54 am
by agelababypp
thomahawk wrote: ↑Mon May 13, 2024 10:51 pm
yes like I said, the styles links are correct, and the pages are displayed correctly in preview, but from the frontend, CSS is not rendered.
papa's games
I also have the same problem, please tell me the correct way to handle it.
Re: no css styles in news details
Posted: Sun May 19, 2024 10:12 am
by blahblahwhatever
@agelababypp please post a link : )
@thomahawk looking at
https://www.ziegelei-museum.ch - checking news, everything looks good?
news details?
https://www.ziegelei-museum.ch/news/125 ... -Aspermont
https://www.ziegelei-museum.ch/2024/index.php#top here I just can't click anything on news? Because under it there is a calendar?