Hello,
I am customizing a template to add schema.org code. I have figured out where to put most of the extra coding in the templates (copies of the templates).
However I need to pull the postion order as a number / text number. Since it is a dynamic position / order, it is always changing, depending on which search or category listing people have done. But I don't know php very well, so I don't know how to pull that value.
Each item in the list view is given a position, based on that page as displayed.
Here is part of the coding that I've customized:
<td itemprop="item" width="<?php echo $pos1width;?>"
style="width: <?php echo $pos1width;?>"
class="<?php echo $item->fields_by_key[$pos1]->params->get('core.field_class')?>">
<meta itemprop="position" content="1">
<span itemprop="item"><?php echo $result; ?></span></td>
The part that I need to put this value for is this line:
<meta itemprop="position" content="1">
Where it is showing "1" is where I need it to put that number.
You can see a sample page live here:
Click here to go to link...
So, on this page example the line should show in this order, for these recipes:
Cinnamon Sugar Popcorn Seasoning
<meta itemprop="position" content="1">
French Fry Seasoning
<meta itemprop="position" content="2">
Fresh Herb Sprinkle for Vegetables
<meta itemprop="position" content="3">
Seasoning Salt
<meta itemprop="position" content="4">
Basically it's just the position of the items on the page, at that time. Sort of like an ordered list.
Maybe there is some sort of simple counter / order code that would work, so if that's what would it should be, then let me know.
Thank you.
Thora
Hello,
I am customizing a template to add schema.org code. I have figured out where to put most of the extra coding in the templates (copies of the templates).
However I need to pull the postion order as a number / text number. Since it is a dynamic position / order, it is always changing, depending on which search or category listing people have done. But I don't know php very well, so I don't know how to pull that value.
Each item in the list view is given a position, based on that page as displayed.
Here is part of the coding that I've customized:
<td itemprop="item" width="<?php echo $pos1width;?>"
style="width: <?php echo $pos1width;?>"
class="<?php echo $item->fields_by_key[$pos1]->params->get('core.field_class')?>">
<meta itemprop="position" content="1">
<span itemprop="item"><?php echo $result; ?></span></td>
The part that I need to put this value for is this line:
<meta itemprop="position" content="1">
Where it is showing "1" is where I need it to put that number.
You can see a sample page live here: Click here to go to link...
So, on this page example the line should show in this order, for these recipes:
Cinnamon Sugar Popcorn Seasoning
<meta itemprop="position" content="1">
French Fry Seasoning
<meta itemprop="position" content="2">
Fresh Herb Sprinkle for Vegetables
<meta itemprop="position" content="3">
Seasoning Salt
<meta itemprop="position" content="4">
Basically it's just the position of the items on the page, at that time. Sort of like an ordered list.
Maybe there is some sort of simple counter / order code that would work, so if that's what would it should be, then let me know.
Thank you.
Thora