Drupal add filter through php snippet - drupal

I need to create a new filter for my view inside php snippet. Is it possible to do that using Drupal API? Can you also give me code example if possible?
Thank You,
Toliy

Your comment made much more sense ;)
What you are asking for is easily possible with Views out-of-the-box. Specifically, when you are in Views, lookk for the section called "Views arguments". To get you started there is a massive tutorial on drupal.org about them.
The path to your page will be something like:
movies/year/%
The character '%' signifies an argument

Related

Drupal know from where things are showed

I have a strange question but I don't find any hint about that (if it's possible), for a drupal 7 website I have to modify some content of a page in the backoffice, but I really don't know from where some content of this page is created (a table, similar to a view table but not a view table).
I just want to know if there is any way to show which php function the page use to finally be showed. I know there is something like that for the theme (drupal theme debug) but I don't find something for my case.
Any idea ?
You need PHP profiler to check all functions called on page, there's a module for Drupal7 for XHProf integration. But I would suggest you to use your browsers inspector as mentioned by 2pha before. For example if there's a form on the page just use the form ID to find it. Custom classes are very useful in these cases, parts of the html codes etc. In your case search for table headers...
The code you are looking for is most probably in custom modules and the
general suggestion is to keep you custom modules in separated folder from contributed ones.

Does 2sxc have tags and categories?

I've yet to find that 2sxc has facilities for entering, browsing, filtering and otherwise allowing keyword based filtering/sorting. If so, is there documentation about this, or sample code perhaps?
I'd think it might also be likely that one could use DNN's pretty good capabilities for tags and categories, and also razor queries would enable this, but I'd sure love to see some examples/guidance on best practices for doing so from within 2sxc.
This is very easy to do, but it's much more advanced that just tags / categories.
Basically you
Create a new ContentType for the related information - like Tag, Category or whatever. It can have more fields than just a title, as a category could also have an icon
Add some of that data
Go to the content type where you want to use it, create a "Entity / Content-Item" field
Then go to the field settings, give it the name of the related info that is allawed and if 1 or more items may be added (category is often just 1, Tags is often many)
that's it :)
I think I've found a start on this at:
http://2sxc.org/en/Docs-Manuals/Feature/feature/2685
and the demo at
http://2sxc.org/dnn-app-demos/en/Apps/FAQ-with-Categories

How to implement tags in Symfony 2?

I would like to have a form for entering tags (like the tag symfony2 in this post). Something like the field below would be great, but for starting it would be enough to have a text field with semicolon (;) or comma (,) separated values that go into an n:m relationship in a database.
Unfortunatly it is really hard to search for this, as virtually everything contains the word tag :)
There is a bundle that does most of the heavy lifting for you...
http://bundles.knplabs.org/FabienPennequin/FPNTagBundle
You will have to implement the client-side form control (jquery based probably), but could use something like jQuery TagIt
This may also be what you're looking for:
How to Embed a Collection of Forms
You might use the MkTagBundle:
https://github.com/Mykees/MkTagBundle
It contains also a seperate website for documentation here:
http://mykees.github.io/MkTagBundle
By the way, it contains a number of other bundles.

Drupal Views: How can I log searches?

Is there a module that allows me to log all the searches made on a view ?
Thanks !
I think you will need to write custom code to achieve that! I'm assuming you know some basics about writing Drupal custom code. You will need to use a hook that gets called before your view is displayed. In the hook you should log whatever information you want e.g. the keyword that was entered in the exposed filter.
Please see http://drupalcontrib.org/api/group/views_hooks/6 for the hooks that are available to you in Views.
I'm guessing you would probably use something like hook_views_pre_render

Customization of hook function

I Am new to drupal I need to customize core functionality like register module and event module.please share you thought / sample code / sample website for get the clarification over my issue
Thanks in advance
Balaji
From what you posted in the comment to creejayoz answer, it seems like what you are after is not using hook_form_alter, but something in the line of what the profile module does. It's part of drupal core, and with it you can add extra fields to the user like first and last name. There are also more advanced modules that you can use instead, but it seems like you wont need it. Using the profile module will also be a lot quicker and easier than using hook_form_alter as you wont need to create a db table make SQL and such to the save the data.
You can use hook_form_alter to heavily modify the way Drupal's registration works, by modifying the form's fields, adding extra validation/submit functions, etc. It's difficult to give more detail without knowing what you're wanting to do.

Resources