Archive for Views

Goo.gl PHP API

Share

Sharing is sexy...Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedIn
109 views

Using node_presave to make value utf8 encoded

Share

While using feeds, sometimes we need to convert data received from feeds to utf8 format. There were queries how we can do this, well there are modules available for that but if that is the only thing you want to do then simply use hook_presave like below.



In my case I had this problem for body field. So I used presave hook to convert string to utf8 for body field of that content type.

I was getting error below when I was importing posts from facebook.

So I have written function below in .module file of my custom module.

This worked fine!

Sharing is sexy...Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedIn
462 views

Drupal view listing content associated with term ID from URL

Share

If you want to have content listed with taxonomy term id in URL. Below are the things you need to do.

1. Create a view of type block having list of all taxonomy terms and have them a link to some page with term id in it.
2. Create content view of type block and have contextual filter there with “Content: Has taxonomy term ID” click on “Provide default value” and select “Taxonomy term ID from URL”
3. Create a page with some URL Read more

Sharing is sexy...Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedIn
569 views