no css styles in news details

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
User avatar
thomahawk
Power Poster
Power Poster
Posts: 306
Joined: Fri Jul 25, 2008 10:13 am
Location: Zug, Switzerland

no css styles in news details

Post 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
User avatar
DIGI3
Dev Team Member
Dev Team Member
Posts: 1660
Joined: Wed Feb 25, 2009 4:25 am
Location: Victoria, BC

Re: no css styles in news details

Post 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.
Not getting the answer you need? CMSMS support options
User avatar
thomahawk
Power Poster
Power Poster
Posts: 306
Joined: Fri Jul 25, 2008 10:13 am
Location: Zug, Switzerland

Re: no css styles in news details

Post 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
User avatar
creopard
Forum Members
Forum Members
Posts: 71
Joined: Fri Nov 10, 2017 10:25 am
Location: .de
Contact:

Re: no css styles in news details

Post 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:

Code: Select all

<!DOCTYPE html> 
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.
User avatar
thomahawk
Power Poster
Power Poster
Posts: 306
Joined: Fri Jul 25, 2008 10:13 am
Location: Zug, Switzerland

Re: no css styles in news details

Post 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
User avatar
DIGI3
Dev Team Member
Dev Team Member
Posts: 1660
Joined: Wed Feb 25, 2009 4:25 am
Location: Victoria, BC

Re: no css styles in news details

Post 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.
Not getting the answer you need? CMSMS support options
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am
Location: Arizona

Re: no css styles in news details

Post by Dr.CSS »

I see this on all your page sources...
doctype.png
User avatar
thomahawk
Power Poster
Power Poster
Posts: 306
Joined: Fri Jul 25, 2008 10:13 am
Location: Zug, Switzerland

Re: no css styles in news details

Post 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.
User avatar
thomahawk
Power Poster
Power Poster
Posts: 306
Joined: Fri Jul 25, 2008 10:13 am
Location: Zug, Switzerland

Re: no css styles in news details

Post 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.
User avatar
creopard
Forum Members
Forum Members
Posts: 71
Joined: Fri Nov 10, 2017 10:25 am
Location: .de
Contact:

Re: no css styles in news details

Post 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

Code: Select all

$config['show_base'] = true;
in your config.php respectively.
agelababypp
New Member
New Member
Posts: 1
Joined: Thu May 16, 2024 8:52 am

Re: no css styles in news details

Post 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.
blahblahwhatever
New Member
New Member
Posts: 7
Joined: Fri Dec 30, 2022 3:32 pm

Re: no css styles in news details

Post 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?
Post Reply

Return to “CMSMS Core”