Microdata in spans instead of divs

More
7 years 2 months ago - 7 years 2 months ago #66051 by mcmurdok
Why are you generating the microdata entries by using 'div's?
Code:
'<div style="display:inline" itemprop="'.$itemprop.'" >' .$field->{$prop}. '</div>'
instead of e.g. using a native inline element 'span'?
Code:
'<span itemprop="'.$itemprop.'" >' .$field->{$prop}. '</span>'
Sometimes I combine two fields in one paragraph in my templates but paragraphs don't accept block level elements inside. E.g.
Code:
<p class="created createdby"><?php echo $item->fields['created']->display;?> | <?php echo $item->fields['createdby']->display;?></p>
=>
Code:
<p class="created createdby"> <div style="display:inline" itemprop="dateCreated" >17/02/13</div> | <div style="display:inline" itemprop="author">Administrator</div> </p>

OK, I could use the prefix and suffix functionality but this would separate the values from each other into 2 paragraphs.
Code:
<div style="display:inline" itemprop="dateCreated" > <p class="created">17/02/13</p> </div> <div style="display:inline" itemprop="author" > <p class="createdby">Administrator</p> </div>
but this wouldn't be the same and an unnecessary CSS challenge.

Regards
Last edit: 7 years 2 months ago by ggppdk.

Please Log in or Create an account to join the conversation.

More
7 years 2 months ago #66079 by ggppdk
Hello

We use divs,
because the contents of many fields may contain blocks elements
thus using SPANs results in invalid HTML


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

Please Log in or Create an account to join the conversation.

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.266 seconds
Save
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Essential
These cookies are needed to make the website work correctly. You can not disable them.
Display
Accept
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline