[drupal][Views] Display a view Total Rows

Archives,  Drupal,  IT

Using the views module is always a cool and funny experience but when you have to display the number of rows/results and a counter for each row then you stop smiling :-/. I finally found how to do it in a simple way 🙂 Here we go …(I assume you know how to ovewrite a theme file and to display a view using the Table styling)1- Enable the pagination (without this you won’t get the $view->total_rows value)2- Copy and the file ‘views-view-table.tpl.php’ in your theme folder (themes/garland or sites/all/themes/my_theme for example)3- Rebuild the theme registry to enable your new table_theme file4- Adding the total by displaying the $view->total_rows variable TOTAL : total_rows ; ?> and that’s it !! PS: As far as the line number counter all you need is to define a variable ($counter) that you increment in the foreach loop.

May 22, 2010 / 0 Comments
read more

Drupal: node_import (module)

Archives,  Drupal,  IT

I am using for the 2nd project the module node_import for data migration ; the main issue is how special characters are handled. Another issue is the relation between nodes and taxonomies. I need to write a proper blog post asap ….

April 10, 2010 / 0 Comments
read more

[Drupal] Views Error occured !!!!!

Archives,  Drupal,  IT

Un constat bizarre : En voulant personnaliser une vue je n’ai cessĂ© d’obtenir le message“An error occurred at /drupal/admin/build/views/ajax/preview/”. J’ai au premier abord installer/dĂ©sinstaller les modules “devel”, “Admin menu”, “Menu”.Puis après j’ai activĂ© le ‘clean url’ la réécriture des liens.Mais peine perdue. Un tour sur le net m’a dabord rassurĂ© que je n’Ă©tais pas le seul Ă  avoir ce problème. J’ai finalement rĂ©solu le problème en installant PHP 5.2.9 comme l’a suggĂ©rĂ© quelqu’un http://drupal.org/node/295246#comment-2312134 (Xammp1.7 au lieu de Wamp 2). Mai je me demande toujours pourquoi cette solution pour ce problème ??????

December 22, 2009 / 0 Comments
read more

A new drupal module: userdashboard

Archives,  Drupal,  IT

I am working this last days on a new drupal module “userdashboard”. You will probably say “another module?”, “what is so cool about it?”, etc. And you may be right but I need to tell first why this new module needs to be checked. – The dashboard feature …Having my page, with my ‘content containers’ that I can arrenge as I want is something we all look for when we visit a portal/web site. – The key here is the fact of using ‘blocks‘…A block can have all type of information and in case a module is not providing a block that by default the ‘views’ module is there to help to display the content generated. So the idea is that if I can display blocks , I can display everything I want (at least what the site admin want me to :), he is the boss). Thus the module is allowing the admin to select ‘allowed’ blocks, that the user can ‘manage’ and then be able to view them on his dashboard. There are things (especially the UI) I need to improve but I think this can ROCK… Now why don’t you take a look at it http://202.53.13.107:9007/ and tell me why I should stop/continue dreaming about it ? 🙂

April 15, 2009 / 0 Comments
read more

Drupal: Modifying core code

Archives,  Drupal,  IT

I was thinking of one of the best way to “touch” core code (drupal or contributed modules).This aspect matters when an upgrade is needed. The easier it is the happier you are. And right now I think I find a “smooth” way.Let’s assume I really need to change the node_save function in the node.module file (I know you were saying: “ALWAYS TRY TO AVOID TOUCHING people’s code” :-)). 1- I’ll rename the default function to mv_node_save (in node.module) for example. 2- Include, in node.module, my file modif_node.module created in “sites/all/modif_code/modif_node/“. And in my new file i will put the code in the node_save function. So my new instructions will be taking into account without having to do many ‘gymnastics’. 3-Keep track of patches : Once the code is in production (basically after major testing), generate patch file to keep track of what has changed. So in my case node.patch will mention only my include and the function renamed. Thus the day i will need to upgrade, i will change only my code and maybe rename function.I need to check all this and probably think of some details after some projects. But I think this approach will make life less painful every time the “upgrade” word is appearing somehere :-). ! test and see …

April 1, 2009 / 0 Comments
read more

Drupal : Change the installation language

Archives,  Drupal,  IT

Here are the steps to follow when you want to translate the installation interface of drupal. 1- Download the language package from http://drupal.org/project/translations. 2- Copy from the extracted folder of the translation package (french in my case) the ‘translations‘ folder “fr-6.x-1.0\profiles\default\translations” . 3- Paste the folder in “mydrupal\profiles\default”. 4- Go and select your language on the installation page. and here are the installation screens.

March 15, 2009 / 0 Comments
read more

Drupal : template’s and module’s name must be differents…

Archives,  Drupal,  IT

When the template and a module that generate a block has the same name, all the blocks are no more shown. Example : my template is called mytest, my module is called mytest and i am generating a block called mytest_block(). Result, Every time my block must be shown, all the blocks disappeared…

June 22, 2008 / 0 Comments
read more

Posts pagination

Previous 1 2