Es mostren els missatges amb l'etiqueta de comentaris theme. Mostrar tots els missatges
Es mostren els missatges amb l'etiqueta de comentaris theme. Mostrar tots els missatges

dimecres, 20 de març del 2013

Theme override for Upload. module’s attachments list

Interesant post per tunejar els fitxers adjunts a Drupal. Ho hauré de posar en pràctica aviat per un web que estic desenvolupant, ja explicaré com va la experiència.

http://www.island94.org/2008/08/drupal-theme-override-for-upload-modules-attachments-list/

També tenim el mòdul itweak_upload que fa tot això per nosaltres ;) http://drupal.org/project/itweak_upload

Addthis custom button

La única referència que trobo del mòdul AddThis en quan a la personalització del botó Twitter i qualsevol altre és:

 CUSTOMIZATION

You have a number of options available at Administer / Site configuration / Addthis under Button image settings
and Widget settings. Image settings control the button image and widget controls the drop down and window that is opened when user clicks on a link sharing service. More information on how to customize your AddThis button can be found at http://addthis.com/help/customize/custom-button/
If configuration options are not flexible enough for you it is also possible to override theme_addthis_button in your own theme.

Quin merder!
Al final m'ho estic muntant solet a mà, llegint l'api de Twiter i així podem obtenir un codi semblant a:

<code>

<!-- Addthis theming -->
<div id="a9b-tweet-button">

<style type="text/css" media="screen">
  #custom-tweet-button a {
    display: block;
    padding: 2px 5px 2px 20px;
    background: url('http://a4.twimg.com/images/favicon.ico') 1px center no-repeat;
    border: 1px solid #ccc;
  }
</style>

<div id="a9b-tweet-button">
  <a class="a9b-tweet-button" href="https://twitter.com/share?url=http://www.eldominidelweb.cat/<?php print $node_url ?>" target="_blank"><img src="/dev/sites/all/themes/omega/css/img/ik_tweetthis_2.png" title="Twitter"></a>
</div>

</div>
<!-- //Addthis theming -->

</code>
Ara a per el de FB ;(

Un bon apunt per a gent amb poca memòria ;)

Theming a Node in Drupal...The Easy Way
Es tracta d'una mena d'apunts on recorda la forma de "tunejar" plantilles (o thems) a drupal. Al igual et sorprèn alguna forma ;)
En resum:

  1. Copy the existing node.tpl.php file (if you only want to move a few things around) and rename it to node-custom.tpl.php, the "custom" part is the machine readable name you gave your node.
    For example: a blog entry would be node-blog.tpl.php
  2. The other way is to simply make a new text file on your computer and name it node.tpl.php, this will give you a completely blank canvas to work with.
I si volem crear un tpl.php de zero també us semblarà per veure com "imprimir" al nostre web les diferents parts d'informació de cada node


Amb es ous ben fartets d'Omega Theme

Avui he perdut mitg mati per trovar una sol·lucio a una cosa tan, aparentment tonta, com la funcio que permet cridar un theme per cada tipus de contingut.
A la majoria de Themes de Drupal ja ve tot ben fet al template.php, pero al Theme Omega (que te altres molt bones coses) no hi havia manera de que rutlles.
Despres de mirar i remirar molt he trobat aquest senzill i genial truc:


Hi,
Copy all the code from your page.tpl.php, create a new file called page-default.tpl.php and paste the code in there.
Now delete all the code from your page.tpl.php and add the following:

<?php// Loads the front page templateif ($is_front) {
    include 'page-front.tpl.php';
    return; }
//Adding custom template based on content typesif ($node->type=='story') {
    include 'page-story.tpl.php';
    return; }
//if none of the above applies, load the page-default.tpl.php include 'page-default.tpl.php';
    return;?>

That should work.
El node original a: http://drupal.org/node/296111

Cóm tunejar la plantilla per tenir el link del logo per a cada idioma a Drupal 6 + i18n


The solution in: http://drupal.org/node/608302
Description
instead of
<?phpprint $base_path
?>

the link should be
<?phpprint check_url($front_page)?>