Forum
Attributes Type Select
I'm creating a select option for my schema product rating, so i wish to select a number from 1-5 then use this within the schema markup but output a star rating otherwise.
this is what i have so far, as part of my template:
<div class="rating" itemprop="reviewRating" itemscope itemtype="https://schema.org/Rating">
<meta itemprop="worstRating" content="0"><meta itemprop="ratingValue" content="<perch:content id="ratingValue" type="select" label="Rating Value" options="1, 2, 3, 4, 5" allowempty="false" required="true" />"><meta itemprop="bestRating" content="5">
<perch:content id="ratingValue" type="select" options="1, 2, 3, 4, 5|<span>☆</span><span>☆</span><span>☆</span><span>☆</span><span>☆</span>" />
</div>
But i get this output, its striping the opening <span>:
<div class="rating" itemprop="reviewRating" itemscope itemtype="https://schema.org/Rating">
<meta itemprop="worstRating" content="0"><meta itemprop="ratingValue" content="5"><meta itemprop="bestRating" content="5">
☆</span><span>☆</span><span>☆</span><span>☆</span><span>☆</span>" />
</div>
I guess i'm doing something wrong so any pointers be great.
Dan
You can't put HTML inside a tag attribute. I think this should work:
cheers Drew