Please login or register.

Login with username, password and session length
Advanced search  

News:

You need/want an older version of sNews ? Download an older/unsupported version here.

Pages: 1 [2] 3

Author Topic: Another article menu  (Read 13197 times)

Joost

  • Guest
Re: Display an image on a category
« Reply #15 on: October 19, 2007, 06:10:14 pm »

i tried this smart mod in my web site. but it calls a image(i inserted the kod top the center() ) in all pages/articles/contact/sitemap/archive/ and even in all of adminstrator related pages.
what can i do for this problem.
Thank alot from the Turkey.
You mean the same picture is called everywhere? There's no logic to that. Please explain what you've done differently.
Logged

codetwist

  • Hero Member
  • *****
  • Karma: 50
  • Posts: 940
Re: Another article menu
« Reply #16 on: October 19, 2007, 07:57:36 pm »

Well, it's quite liberal usage of terms category and page and all; and not only in this thread IMHO. Beginning sNews user  might as well expect that image(s) are really displayed for category 'pages' and only form them ;) But it's not exactly so, is it?
Logged

Joost

  • Guest
Re: Another article menu
« Reply #17 on: October 20, 2007, 05:12:47 am »

Well, it's quite liberal usage of terms category and page and all; and not only in this thread IMHO. Beginning sNews user  might as well expect that image(s) are really displayed for category 'pages' and only form them ;) But it's not exactly so, is it?
Problem is, there are no strict definitions of terms, at least not that I am aware of. So we have to rely upon the contextual meaning of words. In this case (thread) a clear solution was provided for a clear problem: One specific image per category (category wide, that is).
Defining terms would be a good thing. category 'pages' for instance: Are these articles belonging to a category or category-indexes (as I like to name them)?
Logged

codetwist

  • Hero Member
  • *****
  • Karma: 50
  • Posts: 940
Re: Another article menu
« Reply #18 on: October 20, 2007, 09:24:13 am »

I don't see the problem to distinguish between category 'page' and category articles. And in default sNews there is simple but pretty strict 'definition' of default 'page' types used anyway:
- home
- homepage
- built-in
- pages
- categories
- articles

Agreed that definitions for above isn't formally written but pretty obvious anyway - it's usually is called as built. AFAIK as built is only thing that really matters for delivered stuff ;) And I'd assume that good approach for MOD building would be harmless extension of those by means of adding new types/subtypes, not blurring existing ones. So, I don't think that problem is lack of definitions as such; it's more like writing for example term category and thinking something much longer and elaborate IMHO.
Logged

Joost

  • Guest
Re: Another article menu
« Reply #19 on: October 20, 2007, 05:29:15 pm »

Thanks for explaining. So what your saying is: Articles belong to a category, but are not a part of a category.
So in your opinion I should have said: This will display a different image in each category and the articles that belong to that category.
instead of: This will display a different image in each category.
If that's the case, it might be a language barrier. In Dutch there is hardly any distinction whether something is in a category or belongs to a category.
I hope you see what I mean, since I almost last track. ???
Logged

codetwist

  • Hero Member
  • *****
  • Karma: 50
  • Posts: 940
Re: Another article menu
« Reply #20 on: October 20, 2007, 10:02:52 pm »

Might be ... I think that it gets called as well on home and built-ins trying to display some image. But again it's not big deal; I just thought that some clarifying might help with follwing: when something like get_id('category') is used it doesn't mean category at all - it means just first url parameter which sometimes is category and sometimes it's home and sometimes it's some built-in seftitle. I just can see that happens - aha, it's category in code, it's category in instructions ... so, all I need for enabling specific image for categories or specific category only to use that image output snippet as is :D Anyway, I'm not sure if there is some really hard track to keep at ;D So, let's change ??? to ;)
Logged

Joost

  • Guest
Re: Another article menu
« Reply #21 on: October 21, 2007, 03:38:27 am »

