News:

Wondering if this will always be free?  See why free is better.

Main Menu

Adding page within the SMF system?

Started by RaalF, June 10, 2008, 08:54:56 AM

Previous topic - Next topic

Hagbard_Celine

Using the code, and calling my version of test.php, I get:

syntax error, unexpected T_REQUIRE

Checking the code, the require() command is not coloured by syntax colouring function of my editor.

Can this be explained? I am using SMF2 RC2.

Arantor

Please post the full code you're using.

malcomxar

Hey thanks for this :)

But how can I add metadesc, metatags and title to this custom pages?

BTW i am using SMF 2.0 RC2 with default theme :)

Arantor

It kind of depends whether you're using SSI or not.

If you ARE using SSI, set the following prior to calling template_header();
$context['page_title_html_safe'] -> page title and meta description (and PLEASE don't try and convince me it will SEO boost, since it WON'T)

$context['meta_keywords'] -> meta keywords (ditto to the above)

If you AREN'T using SSI, set this variables in your function before it leaves for the template:
$context['page_title'] -> page title and meta description
$context['meta_keywords'] -> meta keywords


If you want to do anything different with respect to meta description, that's a custom edit to index.template.php to change it.

malcomxar

Sorry I didn't reply earlier, I had forgotten about this :P

Arantor, I am using SSI, but I don't know where to add this

QuoteIf you ARE using SSI, set the following prior to calling template_header();
$context['page_title_html_safe'] -> page title and meta description (and PLEASE don't try and convince me it will SEO boost, since it WON'T)

$context['meta_keywords'] -> meta keywords (ditto to the above)

I am using the structure proposed here by n3rve > http://www.simplemachines.org/community/index.php?topic=243833.msg1574510#msg1574510

Should I add what to say to index.template.php? Because if I add it to any of the parts proposed by nerve (header.php, footer.php or test.php) I get an error

Thanks in advance


Arantor

The problem with modifying index.template.php is that it affects the forum too.

The trouble with that structure is that it doesn't actually allow the modifications I'm outlining to be performed. The structure I refer to requires you to call the templates manually, but means you can configure it how you want, while n3rve's structure doesn't. (It's a matter of some debate which general style is more 'correct')


You can do it in a single file without needing header.php or footer.php.

<?php

require('SSI.php');

$context['page_title_html_safe'] = 'My new title';

template_header();
?>


<div>regular HTML here</div>

<?php
template_footer
();
?>

malcomxar

Ahh jeje I was mixing them :P

The code you gave me worked perfectly, I really appreaciate all the times you helped me Arantor ^^

Best regards :)

geeks4share

Thanks for the tutorials, It work.

But i got a problem we can't change the title or the meta tags for those new pages. Is there any way to change the title and meta tags of these pages. Because these i affecting my website in getting indexed on google.

Thanks in Advanced

geyids

This is such a nice post but how do we make the custom page to show up as the first page other than the default index.php? I think that will be more magic to me.

Thanks

Tyluur


me1982

Quote from: [n3rve] on December 24, 2009, 11:39:59 PM
You can append theme_copyright() to the end of the file and the copyright should be displayed.

-[n3rve]

Like this? (it doesnt work...):

<?php

$ssi_theme = 1;
$ssi_layers = array('main');
require_once('SSI.php');

?>

Content


<?php

ssi_shutdown(); theme_copyright();

?>

???

Arantor

Copyright isn't displayed properly in SSI based pages, but it's not supposed to be. If it were, the main layer would catch it anyway since the main layer has the footer template already in it...

me1982

Is there any way to make it being displayed?

Arantor

Not really, no, not without breaching the SMF licence (since you'd have to modify the function itself, and there's a big fat warning in that function about NOT doing it)

You could, of course, just add the copyright yourself to the page, though really, you don't need to for SSI pages, there's no requirement to do so.

me1982

ok, seems to be the better to just leave it. but there is a ' | ' the copyright would go before. what would be the best way to remove that? looks like this:

Quote

| Valid XHTML & CSS


Arantor

What theme are you using? If it's not the default theme you'll have to speak to the theme author about changing it.

me1982

because of legal reasons or just to know where and how? I know where to change it, but it would be changed for all pages after that. for the how case: may be it could be changed by an if function like:

if ssi page dont show, if not show

or something like this. i don't have much of an idea of php programming so far...

Arantor

There are no legal reasons that require you to display the SMF copyright on any page other than those actually physically in the forum. And you can't alter the SMF copyright itself as the licence forbids you to do so!

me1982


Arantor

-sigh-

Since it's not part of the copyright, it's part of the theme. So...
Quote from: Arantor on January 14, 2011, 09:28:01 AM
What theme are you using? If it's not the default theme you'll have to speak to the theme author about changing it.

Advertisement: