Snipt.net is closing on December 31st, 2016

For more information, please visit this blog post.

snipt

Ctrl+h for KB shortcuts

Text only

Drupal 7: View entity translation field duplicated issue

If you have a Sort Criteria on the title_field you may have your nodes appear twice.
To fix this, you just need to add a Filter Criteria on the title_field:language (Current user's language) and it works !
https://snipt.net/embed/8f519940f0965984452507bddd0000ff/
https://snipt.net/raw/8f519940f0965984452507bddd0000ff/
8f519940f0965984452507bddd0000ff
text
Text only
2
2016-12-02T19:47:30
True
False
True
Jun 12, 2013 at 06:12 AM
/api/public/snipt/63929/
drupal-7-view-entity-translation-field-duplicated-issue
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>If you have a Sort Criteria on the title_field you may have your nodes appear twice. </span><span id="L-2"><a name="L-2"></a>To fix this, you just need to add a Filter Criteria on the title_field:language (Current user&#39;s language) and it works ! </span></pre></div> </td></tr></table>
"drupal 7", entity, field, i18n, translation, views

HTML

Do not display empty fields in Types/Views

1
2
3
4
5
6
7
8
[wpv-if mbr="wpcf-wr_member" evaluate="$mbr != ''"]
<h3>Member</h3>
[types field="wr_member"]
[/wpv-if]
[wpv-if msv="wpcf-wr_militaryservice" evaluate="$msv != ''"]
<h3>Military Service</h3>
<p>[types field="wr_militaryservice"]</p>
[/wpv-if]
https://snipt.net/embed/208b3170b074a09b11e07353b344504a/
https://snipt.net/raw/208b3170b074a09b11e07353b344504a/
208b3170b074a09b11e07353b344504a
html
HTML
8
2016-12-05T12:12:41
True
False
False
/api/public/snipt/38052/
do-not-display-empty-fields-in-typesviews
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a> <a href="#L-4">4</a> <a href="#L-5">5</a> <a href="#L-6">6</a> <a href="#L-7">7</a> <a href="#L-8">8</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>[wpv-if mbr=&quot;wpcf-wr_member&quot; evaluate=&quot;$mbr != &#39;&#39;&quot;] </span><span id="L-2"><a name="L-2"></a><span class="p">&lt;</span><span class="nt">h3</span><span class="p">&gt;</span>Member<span class="p">&lt;/</span><span class="nt">h3</span><span class="p">&gt;</span> </span><span id="L-3"><a name="L-3"></a>[types field=&quot;wr_member&quot;] </span><span id="L-4"><a name="L-4"></a>[/wpv-if] </span><span id="L-5"><a name="L-5"></a>[wpv-if msv=&quot;wpcf-wr_militaryservice&quot; evaluate=&quot;$msv != &#39;&#39;&quot;] </span><span id="L-6"><a name="L-6"></a><span class="p">&lt;</span><span class="nt">h3</span><span class="p">&gt;</span>Military Service<span class="p">&lt;/</span><span class="nt">h3</span><span class="p">&gt;</span> </span><span id="L-7"><a name="L-7"></a><span class="p">&lt;</span><span class="nt">p</span><span class="p">&gt;</span>[types field=&quot;wr_militaryservice&quot;]<span class="p">&lt;/</span><span class="nt">p</span><span class="p">&gt;</span> </span><span id="L-8"><a name="L-8"></a>[/wpv-if] </span></pre></div> </td></tr></table>
types, views, wordpress
Copyrighted, illegal, or inappropriate content? Email [email protected].