... I think that it gets called as well on home and built-ins trying to display some image.
Just this line would have been sufficient.... some posts ago.  I think.... ::) :-X :-[ ??? Corrected now.
"liberal usage of terms" discussion got me heading in a different direction.
Logged

Fred K

  • Still trying to learn stuff
  • ULTIMATE member
  • ******
  • Karma: 130
  • Posts: 2728
    • Personal
Re: Another article menu
« Reply #22 on: December 09, 2007, 07:07:47 pm »

Joost, could you explain the purpose for the span (id="artikel") in the mod? Is it merely for styling purposes or some /*a-hem*/ higher end? I have little patience for unnecessary details -- as in details I don't understand -- and this one tickles the corner of my eye, if you know what I mean.

I assume it has a real role to play, otherwise it wouldn't be in there -- right?
Logged

Joost

  • Guest
Re: Another article menu
« Reply #23 on: December 09, 2007, 07:33:55 pm »

id= "artikel" is for css styling of the current article.
I've chosen to style a span instead of li. A matter of choice.

You donŽt wanna know, but I tell you anyway. ;D ŽartikelŽ is Dutch for article.
Logged

Fred K

  • Still trying to learn stuff
  • ULTIMATE member
  • ******
  • Karma: 130
  • Posts: 2728
    • Personal
Re: Another article menu
« Reply #24 on: December 09, 2007, 10:14:09 pm »

Quote from: Joost
ŽartikelŽ is Dutch
Heeeell no, it's Swedish. Or, Danish. Or, Norwegian. Or, whatever. German.

Interestingly, you could skip an entire element then. By setting <li class="artikel">... instead of <li><span id="artikel">... as I see it, if the span is only for styling purposes, it is unnecessary.
(just in case you'd like to know).
Logged

Joost

  • Guest
Re: Another article menu
« Reply #25 on: December 10, 2007, 12:15:30 am »

Quote from: Joost
ŽartikelŽ is Dutch
Heeeell no, it's Swedish. Or, Danish. Or, Norwegian. Or, whatever. German.

Yes, Dutch is a influential language.  ;D

A span can be handy when styling with backgrounds, margins and paddings. Not all can be done through the wrapping element.
Logged

Fred K

  • Still trying to learn stuff
  • ULTIMATE member
  • ******
  • Karma: 130
  • Posts: 2728
    • Personal
Re: Another article menu
« Reply #26 on: December 10, 2007, 04:28:48 am »

Quote
A span can be handy when styling with backgrounds, margins and paddings. Not all can be done through the wrapping element

I don't entirely agree with you --the only reason to use a span in this context would be if you want it floated to one side-- but that's actually irrelevant. You have answered my question, and I should just say 'thank you'.

Thank you. ;)
Logged

Joost

  • Guest
Re: Another article menu
« Reply #27 on: December 10, 2007, 05:14:23 am »

Now I am curious, puzzled.  ???
Lets say I have the following

li     {background:#fff; padding: 4px; }
li a  {background:red; padding: 4px;}

The current 'li' doesn't have an 'a' that I can style. My solution is:
li              {background:#fff; padding: 4px; }
li #artikel  {background:blue; padding: 4px;}
Of course I can add an image in the background, but I like to keep it fluid.


How would you solve this without an element?
Make me feel stupid, please.

Thanks in advance :)
Logged

Fred K

  • Still trying to learn stuff
  • ULTIMATE member
  • ******
  • Karma: 130
  • Posts: 2728
    • Personal
Re: Another article menu
« Reply #28 on: December 10, 2007, 01:40:33 pm »

Quote from: Joost
How would you solve this without an element?
I know you're not stupid, Joost, but this one is simple: The li itself is the element.

I'm guessing that you have a list where each item has a red background, except the one that acts like "current", which has a blue background. Maybe a different text color as well.
If that is the extent of the style changes you want to achieve, then this output will give you that opportunity:
Quote
<ul>
<li>Bla bla bla</li>
<li id="artikel">I'm Current!</li>
<li>Bla bla bla</li>
</ul>

CSS:
Quote
li {background: red; color: white; padding: 4px}
li#artikel {background: navy; color: lime;  padding: 8px;}

There are of course situations when using a span has its merit -- say for instance that you want to keep the same main background color as for the other li's, but also set a different background color and text color, slightly inset within the current li. Then the <li><span id="artikel">I'm current too!</span></li> would have a place.

CSS
Quote
li {background: red; color: white;}
li span#artikel {background: black; color: aqua; margin: 4px; padding: 4px;}

However, my main reason for asking about the span is that when doing a mod, introducing bits that are unnecessary for normal use can create a new set of problems or questions. Things like hard-coded styling or excessive, hard-coded, elements. Maybe some will have the need for the span in order to be able to create special FX, but I don't think that Joe Average will. I know I won't.

For normal use, I think that <li id="aktiv">I'm currently active!</li> is entirely sufficient.
(Aktiv, btw, is a Swedish word, meaning "active". ;D)
« Last Edit: December 10, 2007, 01:46:00 pm by Fred K (agentsmith) »
Logged

Joost

  • Guest
Re: Another article menu
« Reply #29 on: December 10, 2007, 06:06:21 pm »

Not a direct answer. So here is an example.

http://www.perceptieman.tomaatnet.nl/silly_me.html

How do I style 'li class' the same as 'span class' ?

FYI Fred. I hesitated before adding the span. In most situations, it is not needed. However, lesser gods might need it.
Still if if you have a magical solution. I really like to know.
« Last Edit: December 10, 2007, 06:17:52 pm by Joost »
Logged
Pages: 1 [2] 3