miniBB ®  
miniBB Support Forums
 | Forums | Register | Reply | Search | Statistics | Manual |
Custom Tutorials and Modifications miniBB Support Forums / Custom Tutorials and Modifications /   

Changing title and description for custom templates

Author Vishal
Registered
#1 | Posted: 4 Aug 2006 10:57 
I have created a custom template page "links.html". How can I get minibb to display the title of the page as "Links" and some custom description? By default, it displays the forum title and description.

I saw in your contact form that the title is displayed as "Contacting Us".

Author Paul
Lead Developer
#2 | Posted: 4 Aug 2006 14:52 | Edited by: Paul 
I think, you will need to paste code like suggested below in bb_plugins.php...

if($action=='tpl' and $_GET['tplName']=='links'){
//$title.='Links'; //forums title displayed first
$title='Links - '.substr($title,0,strlen($title)-2); //forums title displayed after
$description='Your custom description goes here';
}

You may comment/uncomment necessary values for $title.

Author Vishal
Registered
#3 | Posted: 5 Aug 2006 04:37 
Thanks Paul! I used $description="Custom description" instead of $customDescription and it works fine. Is there anything wrong with it?

Author Paul
Lead Developer
#4 | Posted: 5 Aug 2006 13:08 
Ok, it also will work that way. Maybe it's even better -) I've fixed the code above.

Author Prince
Registered
#5 | Posted: 17 Jun 2012 17:40 
Paul:
if($action=='tpl' and $_GET['tplName']=='links'){
//$title.='Links'; //forums title displayed first
$title='Links - '.substr($title,0,strlen($title)-2); //forums title displayed after
$description='Your custom description goes here';
}

If I have multiple templates so do I need to make this separately for each one? or there is another option?

I added "$metaRobots" also and it worked because made it "index,follow".

Author Paul
Lead Developer
#6 | Posted: 18 Jun 2012 17:03 
Prince:
If I have multiple templates so do I need to make this separately for each one? or there is another option?

Well, if you will have multiple templates, what kind of option it could be? Each of templates may surely have its own title and description, so whatever you must to code, is to copy-paste this code and then modify it. I don't see the simpler way :)

Yes, you can add $metaRobots for each template, that is fine.

Custom Tutorials and Modifications miniBB Support Forums / Custom Tutorials and Modifications / Changing title and description for custom templates Top
Your Reply Click this icon to move up to the quoted message
 Short link for this topic:

 ?
Only registered users are allowed to post here. Please, enter your username/password details upon posting a message, or register first.


Before posting, make sure your message is compliant with our forum posting rules. If not, it may be locked or deleted with no explanation.
 
miniBB Support Forums Powered by Forum Software miniBB ® Features  Requirements  Demo  Download  Showcase  Gallery of Arts
Compiler  Premium Extensions  Premium Support  License  Contacts
  Extend your miniBB-forums, attaching the images and files,
get the File and Picture Attachments add-on!
Galleries / Attachments Addon for miniBB