Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

PHP

Shane McC
Shane McC
3,005 Points

Schema and Codeigniter?

Hi Everyone,

I’m attempting to add schema.org HTML markup language to the information I’m displaying on my website. For example, if I list a local business and want to tell all of the major search engines about the business I’m displaying on my website. How would I go about doing that?

Below is my schema.org markup. How would I do this using CI? Thanks everyone!

<div itemscope itemtype="http://schema.org/AutoDealer">
    <tr>
  <td><strong><span itemprop="name"><?=$dealership?></span></strong></td>
  <td><span itemprop="address"><?=$address?></span></td>
  <td><span itemprop="addressRegion"><?=$state?></span></td>
  <td><span itemprop="addressLocality"><?=$city?></span></td>
  <td><span itemprop="postalCode"><?=$zip?></span></td>
  <td><span itemprop="telephone"><?=$phone?></span></td>
  <td><span itemprop="url"><a href="/dealers/dealerships.php?id=<?=$id?>">Click   Here</a></span></td>
</tr>
</div>

1 Answer

Nick Pettit
STAFF
Nick Pettit
Treehouse Teacher

Hi Shane McCormick,

There's a lot going on here.

First, I think Code Igniter and schema.org markup are mutually exclusive. In other words, they don't really have much to do with one another (unless there's a Code Igniter feature I haven't heard about yet), and you can use them independently of one another.

Second, while schema.org and microformats might help your search engine rankings, it's not going to just blast it to the top of Google. SEO is actually very nuanced and complex. Your best bet is to just write awesome content regularly, and sooner or later, organic traffic will reach your site.

Finally, this HTML markup is not valid. It doesn't really seem like this information needs to be in a table, because there's only one table row. Also, if you are going to use a table, you'll need to wrap everything in a table element (not a div).

I hope that helps! :)

Shane McC
Shane McC
3,005 Points

Thanks Nick, appreciate the help