News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

News Collapsible Button

Started by laurieluvsliason, November 19, 2020, 04:30:51 PM

Previous topic - Next topic

laurieluvsliason


I understand there is no option in SMF to control the collapsibility of the news fader? How then do I make it collapsible? Is it in the board templates? Oh and while we are it, can we take out the word NEWS as well? I find it totally redundant!

Thanks for any info!

Sir Osis of Liver

Why would you want to do that?  News fader is in BoardIndex.template.php, good luck making it collapsible.  $txt['news'] = 'News'; is in index.english.php.
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

laurieluvsliason


No, I want to make it so that it CAN'T be collapsed. It already is collapsible. Sorry if I worded it wrong.  I have a feeling too many members are collapsing it and aren't reading it. Also, I want to take the word NEWS off the top. Can you tell me exactly how to do it, please?

Sir Osis of Liver

You can remove the upshrink button here -

BoardIndex.template.php



// Show the news fader?  (assuming there are things to show...)
if ($settings['show_newsfader'] && !empty($context['fader_news_lines']))
{
echo '
<div id="newsfader">
<div class="cat_bar">
<h3 class="catbg">
<!--img id="newsupshrink" src="', $settings['images_url'], '/collapse.gif" alt="*" title="', $txt['upshrink_description'], '" align="bottom" style="display: none;" /-->
', $txt['news'], '
</h3>
</div>



Just comment it out as shown.

The News label is in index.english.php, change it to this -



$txt['news'] = '';



Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

laurieluvsliason



Ok, I changed it & got this

QuoteThe file you tried to save generated the following error:
Parse error: syntax error, unexpected '<' in BoardIndex.template.php on line 23

Here is the whole script, maybe you can see what is wrong:

   // Show the news fader?  (assuming there are things to show...)
   if ($settings['show_newsfader'] && !empty($context['fader_news_lines']))
   {
      echo '
   <div id="newsfader">
      <div class="cat_bar">
         <h3 class="catbg">
            <img id="newsupshrink" src="', $settings['images_url'], '/collapse.gif" alt="*" title="', $txt['upshrink_description'], '" align="bottom" style="display: none;" />
            ', $txt['news'] = '';
         </h3>
      </div>
      <ul class="reset" id="smfFadeScroller"', empty($options['collapse_news_fader']) ? '' : ' style="display: none;"', '>';

         foreach ($context['news_lines'] as $news)
            echo '
         <li>', $news, '</li>';


Sir Osis of Liver

You just have to comment out one line -



<!--img id="newsupshrink" src="', $settings['images_url'], '/collapse.gif" alt="*" title="', $txt['upshrink_description'], '" align="bottom" style="display: none;" /-->



Start with a clean file, you did something wrong at the top of the file.
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

laurieluvsliason

EEEk not sure what you mean. Was hoping you would just reprint the whole code for me with the errors fixed, so I can delete what's there and put it in properly? Please & thank you so much!

Sir Osis of Liver

Line 23 is nowhere near the target code.  Did you backup the file before you messed with it?
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

laurieluvsliason



No. I was hoping you would give me the correct code so I could copy & paste it in and get rid of what's there...

Sir Osis of Liver

I gave you the correct code, you didn't apply it correctly.  Those who live in hope and don't do backups will die in despair.

Attach your BoardIndex.template.php, but do it quickly.  Going offline in a few minutes.
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Sir Osis of Liver

No, don't post the code, attach the file.
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

laurieluvsliason

#11
My co-admin keeps the files and she is very sick right now. Don't want to bother her with this right now. Guess we can't fix it today. I was so hoping to surprise her with making this right myself...is this what yu are looking for?

laurieluvsliason



So I am a newby at this stuff, have no idea what I am doing and apparently, I can't get a simple answer from simple machines about taking the collapsible button and word news out of the template code without hours and hours of run around files and being made to feel belittled and even more stupid than what I felt, to begin with. So much for it being simple to make my forum appear the way I want it to. I understand you guys are the experts.

Thanks, SMF for this particular brand of 'help'. If you can correct the code for me, I would be appreciative, if not I guess I will live with it. Sorry to trouble you.

Sir Osis of Liver

Hmm, no one picked up the ball on this after I got off last night, sorry about that.  You're asking for a simple modification that requires code edits, I incorrectly assumed you know enough to do it and have the necessary access.  I can do it for you if you can download and attach the file.  Let's have a look at the forum so we can see what you're running.  Link?
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

laurieluvsliason


Ok thanks so much, I have emailed my co admin about the file and she should be posting the correct file here shortly as I have to head off to work. Yes just a code to get rid of the NEWS and collapsible button at the top, thanks!

The site is Liasonits Gathering. Online   main index page : https://www.liasonitesgathering.online/Forum/index.php

ribbon theme modified off the curve theme  2.0

Sir Osis of Liver

The file I need is /Themes/rIBBON1/BoardIndex.template.php.  The News label is in /Themes/default/languages/index.english.php, or I can just remove it from the template.  Going offline, will be on a while tonight (EST).
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Kindred

The code you posted above has a clearly missing comma and single quote to get back into the html of the echo...


If that code is your edit, it explains why its failing.

I'll show the correct edit when I get to a real machine rather than my mobile
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Sir Osis of Liver

Yes, here -



            ', $txt['news'] = '';
         </h3>



Didn't see that last night (can only see code with one eye now, and poorly after couple hours).  Will do the mod when I have the file, believe I also have to fix it so members who have News collapsed will see it uncollapsed.
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

slizzie1986

Thanks so much. Here is the board index template file. 

Kindred

Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Advertisement: