SimplePortal

Customization => Themes and Graphics => Topic started by: fdr77 on August 19, 2010, 09:27:38 PM

Title: meta description for home page
Post by: fdr77 on August 19, 2010, 09:27:38 PM
I wanted to know if it was possible to put a meta desciption to home page

in the index template is
Code: [Select]
<meta name="description" content="', $context['page_title'], '" />', empty($context['robot_no_index']) ? '' : '
tried to change so
Code: [Select]
<meta name="description" content="' , (isset($context['categories']) ? 'Il Forum rivolto al Discus. Sezioni per dibattere sulla riproduzione, allevamento, malattie e biologia del Discus con gallerie fotografiche e video.' : $context['page_title']) , '" />', empty($context['robot_no_index']) ? '' : '
but this modific is for the forum and don't like to google because lose title of the topic
You can only do something for the home page ?
thank you :)
Title: Re: meta descption for home page
Post by: AngelinaBelle on August 20, 2010, 10:36:39 AM
How about:
Code: [Select]
<meta name="description" content="' , $context['page_title',  (isset($context['categories']) ? 'Il Forum rivolto al Discus. Sezioni per dibattere sulla riproduzione, allevamento, malattie e biologia del Discus con gallerie fotografiche e video.' : ''), '" />', empty($context['robot_no_index']) ? '' : '
Title: Re: meta descption for home page
Post by: fdr77 on August 20, 2010, 05:52:00 PM
Thank a lot and sorry for the disturd.
I'll try this way and you 'll know
Title: Re: meta descption for home page
Post by: fdr77 on August 21, 2010, 09:48:51 PM
sorry but your modification report this error:

Il file che si รจ tentato di salvare ha generato il seguente errore:
Parse error: syntax error, unexpected ',', expecting ']' in index.template.php on line 74

I think the lack of a ]   in
<meta name="description" content="' , $context['page_title',  (isset($context['categories']) ?...........

I corrected in this mode:
<meta name="description" content="' , $context['page_title'],  (isset($context['categories']) ?.......

It's ok?
Title: Re: meta descption for home page
Post by: AngelinaBelle on August 22, 2010, 07:11:06 PM
Yes -- looks like I made a typo. Good catch!
 
Does this do what you want?
Title: Re: meta descption for home page
Post by: fdr77 on August 23, 2010, 08:11:27 AM
not really but I think what I try is not possible.
My site is composed of SMF 1.1.11 (forum) and simple portal (home page)
I would like to be the home (SP) to have this meta description, and not the forum
Title: Re: meta description for home page
Post by: AngelinaBelle on August 23, 2010, 01:03:14 PM
I believe this is possible. The portal page gets displayed because of some setting saying to display the portal page. 
 
I am sorry to say that I do not know how, in template_html_above, to check if this should be the portal page or not.  I bet somebody else here does, though.
 
Title: Re: meta description for home page
Post by: fdr77 on August 23, 2010, 06:10:25 PM
Thanks anyway I 've helped a lot in those days.
if anyone knows how I'm all ears :)
Title: Re: meta description for home page
Post by: Nathaniel on September 11, 2010, 10:23:59 PM
Code: ("Find (Sources/PortalMain.php)") [Select]
$actions[$_REQUEST['sa']][1]();
}

Code: ("Replace") [Select]
if ($_REQUEST['sa'] == 'articles')
$context['SPortal']['is_frontpage'] = true;

$actions[$_REQUEST['sa']][1]();
}

Then use "!empty($context['SPortal']['is_frontpage'])" to check if the frontpage is set or not.
Title: Re: meta description for home page
Post by: AngelinaBelle on September 13, 2010, 02:03:58 PM
Thanks.  I knew there would be a simple solution.
Title: Re: meta description for home page
Post by: fdr77 on September 16, 2010, 09:17:12 PM
thanks  :nervous-happy:
SimplePortal 2.3.8 © 2008-2024, SimplePortal