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.

Author Topic: Modify template  (Read 3099 times)

stephane

  • Full Member
  • ***
  • Karma: 6
  • Posts: 194
Modify template
« on: May 22, 2007, 03:48:30 pm »

Hello,
I'm a new user of this nice CMS. I've made a French version (1.6). I hope you can understand my post here  :|

Actually I tried to figure how I can change all the template. I don't really know PHP language.
All my site are in xhtml - transitionnal, with CSS. I only use DIV to create my pages.

I use to create differents pages with differents DIV to put the text in it. So I'm a little confuse with SQL DB and PHP structur.

1/ Is it a obligation to use all the differents menu (Left and Top right) that use in the default index.php (default template) ?

2/ If not, how can I hide some of them, for example --> Archives menu ? I tried to put a # in front of the line in the snews php file, but it doesn't work :mad:

Well I think that enough for the moment ! I will come back soon with a lot of another questions  :)

Thank's to all
Stéphane
Logged

maaanu

  • Newbie
  • *
  • Karma: 0
  • Posts: 48
    • http://illegalcommand.org
Modify template
« Reply #1 on: May 22, 2007, 05:07:27 pm »

I think you can hide some things directly in index.php.
Commenting in html is made by ""

Comments in php are made with "//" (for a single line) or "/* thing to comment */" (for multiple lines).

Maybe commenting a whole function isn't a good idea if you don't know what you're doing.
Try looking at the things you want to hide. They are diplayed with "echo 'something';". Hide them with html comment -> "echo '';"

Hope this will help you... (if understandable... :/)
Logged

bramsyuur

  • Hero Member
  • *****
  • Karma: 23
  • Posts: 873
    • http://snews.vietbee.net
Modify template
« Reply #2 on: May 22, 2007, 05:23:07 pm »

Hi Stéphane!
To hide, in your case, the link to "Archives" use:
(Inside of the function "Pages()")
Quote
// $class = ($categorySEF == 'archive') ? ' class="current"' : '';
// echo '<li><a'.$class.' href="'.db('website').'archive/" title="'.l('archive').'">'.l('archive').'</a></li>';
The answer to your fist question is... yes and no. You're free to use only the functions that you need. But, functions like "Center" or "Pages" (maybe "Categories" if you have created, too) are mandatory for the correct work of sNews.
« Last Edit: August 22, 2007, 01:39:48 am by Phil Martin »
Logged
La comunidad sNews en tu idioma!
Comunidad sNews en Español

stephane

  • Full Member
  • ***
  • Karma: 6
  • Posts: 194
Modify template
« Reply #3 on: May 22, 2007, 05:48:12 pm »

Thank's bramsyuur (and maaanu),

It's working perfectly.

In the fact, I want to use Top right menu (page, contact, site map (not sure)) in a right vertical div. And I don't want to use :
breadcrumbs / Categories / Articles, etc... But maybe, it's not a good idea to use sNews in this way ?

I try to change the H2 attribut only for Pages Title, is that possible ?
Actually, I put a H3 style, but this one is apply on all title, even result of Submit button. Or maybe I can apply another style for those Title (only the one appear on page --> flield Title in the Edit mode) I try with a div class but it doesn't work.

I hope this clear enough, hum  :/

Thank's. And sorry for my stupids questions about transforming all the template !

S.
Logged

maaanu

  • Newbie
  • *
  • Karma: 0
  • Posts: 48
    • http://illegalcommand.org
Modify template
« Reply #4 on: May 23, 2007, 02:47:36 am »

Quote from: stephane
In the fact, I want to use Top right menu (page, contact, site map (not sure)) in a right vertical div. And I don't want to use :
breadcrumbs / Categories / Articles, etc... But maybe, it's not a good idea to use sNews in this way ?
I think you can do that by hiding categories and articles in index.php, then styling your top right menu (to be displayed verticaly).

Quote from: stephane
I try to change the H2 attribut only for Pages Title, is that possible ?
Actually, I put a H3 style, but this one is apply on all title, even result of Submit button. Or maybe I can apply another style for those Title (only the one appear on page --> flield Title in the Edit mode) I try with a div class but it doesn't work.
I don't really understand... maybe you can show us your site, so we can see what your problem is.
Logged

stephane

  • Full Member
  • ***
  • Karma: 6
  • Posts: 194
Modify template
« Reply #5 on: May 23, 2007, 03:33:36 pm »

For the menu on left it's ok. For categories, articles, etc... I don't have to hide them, I just don't call the php function in my index page.

On my index page I just call php functions : Title / Pages and extra

I don't have web site online for the moment, I just make some test on local server. I'm running OS X with Mamp.

But it's ok, I find where this style is apply in the  php source, I think so  :)

it's here -->
Code: [Select]
'id', $r['category']);
$title = $r['title'];
if ($r['displaytitle'] == 'YES') {echo '<h3>'.(strlen($text) > $shorten ? $link.$category.'/'.$r['seftitle'].'/" title="'.$title.'">'.$title.'</a>' : $title).'</h3>';}
I just create a h3 style like I want and apply it. But maybe I can apply a class instead of h3 style but don't know how ?
« Last Edit: August 22, 2007, 01:40:23 am by Phil Martin »
Logged