Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-07-15 18:26:14

WhiteDog
Member
From: Maine
Registered: 2005-09-07
Posts: 174

Can articles have different styles?

I have a total of about 8 sections. I want to be able to use articles to fill the diffrent sections but i need to ahve the articles use differnet headings. Example some will use h1 as their title and have blue type, while others will use h2 and have images in them, and still others will use h3 with grey type.
Also i need different articles to be able to have chromeless popup windows to just the image <txp:image popup /> ????

Is this possible to do?

Thanks again

Last edited by WhiteDog (2006-07-15 18:26:36)


Grrr RRR nnndth grrr Skeek!

Offline

#2 2006-07-15 20:05:26

NyteOwl
Member
From: Nova Scotia, Canada
Registered: 2005-09-24
Posts: 539

Re: Can articles have different styles?

You can create the different colour schemes as classes in css and then use different article forms and the if_section tag to pick which schema to use. The popup should just be a matter of adding some javascript. (Note implementation is seldom as simple as explaination * grin *)


Obsolescence is just a lack of imagination. / 36-bits Forever! / #include <disclaimer.h>;

Offline

#3 2006-07-15 20:08:20

jm
Plugin Author
From: Missoula, MT
Registered: 2005-11-27
Posts: 1,746
Website

Re: Can articles have different styles?

It’s completely possible. A few options:

  • Use txp:if_section on your default page (<txp:if_section name="news"><h3><txp:section title="y" /></h3</txp:if_section>)
  • Use different pages for sections (Presentation>Section>Use Page template)

In either case, you can use forms to output headers and other specific parts. For changing the style for specific sections, you can add a section id to the body.

<pre>
&lt;body id=&quot;&lt;txp:section /&gt;&quot;&gt;

//will produce the following when in the &quot;news&quot; section

&lt;body id=&quot;news&quot;&gt;

//CSS

#news h3 {color: #006}
#news { background: #eee }
</pre>

For popup windows, get a copy of a fine unobtrusive script, and configure a class, say thumb. Just guessing here on the TXP code:
<pre>
//js
popupLinkConfig[“thumb”] = new Array ( “”, “width=350,height=350,left=0,top=0”);
//txp
&lt;a href=&quot;&lt;txp:permlink /&gt;&quot; class=&quot;thumb&quot;&gt;&lt;txp:excerpt /&gt;&lt;/a&gt;
</pre>

Last edited by deldindesign (2006-07-15 20:55:14)

Offline

#4 2006-07-15 20:10:41

WhiteDog
Member
From: Maine
Registered: 2005-09-07
Posts: 174

Re: Can articles have different styles?

Wow great thank you very much


Grrr RRR nnndth grrr Skeek!

Offline

#5 2006-07-16 13:59:28

WhiteDog
Member
From: Maine
Registered: 2005-09-07
Posts: 174

Re: Can articles have different styles?

In case anyone is curious I found Mary’s upm_image and upm_popup incredibly useful to acheive a popup image

ok thanks again


Grrr RRR nnndth grrr Skeek!

Offline

Board footer

Powered by FluxBB