News:

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

Main Menu

Inherit $board['name']

Started by Sir Osis of Liver, June 13, 2022, 11:04:47 PM

Previous topic - Next topic

Sir Osis of Liver

Trying to replace 'Child Boards' in child board title bar with $board['name'] from parent.  Not getting it.  >:(
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Arantor

Where *exactly* are you trying to change this? What file, what line?

Sir Osis of Liver

This is for ebook-mecca.com, I think you may have been there.  On board index there are empty parent boards that contain child boards, each a different book category, and the children contain topics, one for each book.  Board index looks like this:

You cannot view this attachment.

Click on Fiction and message index looks like this:

You cannot view this attachment. 

The title "Child Boards" is meaningless, I'm trying to change it to "Fiction", and same for other children.

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

                                     - R. Waters

Arantor

You should be able to use $context['page_title'] in this case; it's filled in MessageIndex.php with the board's name.

Failing that, add $board_info to the list of globals in MessageIndex.template.php and use $board_info['name'].

$board['name'] is never guaranteed to be available everywhere, it's only normally available in the loop going over a list of boards at a given time, which is not what you're doing there.

Sir Osis of Liver

Right the first time, $context['page_title'] works fine.  Thanks.
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Advertisement: