Modifying BoardIndex.template.php / Code Help To Add Legend To Top

Started by S_EEk_ER, August 11, 2015, 04:51:18 PM

Previous topic - Next topic

S_EEk_ER

I believe I found the block of code (listed below) that controls where the legend / "Mark All as Read button" appears.  I want this legend to appear at the top of the forum, so I pasted it near the top section.  However, when I do so, the entire board shifts to the right - see attached pic.

I've tried moving it around all different places near the top with no luck.

How can I fix this?


/Themes/{theme}/BoardIndex.template.php


   if ($context['user']['is_logged'])
   {
      echo '
   <div id="posting_icons" class="floatleft">';

      // Mark read button.
      $mark_read_button = array(
         'markread' => array('text' => 'mark_as_read', 'image' => 'markread.gif', 'lang' => true, 'url' => $scripturl . '?action=markasread;sa=all;' . $context['session_var'] . '=' . $context['session_id']),
      );

      echo '
      <ul class="reset">
         <li class="floatleft"><img src="', $settings['images_url'], '/', $context['theme_variant_url'], 'new_some.png" alt="" /> ', $txt['new_posts'], '</li>
         <li class="floatleft"><img src="', $settings['images_url'], '/', $context['theme_variant_url'], 'new_none.png" alt="" /> ', $txt['old_posts'], '</li>
         <li class="floatleft"><img src="', $settings['images_url'], '/', $context['theme_variant_url'], 'new_redirect.png" alt="" /> ', $txt['redirect_board'], '</li>
      </ul>
   </div>';

      // Show the mark all as read button?
      if ($settings['show_mark_read'] && !empty($context['categories']))
         echo '<div class="mark_read">', template_button_strip($mark_read_button, 'right'), '</div>';
   }
   else
   {
      echo '
   <div id="posting_icons" class="flow_hidden">
      <ul class="reset">
         <li class="floatleft"><img src="', $settings['images_url'], '/new_none.png" alt="" /> ', $txt['old_posts'], '</li>
         <li class="floatleft"><img src="', $settings['images_url'], '/new_redirect.png" alt="" /> ', $txt['redirect_board'], '</li>
      </ul>
   </div>';
   }

Kindred

you need to be posting these questions in the topic dedicated to supporting the specific theme that you are using (since that is not the default/Curve theme)

the link to the support topic is right on the download page where you got the theme...
Сл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."

S_EEk_ER

Quote from: Kindred on August 11, 2015, 04:55:21 PM
you need to be posting these questions in the topic dedicated to supporting the specific theme that you are using (since that is not the default/Curve theme)

the link to the support topic is right on the download page where you got the theme...

This code is in our "default" theme.

Illori

Quote from: Illori on August 11, 2015, 05:26:45 PM
Quote from: S_EEk_ER on August 11, 2015, 05:19:58 PM
Quote from: Kindred on August 11, 2015, 05:04:34 PM
note...   as already commented in your new thread...   these posts should be being made in the support topic for that theme...

This code is in our "default" theme.

but that does not mean it is the 2.0 curve default theme. it is changed in colors so that makes us believe that you have a custom theme that is not the curve theme. if it is a theme created by someone else you should post in the themes support topic. if not then you should explain that it is a theme you are creating and need help with.

S_EEk_ER

Quote from: S_EEk_ER on August 11, 2015, 05:34:07 PM
Quote from: Illori on August 11, 2015, 05:26:45 PM
Quote from: S_EEk_ER on August 11, 2015, 05:19:58 PM
Quote from: Kindred on August 11, 2015, 05:04:34 PM
note...   as already commented in your new thread...   these posts should be being made in the support topic for that theme...

This code is in our "default" theme.

but that does not mean it is the 2.0 curve default theme. it is changed in colors so that makes us believe that you have a custom theme that is not the curve theme. if it is a theme created by someone else you should post in the themes support topic. if not then you should explain that it is a theme you are creating and need help with.


