Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 [2] 3 4

Author Topic: [MOD] Body and ID, a modification I need help with!  (Read 15139 times)

bryn

  • Hero Member
  • *****
  • Karma: 2
  • Posts: 934
    • http://www.cssugly.com
[MOD] Body and ID, a modification I need help with!
« Reply #15 on: March 01, 2006, 10:19:08 am »

You basically place this wherever you want a particular piece of code to be displayed under the conditions you write in the code Patric..

So what your effectively saying is..'if these conditions are met, then display this block of code'.

You could also add an Else statement to it that means 'otherwise..display this'

If you think about it in relation to your 4 column template design, then set the code to display whole column divs only if certain conditions are met..but of course as Albert pointed out this can be done with css alone as well.

It will take some playing around with but Luka's code is easy to implement once you think logically about your page content ;D
Logged
Over 1,000 posts of joy, sNews is not only brilliant, but fun too! thanks guys :D

Tjobbe

  • Full Member
  • ***
  • Karma: 0
  • Posts: 112
    • http://www.farstyle.com
[MOD] Body and ID, a modification I need help with!
« Reply #16 on: March 01, 2006, 10:44:27 am »

I've been trying the following;

Code: [Select]
echo "personal";
} else if (get_id('article') == "Web Design") {
echo "webdesign";
} else if (get_id('article') == "Contact") {
echo "contact";
} else {
echo "home";
} ?>">

but all it is doing is calling id="home" when i select a different category.

what it should do is rename the body id depending on the category selected, what is it im doing wrong?
Logged

Patric Ahlqvist

  • Nobodys perfect, but Im pretty effing close
  • ULTIMATE member
  • ******
  • Karma: 65
  • Posts: 4867
  • I'm a self-made man and worships my creator.
    • p-ahlqvist.com
[MOD] Body and ID, a modification I need help with!
« Reply #17 on: March 01, 2006, 01:07:19 pm »

Ok, this is way above my horizon as I have no other "skills" but CSS, and they are limited...but I'll give it a go later ;) possible help might exist if it goes down the crapper ??
Logged
"It's only dead fish that goes with the flow... "
Updated

Luka

  • Administrator
  • ULTIMATE member
  • ******
  • Karma: 36
  • Posts: 1717
    • http://www.snewscms.com
[MOD] Body and ID, a modification I need help with!
« Reply #18 on: March 01, 2006, 01:08:38 pm »

Patric, it's pretty simple.

The code looks like this:

if {



}

Inside put your div's which you want to display when you're on home page.
Logged

Patric Ahlqvist

  • Nobodys perfect, but Im pretty effing close
  • ULTIMATE member
  • ******
  • Karma: 65
  • Posts: 4867
  • I'm a self-made man and worships my creator.
    • p-ahlqvist.com
[MOD] Body and ID, a modification I need help with!
« Reply #19 on: March 02, 2006, 11:07:11 am »

Ok...got it. I am at the spot where I can show/hide certain div's, excellent guy's. However, there are some issues of course, hehe...never should be easy, right ? Ok, code on index.php so far:

Code: [Select]
include ("snews.php"); ?>



















News paperish Design









Navigation






Past entries:











"archives" AND get_id('category') <> "contact") { ?>













"archives" AND get_id('category') <> "contact") { ?>

















Ok what I need now is, when klicking a link eg contact, or the actual article, to call a special class or CSS to show the "wider content"... As it is now it just hide's the other columns, but the width of the center is intact.

And please, hehe...this looks like hell in Moz, not good in Ie but better, Ah, gonna concentrate on getting it to work as I want first I guess, then pay attention to the style issues ;)
Logged
"It's only dead fish that goes with the flow... "
Updated

Patric Ahlqvist

  • Nobodys perfect, but Im pretty effing close
  • ULTIMATE member
  • ******
  • Karma: 65
  • Posts: 4867
  • I'm a self-made man and worships my creator.
    • p-ahlqvist.com
[MOD] Body and ID, a modification I need help with!
« Reply #20 on: March 02, 2006, 11:10:18 am »

Ok, solved some small issues in the presentation bit, but the above still remains :(
Logged
"It's only dead fish that goes with the flow... "
Updated

Luka

  • Administrator
  • ULTIMATE member
  • ******
  • Karma: 36
  • Posts: 1717
    • http://www.snewscms.com
[MOD] Body and ID, a modification I need help with!
« Reply #21 on: March 02, 2006, 11:15:29 am »

OK, you told it to display those contents only when viewing the front page.

And you closed by this

Now, try to do this one:



Display a wider column...

Logged

Patric Ahlqvist

  • Nobodys perfect, but Im pretty effing close
  • ULTIMATE member
  • ******
  • Karma: 65
  • Posts: 4867
  • I'm a self-made man and worships my creator.
    • p-ahlqvist.com
[MOD] Body and ID, a modification I need help with!
« Reply #22 on: March 02, 2006, 11:34:57 am »

You're not nice ;)... Ok I'll give it a go, hehe...

Nope, all blank ;)...did this as I have no idea of where to put the else:
Code: [Select]
"archives" AND get_id('category') <> "contact") { ?>










And that didn't work, hehe...WHERE DO I PUT IT ??? ;)

Thjis is what I wanna put in:
Code: [Select]




Nothing wrong in that, eh ?
Logged
"It's only dead fish that goes with the flow... "
Updated

Luka

  • Administrator
  • ULTIMATE member
  • ******
  • Karma: 36
  • Posts: 1717
    • http://www.snewscms.com
[MOD] Body and ID, a modification I need help with!
« Reply #23 on: March 02, 2006, 11:36:19 am »


Code: [Select]


"archives" AND get_id('category') <> "contact") { ?>













You've entered wrong brackets.

Logged

Patric Ahlqvist

  • Nobodys perfect, but Im pretty effing close
  • ULTIMATE member
  • ******
  • Karma: 65
  • Posts: 4867
  • I'm a self-made man and worships my creator.
    • p-ahlqvist.com
[MOD] Body and ID, a modification I need help with!
« Reply #24 on: March 02, 2006, 11:45:58 am »

FUCK ME ! I got it, hehe...this is funny. Thanks a million Luka for your...encouragement, hehe...

Code: [Select]
"archives" AND get_id('category') <> "contact") { ?>

     

         
     




"archives" AND get_id('category') <> "contact") { ?>

 



   

               

"archives" AND get_id('category') <> "contact") { ?>

   

     
   



Now there's the style issue, that is fecked up...I'll have to be back on that later, it's the content class that for some reason will not show it's background-color in Moz...in IE it looks like it should...for now anyway...
Logged
"It's only dead fish that goes with the flow... "
Updated

Luka

  • Administrator
  • ULTIMATE member
  • ******
  • Karma: 36
  • Posts: 1717
    • http://www.snewscms.com
[MOD] Body and ID, a modification I need help with!
« Reply #25 on: March 02, 2006, 11:55:41 am »

Hehe, be gentle to yourself P...
Logged

Patric Ahlqvist

  • Nobodys perfect, but Im pretty effing close
  • ULTIMATE member
  • ******
  • Karma: 65
  • Posts: 4867
  • I'm a self-made man and worships my creator.
    • p-ahlqvist.com
[MOD] Body and ID, a modification I need help with!
« Reply #26 on: March 02, 2006, 11:59:31 am »

Will do, oh great one ;)
Logged
"It's only dead fish that goes with the flow... "
Updated

Patric Ahlqvist

  • Nobodys perfect, but Im pretty effing close
  • ULTIMATE member
  • ******
  • Karma: 65
  • Posts: 4867
  • I'm a self-made man and worships my creator.
    • p-ahlqvist.com
[MOD] Body and ID, a modification I need help with!
« Reply #27 on: March 02, 2006, 12:31:46 pm »

Hey...another thing...you know things solved give more things to do, right ? I have the categorie in hmenu right now. If I click that it shows in the narrow center column...It shouldn't of course...Hint please ??

I have fiddudled some with that piece of code above, but that can't do as it tells the index to show all four columne unless article, contact or archives is clicked then it expands to the whole width. But categories ?? I tried to add <> "category" AND get_id('category') in different places, hehe...but I don't know what the hell I'm doing ;) Again - Hint, please ?
Logged
"It's only dead fish that goes with the flow... "
Updated

Patric Ahlqvist

  • Nobodys perfect, but Im pretty effing close
  • ULTIMATE member
  • ******
  • Karma: 65
  • Posts: 4867
  • I'm a self-made man and worships my creator.
    • p-ahlqvist.com
[MOD] Body and ID, a modification I need help with!
« Reply #28 on: March 02, 2006, 12:41:15 pm »

*Ok, never mind...;) Hihi. i see what happens once put an article in a cat. Silly 'ol me ;) Need help on that content class though...

I can't get that class to show it's background color in FF...In IE it shows, and that white box appears, but in FF the different functions (in a class for each) only shows that #fff background...??

TEY ANOTHER EDIT --> ok forget this aswell... ;). I won't tell you what i didn't do, hehe
Logged
"It's only dead fish that goes with the flow... "
Updated

bryn

  • Hero Member
  • *****
  • Karma: 2
  • Posts: 934
    • http://www.cssugly.com
[MOD] Body and ID, a modification I need help with!
« Reply #29 on: March 03, 2006, 01:16:12 am »

glad you got this working Patric finally..good stuff eh? ;D
Logged
Over 1,000 posts of joy, sNews is not only brilliant, but fun too! thanks guys :D
Pages: 1 [2] 3 4