Problems, need help? Have a tip or advice? Post it here.
4 posts Page 1 of 1
Hello all,

I've been following the blog tutorial to make a news section for my website. I'm a bit confused as to where I am supposed to style the pages though.

Do i include the css files to both blog.php and blog_list.html?

Does the html have to match both perfectly?

http://influxgaming.com/testsite/#t3
The news section is on that page of my website and looks a bit broken atm
blog_list.html is just a snippet that is embedded into blog.php. You should call your CSS files in blog.php.

If the list-view and page-view use two different CSS files (normally they probably wouldn't), then you can use conditional statements to include the right file.
Code: Select all
<cms:if k_is_page>
   <link rel="stylesheet" type="text/css" href="<cms:show k_site_link/>styles/page-view.css" />
<cms:else/>
   <link rel="stylesheet" type="text/css" href="<cms:show k_site_link/>styles/list-view.css" />
</cms:if>
Thanks for the quick reply, i'll give that a go in my code. I'm currently only going to be using the list view though will that cause any problems? The way I have it i only display 1 post on list view and then i embed that page as an object onto my other page.

I'd then make sure I don't post more than "word limit here"
Please forgive me, Kr1llbo. It's been a long time since I've been through the tutorial. So just forget what I said previously. You may curse my idiocy :x under your breath if it helps.

Yes, you do want to include your CSS files in both the blog.php and blog_list.html code.

The way the template is written, it entirely changes the code from top to bottom depending on whether it is the list-view or page-view. The html code in the two does not have to match. In fact, that is the whole point: to serve an entirely different page depending on the circumstances.

I'm currently only going to be using the list view though will that cause any problems?
No. You can use or not use any part of the template as you choose.
4 posts Page 1 of 1