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: [Solved] questions about subcategories, extra contents, and default settings  (Read 2308 times)

BryonWells

  • Newbie
  • *
  • Karma: 0
  • Posts: 3

Hello everyone, I'm a new user of Snews, and I've been especially impressed by how simple it was to integrate my own design, and not have rigid template requirements.

I have three simple (hopefully) questions. The site is http://www.MorganCunningham.net.

1) Is it possible to have subcategories? eg, under the "Attorneys" page have several pages describing each of the partners?

2) How do I change the default settings so that when a new article is created comments are off, and it is set to go into a category other than "Home"?

3) Using extra contents, I have created a box with contact information that appears at right on most pages. How do I hide it while I am in the admin area? It is taking too much space, and scrunching up the admin functions.

Thanks
« Last Edit: November 06, 2007, 06:26:54 am by philmoz »
Logged

mike1

  • Full Member
  • ***
  • Karma: 6
  • Posts: 199

Hello everyone, I'm a new user of Snews, and I've been especially impressed by how simple it was to integrate my own design, and not have rigid template requirements.

I have three simple (hopefully) questions. The site is http://www.MorganCunningham.net.

1) Is it possible to have subcategories? eg, under the "Attorneys" page have several pages describing each of the partners?

2) How do I change the default settings so that when a new article is created comments are off, and it is set to go into a category other than "Home"?

3) Using extra contents, I have created a box with contact information that appears at right on most pages. How do I hide it while I am in the admin area? It is taking too much space, and scrunching up the admin functions.

Thanks

1.  Not yet.  It is being worked on though.
2. http://snewscms.com/forum/index.php?topic=4824.0 will fix the commenting.  I dunno about the home.
3.  dont know
Logged

ad_267

  • Jr. Member
  • **
  • Karma: 7
  • Posts: 57

1. You could set up attorneys to be a category and instead of displaying all three articles in this category you could have a list of articles, one for each attorney.

3. I don't know either
Logged

Keyrocks

  • Doug
  • ULTIMATE member
  • ******
  • Karma: 449
  • Posts: 6020
  • Semantically Challenged
    • snews.ca

Welcome to the sNews project Bryon.
1. EQ and I are both working on a sub-categories mod... EQ primarily, and me assisting and exploring a bit more. It's semi-working, but has a ways to go yet.

2. When publishing a new article, click the "Customize" panel-link below the textarea panel, then choose your category from the "categry" drop-down, then click the submit button... or edit button when in the Edit article mode. In the same "Customize" panel, alsu un-check the "Enable Comments" and the article will not be commentable.

3. It is not possible to have the information box not displayed when logged in as Admin. Looking at the source code for your page, it appears that you have the info-box hard-coded in your index.php file within <div class="rbox">, just above where your <?php center(); ?> function string is inserting the center function's (from within snews.php) dynamically-generated content. If it is hard-coded in the index.php file, the sNews engine cannot have any control over its' display.

You could turn the info-block into a image.png, upload the image to an images folder, and include the image within the actual article or page content, so that it displays within the dynamically-generated content. This way, it will not display when the Admin Panels are on-screen.

My solution would be to add the additional contact information into the function that generates the Contact page, so that it displays within the Contact page above the form elements. You would not need an e-mail address in the additional contact info... since all form submissions are already sent to the e-mail address assigned in the Settings >> Contact panel. This eliminates the problem associated with e-mail address harvesters mining a hard-coded e-mail address off a physical page... since the Contact Form is virtual (not physically present) and generated on the server on demand.

There are a couple of ways to add the additional content information to the Contact page.
1. Add the script within function contact() (in snews.php), or
2. put the script into a new file of its own, and include the content from the file into function contact() with one, single include string.

« Last Edit: November 04, 2007, 10:17:37 pm by Keyrocks »
Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU

codetwist

  • Hero Member
  • *****
  • Karma: 50
  • Posts: 940

@BryonWells : With 3rd You might have better luck just adding two additional lines inside index.php ;)

Put one line in index.php file right before <div class="rbox">
Code: [Select]
<?php if ( $_SESSION[db('website').'Logged_In'] != token() ) { ?>
<div class="rbox">
and put another line after right after closing tag of the same div:
Code: [Select]
</div>
<?php ?>

P.S. Actually, this approach and its usage variants were described several times across this forum.
Logged

BryonWells

  • Newbie
  • *
  • Karma: 0
  • Posts: 3

Thanks for all of the help.

1) To simulate subcategories, I'll try making "Attorneys" into a category, with each partner's page being an article. Issue resolved. Thanks ad_267.

2) Mike1's link was exactly what I was looking for on the comments. Thanks!

Does anyone know how to do a similar thing for the default category on new articles? If I have to remember to change that category every time I write an article, I would be prone to forget. Then some would get added to "home" instead of "news".

3) Keyrocks: actually my code looks like this:
<div class="content">
   <?php
      extra();
      center();
   ?>
</div>

The <div class="rbox">...</div> is being inserted by the extra(); function.

And my customer insists on having contact info throughout the site, so I can't just move it to the contact page (that was my first idea too).

Codetwist: Is this just generic code to hide the box whenever I'm logged in? Does anyone know how to differentiate between the admin area and the public areas?
Logged

Keyrocks

  • Doug
  • ULTIMATE member
  • ******
  • Karma: 449
  • Posts: 6020
  • Semantically Challenged
    • snews.ca

@ Codetwist... thanks for pointing that simple solution out. It may have been described in several places on these forums... but few of us would know that... not even I. I must write that one down for future reference.  ;)
@ Bryon... I wasn't sure if you were using the "extra" to insert the info-box or not. However, since it isn't necessary to see that "extra" when logged in... you could wrap extra(); with Codetwist's snippet as well... and it would look like:

Quote
<?php if ( $_SESSION[db('website').'Logged_In'] != token() ) {
      extra();
      }
      center();
?>
Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU

ad_267

  • Jr. Member
  • **
  • Karma: 7
  • Posts: 57

Another way to disable the contact info when you're in the administration panel would be to use the body id mod and then add in your css:
Code: [Select]
body#administration div.rbox {display:none;}
You can get the body id mod here: http://snewscms.com/forum/index.php?topic=5807.0
« Last Edit: November 05, 2007, 12:39:54 am by ad_267 »
Logged

jlhaslip

  • Sr. Member
  • ****
  • Karma: 16
  • Posts: 374
    • My snews with AEF Forum site

If the Owners insist on displaying email address, try this method: http://jlhaslip.com/samples/email/
Logged
Yes! I have no siggy.

codetwist

  • Hero Member
  • *****
  • Karma: 50
  • Posts: 940

...

Codetwist: Is this just generic code to hide the box whenever I'm logged in? Does anyone know how to differentiate between the admin area and the public areas?
Yes, it's only for testing loged in/not logged in. Try that body id mod mentioned in one of the posts above. I assume that it is distinguishing content pages from administrative ones.
Logged

Fred K

  • Still trying to learn stuff
  • ULTIMATE member
  • ******
  • Karma: 130
  • Posts: 2728
    • Personal

... that body id mod mentioned ... distinguishing content pages from administrative ones.

Well, not entirely. The body mod only takes the SEF and enters that as the body id, so for blah.com/administration/ it sets <body id="administration">, but when logged in *or not*, if you go to say blah.com/contact or blah.com/archive, the mod always sets <body id="contact"> or <body id="archive"> or <body id="whatever">. So there's no foolproofery built in.

With Bryon's scenario, I'd probably try your code, 'twist ... or maybe a combination. ;)
Logged

ad_267

  • Jr. Member
  • **
  • Karma: 7
  • Posts: 57

Well, not entirely. The body mod only takes the SEF and enters that as the body id, so for blah.com/administration/ it sets <body id="administration">

I'm pretty sure the body id mod sets body id="administration" for any page within the administration area such as the category or article lists and forms so this should work perfectly for Bryon's requirements.
Logged

philmoz

  • High flyer
  • ULTIMATE member
  • ******
  • Karma: 161
  • Posts: 1988
    • fiddle 'n fly

from memory... and a quick look at the code, any admin function page(new artcles, categories, etc) will have body id set to administration, so ad_267's solution should hide the cotact box.

Logged
Of all the things I have lost, it is my mind that I miss the most.

Fred K

  • Still trying to learn stuff
  • ULTIMATE member
  • ******
  • Karma: 130
  • Posts: 2728
    • Personal

true, true ... my mess... :(
I was looking at a dev site where I'm using both the body id mod _and_ the homeless url mod. Forgot about the latter. In normal situations, body id will print id="admin" throughout admin...
*slaps face twice*
Logged

BryonWells

  • Newbie
  • *
  • Karma: 0
  • Posts: 3

Thanks again for all your help. All of my questions are now resolved. To help people who may come across this later as they search, here are the resolutions:

1) SNews doesn't support subpages. Instead create a category, and add each subpage as an article.

2) To change the default comment settings for new articles, use this technique: http://snewscms.com/forum/index.php?topic=4824.0. To change the default category for new articles, I was forced to hard code it.

3) To make extra contents disappear when you are in the admin area, use the body ID mod: http://snewscms.com/forum/index.php?topic=5807.0, then add body#administration .whatever {display:none; } to your CSS.
Logged