How to state correctly the author informations of an article with microdata? - article

I'm using the microdata system for some articles.
But I can't find some good ressources to know if the structure of my schema, for the author, is good or not.
"Article"'s shema allow to specify an "author", but how to indicate the informations (image, link, name) about this author ?
Actualy I use the following (fiddle):
<div itemscope itemtype="http://schema.org/Article">
<h1 itemprop="name">Article title</h1>
<div itemprop="articleBody">
Lorem ipsum dolor sit amet...
</div>
<div itemprop="author" itemtype="http://schema.org/Person" class="author">
<a href="member-page.html" itemprop="url">
<img itemprop="image" src="http://pic.okisurf.com/member/none/xs/m.png"/>
<span itemprop="name">Author name</span>
</a>
</div>
</div>
Does this line is correct ?
<div itemprop="author" itemtype="http://schema.org/Person">
If it is not, any help or ressource link will be greatly appreciated.

It seems that to specify a new itemtype inside another, we need to specify another time the itemscope !
So this line will be correct :
<div itemscope="" itemprop="author" itemtype="http://schema.org/Person">
To make sure that the microdata are well formed, I suggest to use the Webmaster Tools richsnippets test

Related

regex repeat group

I am trying to capture the url of the images (how ever many there may be on a specific site. I am able to do so however when I then progress to try an capture other things thereafter the entire thing falls apart. Would greatly appreciate any help.
Working regex:
.(?:src="(http:\/\/website\.bla\.com\/Live.+?)".+?)
Non working
.(?:src="(http:\/\/website\.bla\.com\/Live.+?)".+?).*Status.*\s(Sld|Rtr)
Sample code:
<div ng-class="{
'active': active
}" class="item text-center ng-isolate-scope" ng-transclude="" ng-repeat="slide in slides" active="slide.active">
<img class="image-circle ng-scope" ng-src="http://website.bla.com/Live/photos/FULL/18/134/W3764134_18.jpg" src="http://website.bla.com/Live/photos/FULL/18/134/W3764134_18.jpg">
</div><!-- end ngRepeat: slide in slides --><div ng-class="{
'active': active
}" class="item text-center ng-isolate-scope" ng-transclude="" ng-repeat="slide in slides" active="slide.active">
<img class="image-circle ng-scope" ng-src="http://website.bla.com/Live/photos/FULL/19/134/W3764134_19.jpg" src="http://website.bla.com/Live/photos/FULL/19/134/W3764134_19.jpg">
</div><!-- end ngRepeat: slide in slides --><div ng-class="{
'active': active
}" class="item text-center ng-isolate-scope" ng-transclude="" ng-repeat="slide in slides" active="slide.active">
<img class="image-circle ng-scope" ng-src="http://website.bla.com/Live/photos/FULL/20/134/W3764134_20.jpg" src="http://website.bla.com/Live/photos/FULL/20/134/W3764134_20.jpg">
</div><!-- end ngRepeat: slide in slides -->
</div>
<b class="ng-binding">Status:</b> Sld
For this simple example: use alternates. Please see this.
But this can get complicated if added requirements are to be implemented. In that case you might want to use a HTML parser as in JSoup.
See this one - it is already answered:
With lots of assumptions, you could try this:
src="(http://website\.bla\.com/Live.+?)"(?:(?:[^s]|s[^r]|sr[^c])*?Status.*? (Sld|Rtr))?

jquery regex get several key not only one