Here's the thing - I've only started looking at SMF, PHP and CSS in the last 3-4 days.  This is my fathers site so I have no idea how everything is connected.  We had someone upgrade our forum on Saturday from 1.1.x to 2.0.10, and then we found a theme and figured out how to apply it.

From what I can tell, there are a core set of files in the "default" theme.  There are another set of files in the "blu" theme, but not ALL the files.  So the best I can tell is most of the settings are pulled in from the default theme, the remainder from the blu theme.

The BoardIndex.template.php file is in the default folder, so if I post it to the blu theme support site, my guess is they would not recognize it as one of theirs.

I can appreciate the importance of trying of posting to the correct board to get support, but please understand I really don't know a lot about what I have been looking at.

Where should I post this question?

[edit] mistake sorry put back-- Illori

Kindred

Quote from: Kindred on August 11, 2015, 04:55:21 PM
(since that is not the default/Curve theme)

Quote
the link to the support topic is right on the download page where you got the theme...
Сл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."

Antes

I'm answering this because its an very easy question but remember for more advanced or complex issues use your theme's topic.

Add this to end of your index.css;
#boardindex_table
{
clear: both;
}

Steve

And just a friendly tip, when posting code, use the code tags. :)
DO NOT pm me for support!

S_EEk_ER

Quote from: Antes on August 11, 2015, 06:13:53 PM
I'm answering this because its an very easy question but remember for more advanced or complex issues use your theme's topic.

Add this to end of your index.css;
#boardindex_table
{
clear: both;
}


Excellent, that's what I needed.

I have to say - you guys are fantastic.  I'm learning a lot about how everything functions and getting a chance to understand the coding better.

Thank-you for your help.

S_EEk_ER

Quote from: Steve on August 11, 2015, 08:06:00 PM
And just a friendly tip, when posting code, use the code tags. :)

It wouldn't be a normal day if I didn't ask at least one "newb" question...  :D

What exactly do you mean by use the code tags?  Aren't the tags the {} and </> items that appear in the code I posted?

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."

S_EEk_ER

Ahhh, okay got it so that it is formatted properly.  Good info, thank-you.

Re-posting my own sample to confirm how it will look.

  if ($context['user']['is_logged'])
   {
      echo '
   <div id="posting_icons" class="floatleft">';

      // Mark read button.
      $mark_read_button = array(
         'markread' => array('text' => 'mark_as_read', 'image' => 'markread.gif', 'lang' => true, 'url' => $scripturl . '?action=markasread;sa=all;' . $context['session_var'] . '=' . $context['session_id']),
      );

      echo '
      <ul class="reset">
         <li class="floatleft"><img src="', $settings['images_url'], '/', $context['theme_variant_url'], 'new_some.png" alt="" /> ', $txt['new_posts'], '</li>
         <li class="floatleft"><img src="', $settings['images_url'], '/', $context['theme_variant_url'], 'new_none.png" alt="" /> ', $txt['old_posts'], '</li>
         <li class="floatleft"><img src="', $settings['images_url'], '/', $context['theme_variant_url'], 'new_redirect.png" alt="" /> ', $txt['redirect_board'], '</li>
      </ul>
   </div>';

      // Show the mark all as read button?
      if ($settings['show_mark_read'] && !empty($context['categories']))
         echo '<div class="mark_read">', template_button_strip($mark_read_button, 'right'), '</div>';
   }
   else
   {
      echo '
   <div id="posting_icons" class="flow_hidden">
      <ul class="reset">
         <li class="floatleft"><img src="', $settings['images_url'], '/new_none.png" alt="" /> ', $txt['old_posts'], '</li>
         <li class="floatleft"><img src="', $settings['images_url'], '/new_redirect.png" alt="" /> ', $txt['redirect_board'], '</li>
      </ul>
   </div>';
   }

Advertisement: