This is the community forum. For a developer response use the Client Area.
Follow us on Facebook, Twitter and YouTube!

Rich Snippets in 1.7.
#1

Hi
I'm a bit confused about the whole Rich Snippets option. The thing is ... following the short explanation under "Settings > Rich Snippets" I cannot find anything alike in the /templates/comments.php file - but instead...
PHP Code:
<?php 
if ($average_rating != 0) {
echo
$output_average_rating;
echo
"<span class='average_rating_text'>";
if (
$settings->rich_snippets) {
echo
" <span class=\"rating\"><span class=\"average\">" . $average_rating . "</span></span> (<span class=\"votes\">" . cmtx_number_of_ratings() . "</span>)";
} else {
echo
" " . $average_rating . " (" . cmtx_number_of_ratings() . ")";
}
echo
"</span>";
if (
$settings->rich_snippets) {
echo
"</div>";
}
} else {
if (
$settings->rich_snippets) {
echo
" <span class=\"rating\"><span class=\"average\"></span></span><span class=\"votes\"></span></div>";
}
}

} else {
if (
$settings->rich_snippets) {
echo
" <span class=\"rating\"><span class=\"average\"></span></span><span class=\"votes\"></span></div>";
}
}
echo
"</div>";[/php
]So is this already the Rich Snippets code included?
However, if I check the "Enabled" check-box, then (A) I cannot see any difference, but (B) the entire styling of the comments section is out the window.

  1. What am I missing and - is there another (missing) CSS file for when the rich snippets is enabled?
  2. Besides, no matter if enabled or not, the average rating shows only the stars and a 4/5 ... no text at all
Thanks a lot
Reply
#2

Hi,

The Rich Snippets code is only added to the page if you enable it in the admin panel.

You won't "see" any difference because it is mark-up and not visibly displayed.

You need to add the mark-up shown in red to your page, otherwise the <span> and <div> tags will not match up and will ruin the layout.

The average rating section no longer displays any wording, only the figures for the average and total.

Take a look at the source code of the example file that I have attached. It contains the mark-up for the "Example" heading title.


Attached Files
.php example.php Size: 1.46 KB  Downloads: 55

Have you completed the interview?
Reply
#3

Steven,
What do you mean by, "add the mark-up shown in red to your page"? Shown in red where? Is it still even necessary to add this markup in the lastest version?

Thanks.

~ Aedryan
Reply


Possibly Related Threads…
Thread / Author Replies Views Last Post

Forum Jump:


Users browsing this thread: 1 Guest(s)