News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

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.  >:(
When in Emor, do as the Snamors.
                              - D. Lister

Arantor

Where *exactly* are you trying to change this? What file, what line?
Holder of controversial views, all of which my own.


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.

When in Emor, do as the Snamors.
                              - D. Lister

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.
Holder of controversial views, all of which my own.


Sir Osis of Liver

Right the first time, $context['page_title'] works fine.  Thanks.
When in Emor, do as the Snamors.
                              - D. Lister

Advertisement: