Home N-13 News Forums Help Search
RegisterForgot password?
How to add image to post necklacesdiscou
Known bugs - 4.0.3 necklacesdiscou

Latest N-13 News 4.0.3

What is N-13 News?
Where can I get help?
Known bugs

Forums How To Using "ONEORTWO" to stripe output?
Rayc
Posted on 03 Jun 2012, 14:12:47

Access: Member
Total Posts: 74
Joined: 2010-06-13

I'm interested in attempting to "stripe" the news short story listing using the "oneortwo" parameter. What I'd like to do is apply a different background colour to each item to visually separate the listed articles.

I understand that when something like class="title_{oneortwo}" is encountered, the script will alternate between style class title_one and title_two. But I'm not sure where I would go about defining these classes.

Does this get defined right in the template? If so, where? And how?

If anyone has a template that incorporates this, I'd appreciate a copy. I could suss it out by using that as an example.

( This is where that Template Export/Import feature comes in handy. ;-) )

Any tips, pointers or hand-holding appreciated.

Ray

#3884
Chris
Posted on 03 Jun 2012, 14:55:59

Access: Admin
Total Posts: 1395
Joined: 2006-05-19

Styling {oneortwo} is fairly straight forward. When you use it in your template like so

<span class="article_{oneortwo}">{article}</span>

When viewing your news the system will alternate between outputting

<span class="article_one">{article}</span>

and

<span class="article_two">{article}</span>

You can then style those articles using some css

.article_one {
...
}
.article_two {
...
}
#3885
Rayc
Posted on 03 Jun 2012, 15:04:18

Access: Member
Total Posts: 74
Joined: 2010-06-13

Thanks, Chris.

Does that CSS

  .article_one {
  ...
  }
  .article_two {
  ...
  }

get included in the template somehow?

Or must I create the styles in my site CSS file externally to N-13 News?

#3886
Last edited by Rayc at 2012-06-03 15:26:59 Reason: formatting
Chris
Posted on 03 Jun 2012, 15:44:10

Access: Admin
Total Posts: 1395
Joined: 2006-05-19

You put that css in your site css file. You don't include it in the template.

So on the page which you include your news into, say for example that page is http://example.com/index.php and that page uses a css file http://example.com/css/main.css, that css file is where you would put that sample css code.

#3887
Rayc
Posted on 03 Jun 2012, 16:04:05

Access: Member
Total Posts: 74
Joined: 2010-06-13

Got it.

The templates have so much CSS in them, I assumed I had to wedge it in there somehow. :-D

Sláinte.

Ray.

#3888
Network-13.com © 2013