I would like to get
PA-1400-11PA ADP-40PH ABA
Here html code
</div>
<div class="ref">
<h2 id='affiche_sous_titre'>eee :</h2> <p>
<a href='eee' title='PA-1400-11PA' class='lien_menu'>PA-1400-11PA</a> - <a href='uuu' title='ADP-40PH ABA' class='lien_menu'>ADP-40PH ABA</a> </p>
</div>
<div class="modele_tout">
</div>
<div class="star-customer">
Here my reg code
line=line.replace(/[\"\']lien_menu[\"\']>(.*?)<\/a>/ig,"$1\n")
But I have only
ADP-40PH ABA
What is the problem.I dont understand?
thanks for your help

Find and replace Dreamweaver - Adding a number each time?

I've just been doing some research about regular expressions on dreamweaver and had no idea you could do so much with find and replace.
One thing i haven't been able to figure out is if i have:
<div class="item active"> <img src="images/gates2/large/gates1.jpg">
<div class="carousel-caption">WG1</div>
</div>
<div class="item"><img src="images/gates2/large/gates2.jpg">
<div class="carousel-caption">WG1</div>
</div>
<div class="item"><img src="images/gates2/large/gates3.jpg">
<div class="carousel-caption">WG1</div>
</div>
<div class="item"><img src="images/gates2/large/gates4.jpg">
<div class="carousel-caption">WG1</div>
</div>
Can i automatically change the 1 to 2, 3 ect? So it becomes an order? Rather than going through each manually?
Kind Regards,
Shaun
Unfortunately, you won't be able to do what you're describing using the Find & Replace method in Dreamweaver. I know this probably isn't the answer you want to hear but, you'll have to go through them manually. Sorry to be the bearer of bad news.

Transform HTML grab class and inner string in Sublime Text with Regex

I'm well aware of the dangers of parsing HTML with Regular Expressions but I'm in a pickle and need to speed things up! I have this code block:
<div class="row">
<div class="span1"><i class="fc-icon-letterpress-circle"></i>
</div>
<div class="span4">This design is letterpressed onto the finest quality salvaged paper made here in the USA.</div>
</div>
<div class="row">
<div class="span1"><i class="fc-icon-madeinusa-circle"></i>
</div>
<div class="span4">We work hard to be able to say that this product is proudly created right here in the USA.</div>
</div>
<div class="row">
<div class="span1"><i class="fc-icon-cotton-circle"></i>
</div>
<div class="span4">This product is made from tree-free paper sourced from salvaged cotton from the textile industry.</div>
</div>
And I need it to be transformed to this:
letterpress-circle, "This design is letterpressed onto the finest quality salvaged paper made here in the USA.";
madeinusa-circle, "We work hard to be able to say that this product is proudly created right here in the USA.";
cotton-circle, "This product is made from tree-free paper sourced from salvaged cotton from the textile industry.";
Preferably with one regular expression, in sublime text
This is what I have so far.
.+i class=\"fc-icon-(.+)\".+
$1
This is what I landed on:
<div class=\"row\">
<div class=\"span1\"><i class=\"fc-icon-(.+)\"></i>
</div>
<div class=\"span4\">(.+)</div>
</div>

ModX: Using GetResources to display multiple pages in one page

I am trying to use getResources to display multiple resources withing one resource, including their Templates and TVs.
The code I have in the page I want to display them is:
[[!getResources? &parents=`50` &sortdir=`ASC` &sortby=`menuindex` &limit=`100` &includeTVs=`1` &processTVs=`1` &tpl=`gigtemp` ]]
Where &tpl=gigtemp is a chunk I have created where all my template HTML and TVs are.
However, nothing is showing on the page.
Can anyone help me out?
Please let me know if I need to explain more.
Update:
Some of the info is showing, but a lot of the html is broken.
My HTML on the Chunk is:
<div class="gig-guide">
<div class="gig-info">
<h2>[[+tv.gigname]]</h2>
<strong>[[=tv.gigcity]]</strong>
<img src="[[+tv.gigthumb]]" alt="Contra Clave Contra Event: [[+tv.gigname]" /></div>
<div class="gig-info">
<h2>[[+tv.gigdate]]</h2>
[[+tv.gigtime]]</div>
<div class="gig-info">
<h2>[[+tv.gigvenue]]</h2>
[[+tv.gigaddress]]</div>
<div class="gig-info">
<h2>[[+tv.gigcost]]</h2>
</div>
<div class="gig-bottom">
<div class="fb-like" data-href="[[+tv.gigfbevent]]" data-send="false" data-width="300" data-colorscheme="dark" data-show-faces="false"> </div>
<div class="gigsocialmedia"><img src="assets/images/ccc-fb.png" alt="This event on Facebook" /> <a class="twitter-share-button" href="https://twitter.com/share?text=[[+tv.gigtwitter]]" target="_blank" data-lang="en"><img src="assets/images/ccc-twiter.png" alt="Tweet this event" /></a> <img src="assets/images/ccc-email.png" alt="Email this event to a friend" /></div>
</div>
<!--END GIG BOTTOM DIV-->
<!--END GIG GUIDE DIV-->
Again, any help is appreciated!
Your code is valid and as far as I can see, without errors. That means that there is something else wrong, I would guess one of the following:
You have not cleared your cache, which is not necessary but could solve weird problems
The children of resource 50 is not published or is hidden
There is something else wrong around your code, making Modx not parsing it correctly.
Edit: You had several errors in your chunk. Try replacing it with this:
<div class="gig-guide">
<div class="gig-info">
<h2>[[+tv.gigname]]</h2>
<strong>[[+tv.gigcity]]</strong>
<img src="[[+tv.gigthumb]]" alt="Contra Clave Contra Event: [[+tv.gigname]]" /></div>
<div class="gig-info">
<h2>[[+tv.gigdate]]</h2>
[[+tv.gigtime]]</div>
<div class="gig-info">
<h2>[[+tv.gigvenue]]</h2>
[[+tv.gigaddress]]</div>
<div class="gig-info">
<h2>[[+tv.gigcost]]</h2>
</div>
<div class="gig-bottom">
<div class="fb-like" data-href="[[+tv.gigfbevent]]" data-send="false" data-width="300" data-colorscheme="dark" data-show-faces="false"> </div>
<div class="gigsocialmedia"><img src="assets/images/ccc-fb.png" alt="This event on Facebook" /> <a class="twitter-share-button" href="https://twitter.com/share?text=[[+tv.gigtwitter]]" target="_blank" data-lang="en"><img src="assets/images/ccc-twiter.png" alt="Tweet this event" /></a> <img src="assets/images/ccc-email.png" alt="Email this event to a friend" /></div>
</div>
<!--END GIG BOTTOM DIV-->
<!--END GIG GUIDE DIV-->
Are your resources you are trying to display hidden? then you need the &showHidden=1 .
Are they unpublished? then you also need the &showUnpublished=1
You may also need the &includeContent=1 ~maybe~
See if you can get away without using the &processTVs
If you are still having issues - leave out the &tpl=``, getResources will just dump it's output to the page so you can see what is actually being returned. Might give you another clue as to what is not happening..