Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-01-04 06:07:05

rahul
New Member
Registered: 2006-01-04
Posts: 9

Multiple CSS files, homepage questions

Dear All:

I recently (yesterday) started playing with TP, and was pretty blown away by what I could do. However, I do have some questions.

I’d like to attach multiple stylesheets to a single section; for example, I’d like to attach a global.css to most pages, with some inside.css to certain pages.

What is the best way of doing this?

The other question I have is that I’d like to customise what is displayed on the home page of the site that I’m working on. It will be mostly static content, with some links to recent articles/events, etc. How do I do this?

Here’s a link to a static mockup of what I’m trying to achieve.

Home Page
http://www.littleandreid.com/mentaid/
Inside Page
http://www.littleandreid.com/mentaid/about.html

This is the TP-based version (inside page).

http://www.littleandreid.com/mentaidyn/about/

How do I create the home page? Which section do I post the article under?

Any help is appreciated. :-)

Thanks in advance,
Rahul Gonsalves.

Offline

#2 2006-01-04 06:49:51

zem
Developer Emeritus
From: Melbourne, Australia
Registered: 2004-04-08
Posts: 2,579

Re: Multiple CSS files, homepage questions

I’d like to attach multiple stylesheets to a single section; for example, I’d like to attach a global.css to most pages, with some inside.css to certain pages.

New in the FAQ.

For the rest, see pointers here.


Alex

Offline

#3 2006-01-04 07:11:29

Jeremie
Member
From: Provence, France
Registered: 2004-08-11
Posts: 1,578
Website

Re: Multiple CSS files, homepage questions

To use multiple stylesheets, you also could cascade and import them. Inside one, use an import rule.

Example : on my current work, I have one stylesheet for the whole website. But one section has to have a slightly different rule for a specific div.

So I create a second stylesheet within TXP, called whaterver, with in it :

<code>@import url(http://www.thewebsite.com/textpattern/css.php?s=default);
div#corps {
the new rules I need for that div
}
</code>

And then I link this “whatever” stylehseet to the section.

Offline

#4 2006-01-04 16:12:09

rahul
New Member
Registered: 2006-01-04
Posts: 9

Re: Multiple CSS files, homepage questions

Thanks Alex. This worked exactly like I’d hoped. I’m still working on the other static/non-static thingy.

You can link to additional stylesheets on the same page by referring to them by name. Create another style (under presentation > styles) and add an extra line to your template like this:

<link rel=“stylesheet” href=”<txp:css n=“my_style_name” />” type=“text/css” media=“screen” />

The n parameter specifies the name of the stylesheet. Read more at TextBook.

You can link to additional stylesheets on the same page by referring to them by name. Create another style (under presentation > styles) and add an extra line to your template like this:

<link rel=“stylesheet” href=”<txp:css n=“my_style_name” />” type=“text/css” media=“screen” />

The n parameter specifies the name of the stylesheet. Read more at TextBook.

Offline

Board footer

Powered by FluxBB