Friday, April 29, 2011

Drupal|Hierarchical Taxonomy + Views module

 
         
Working with drupal taxonomy and views I found a completely new and undiscovered power earlier at least for me. Combining taxonomy and views allows you to save to write a complete new modules for your website.
If you are looking for implementation of search based on categories hierarchical taxonomy like you need to show a country description with name and then the state description with name and then the cities with there description along with various other files. Grouped in hierarchical structure like:
-----------------------------
-country name
country overview
--state name
state overview
---city name
city overview
city image
city specialties
....etc
---city name
city overview
city image
city specialties
....etc
--state name
state overview
---city name
city overview
city image
city specialties
....etc
---city name
city overview
city image
city specialties
....etc
------------------------------
looped again and again on the bases of country term ID for taxonomy term passed in arguments as some kind of wild-card % in ur as.
taxonomy/term/%/country/overview
taxonomy/term/%/country/xyz
taxonomy/term/%/country/abe
taxonomy/term/%/country/blah
also when you are using tabbed menu for above written urls where each tab contains same structure as shown above with completely different fields comming from different content types.
So theming views for multiple layered grouping is not a easy task so we have a choice of writing a whole new module for it.
But suddenly a jugad comes in ur mind which is likely to be a more closer to drupal standards i.e. why shouldn't I use grouping from views on bases of term name (state name here) at top level of hierarchy and then implode it with the overview field for state using "rewrite the field as option" and "exclude from display" for the field added. Thus my grouping on bases of state is done. Then for cites I will use the term weight as i have already set the hierarchical structure in taxonomy (maintaining the continent->country->state->city) and have tagged my content types (like country, state and the City) with the parent it taxonomy. Thus now my weight for each node is set. Resulting in grouping of my cites inside the states. Fields inside cites are grouped and rendered as required using the template files of views (.tpl.php). So now fields inside my cites are grouped together.
the only left thing is to print the country name at the top that can be done as we are passing the parent term id i.e. the country term ID in the url.
creating a page type view template file and get the term ID from URL and then get the country name and description printed at the top all before all other loops.
MORAL is trust Drupal it can already do everything for you.

Saturday, February 19, 2011

Stop!! Ignoring yourself stay light stay happy....

People say what to do in free time that makes me feel jealous as I always think what not to do in busy hours, 24 hours really enough ? no not for me at lease. can you imagine if you just sleep 10 hours a day you spent 41.6667% for your life span sleeping :O tough job really its a tough job that's why life becomes a tough job for many people a more add-on to it what about the time you get bored ? Lets again put some mathematics here lets say on an average you get bored daily 2 hours. hmmm means 10 hours sleep + 2 hours bored = 12 hours making it to 50% it means 50% of life you are living again a tough job. Lets take a different angle for the above scenario the most logical angle used to solve and calculate maximum number of mathematical derivations and calculations base of PG-theorem "THE TRY-ANGLE." When you use this angle to your life your are hardly able to find time to get bored cos everything that you actually don't know you have to try it and develop a new method to do it, your own way. It adds innovation to life and finally leading to know and discover your PASSIONS that is this whole article is about. STOP IGNORING YOUR LIFE !!! AND YOURSELF!!!.
Another such aspect is your "NO" saying skills, we say no to 70% of incoming opportunities thinking I wont be able to do it, that's not my type, I am too shy, I am too religious and always my some or the constraint stops me from doing it..etc, I say again give it a TRY if you don't like it then say NO, cos in the end if u had nothing at least you will get to know a way that you never have to waste time on again, "So never say never to be there forever."   

Saturday, January 15, 2011

Hi brainiacs!

Hello Webbers!
Why I am here?
I have created this blog just to discuss FOSS and its future scope and how we can promote it, so that people are more aware of it and we can build the future with free rights to build, share, modify, cherish the power without paying a penny. As knowledge should be free for one who wishes to get it and utilize it in positive way to build a wonderful future.

Who am I?
I think of: Artificial Intelligence, Robotics. Sometimes I know about: Drupal, PHP. I love: Art, Sketching, Music and Voyages! I am passionate about: FOSS, Free Education. 

Why I like Drupal?
Because Drupal is free, well structured, powerful, flexible, robust and constantly being enhanced by hundreds of thousands of passionate people from all over the world.  We believe in open source and openness of knowledge.  Also Drupal allows you to build, share, modify, and cherish its power to reach to exact functionality that we are looking for.

Feel Free to talk to me!
Find me as "ravyg", "raviish" on google
Or http://ravyg.info/