snipt

Ctrl+h for KB shortcuts

Text only

Drupal 7 : Add i18n to field (Localization)

1
2
3
4
1 - Add and enable the "Field translation" module (http://drupal.org/node/1279346)
2 - Go to your field settings
3 - A new "Translate" tab has appeared !
4 - Click it and translate the field ! It's that simple
https://snipt.net/embed/e969d2a09a002157029467f0943dd910/
/raw/e969d2a09a002157029467f0943dd910/
e969d2a09a002157029467f0943dd910
text
Text only
4
2016-12-27T13:06:14
True
False
True
Oct 29, 2012 at 04:26 AM
/api/public/snipt/48481/
drupal-7-add-i18n-to-field-localization
<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></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>1 - Add and enable the &quot;Field translation&quot; module (http://drupal.org/node/1279346) </span><span id="L-2"><a name="L-2"></a>2 - Go to your field settings </span><span id="L-3"><a name="L-3"></a>3 - A new &quot;Translate&quot; tab has appeared ! </span><span id="L-4"><a name="L-4"></a>4 - Click it and translate the field ! It&#39;s that simple </span></pre></div> </td></tr></table>
"drupal 7", field, i18n

Text only

Drupal 7 : Handle page title with Panels

The config has to be done on the "Content" menu of your Panel page variant.
Set the "Title type" to "Manually set" and leave the field "title" empty. It will be automaticaly filled with the content type title
https://snipt.net/embed/f6de0a7936c308df062e8827e968cc4a/
/raw/f6de0a7936c308df062e8827e968cc4a/
f6de0a7936c308df062e8827e968cc4a
text
Text only
2
2019-03-19T06:32:56
True
False
True
Oct 29, 2012 at 04:26 AM
/api/public/snipt/48292/
drupal-7-handle-page-title-with-panels
<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>The config has to be done on the &quot;Content&quot; menu of your Panel page variant. </span><span id="L-2"><a name="L-2"></a>Set the &quot;Title type&quot; to &quot;Manually set&quot; and leave the field &quot;title&quot; empty. It will be automaticaly filled with the content type title </span></pre></div> </td></tr></table>
"drupal 7", panels, title

CSS

Symfony 1.x : Style auto on sfWidgetFormDate rendering

1
2
3
4
5
select[name$="[day]"],
select[name$="[month]"],
select[name$="[year]"] {
    width: 70px;
}
https://snipt.net/embed/adc6c153366a65612fb199a73d545a95/
/raw/adc6c153366a65612fb199a73d545a95/
adc6c153366a65612fb199a73d545a95
css
CSS
5
2016-12-29T19:11:45
True
False
True
Sep 16, 2012 at 09:49 AM
/api/public/snipt/47249/
symfony-1x-style-auto-on-sfwidgetformdate-rendering
<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></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="nt">select</span><span class="o">[</span><span class="nt">name</span><span class="o">$=</span><span class="s2">&quot;[day]&quot;</span><span class="o">],</span> </span><span id="L-2"><a name="L-2"></a><span class="nt">select</span><span class="o">[</span><span class="nt">name</span><span class="o">$=</span><span class="s2">&quot;[month]&quot;</span><span class="o">],</span> </span><span id="L-3"><a name="L-3"></a><span class="nt">select</span><span class="o">[</span><span class="nt">name</span><span class="o">$=</span><span class="s2">&quot;[year]&quot;</span><span class="o">]</span> <span class="p">{</span> </span><span id="L-4"><a name="L-4"></a> <span class="nb">width</span><span class="o">:</span> <span class="m">70px</span><span class="p">;</span> </span><span id="L-5"><a name="L-5"></a><span class="p">}</span> </span></pre></div> </td></tr></table>
Symfony, css, date

PHP

Symfony 1.x : Show last executed query with Propel

1
2
3
<?php 

echo  Propel::getConnection()->getLastExecutedQuery();
https://snipt.net/embed/9135163b3940f8eacccd4f6e199c003b/
/raw/9135163b3940f8eacccd4f6e199c003b/
9135163b3940f8eacccd4f6e199c003b
php
PHP
3
2019-07-29T17:51:24
True
False
True
Sep 05, 2012 at 04:14 AM
/api/public/snipt/46708/
symfony-1x-show-last-executed-query-with-propel
<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></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="cp">&lt;?php</span> </span><span id="L-2"><a name="L-2"></a> </span><span id="L-3"><a name="L-3"></a><span class="k">echo</span> <span class="nx">Propel</span><span class="o">::</span><span class="na">getConnection</span><span class="p">()</span><span class="o">-&gt;</span><span class="na">getLastExecutedQuery</span><span class="p">();</span> </span></pre></div> </td></tr></table>
Propel, Symfony

YAML

Symfony 1.x : Increase timeout

1
2
3
4
5
6
7
# In apps/APP_NAME/config/factories.yml

all:
  user:
    class: myUser
    param:
      timeout: 7200 # 2h
https://snipt.net/embed/42b3f7ddbc2c4e2c1660b1521779fefd/
/raw/42b3f7ddbc2c4e2c1660b1521779fefd/
42b3f7ddbc2c4e2c1660b1521779fefd
yaml
YAML
7
2016-12-15T03:40:59
True
False
True
Sep 03, 2012 at 12:37 PM
/api/public/snipt/46648/
symfony-1x-increase-timeout
<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></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="c1"># In apps/APP_NAME/config/factories.yml</span> </span><span id="L-2"><a name="L-2"></a> </span><span id="L-3"><a name="L-3"></a><span class="l l-Scalar l-Scalar-Plain">all</span><span class="p p-Indicator">:</span> </span><span id="L-4"><a name="L-4"></a> <span class="l l-Scalar l-Scalar-Plain">user</span><span class="p p-Indicator">:</span> </span><span id="L-5"><a name="L-5"></a> <span class="l l-Scalar l-Scalar-Plain">class</span><span class="p p-Indicator">:</span> <span class="l l-Scalar l-Scalar-Plain">myUser</span> </span><span id="L-6"><a name="L-6"></a> <span class="l l-Scalar l-Scalar-Plain">param</span><span class="p p-Indicator">:</span> </span><span id="L-7"><a name="L-7"></a> <span class="l l-Scalar l-Scalar-Plain">timeout</span><span class="p p-Indicator">:</span> <span class="l l-Scalar l-Scalar-Plain">7200</span> <span class="c1"># 2h</span> </span></pre></div> </td></tr></table>
Symfony, timeout