Taggart's Code Blog

Please be aware this is aggregated content form my taggartjensen.com website, however it does give you some more insight into Drupal development
Subscribe to Taggart's Code Blog feed
Updated: 4 days 7 hours ago

Drupal Flag & Flag Count in views

Thu, 12/11/2014 - 10:49

this is just short and sweet if you want to use the excilent drupal flag module in views then you need to do 3 things:
1 install Views php module.
2 ) add a hidden field with the node id "Content: Nid" and hide it form display.

3) Now create a php view field and add the following:

Tags: drupal 7
Categories:

Drupal 7 Creating A Custom Web Service Module

Tue, 12/02/2014 - 15:24

The follwing is an example of creating a custom drupal 7  web service module , for the Services module.

Why I made this:  the reaso i made this is for the life of me i could not figure out how to
attach a file to a node when creating one with services (but not posting via endpoint/node/nodeid/attach_file ) .
 after you created a file with :

Session Authentication (X-CSRF-Token = token string )
after posting

{
  "username":"admin",
  "password":"admin"
}

to endpoint/user/login.json

Posting to endpoint/file

Tags: web servicesmodule development
Categories:

Drupal Services 3 & Titanium Upload Photo From the Photo Gallery

Sun, 11/30/2014 - 22:45

So this is another example of session authenticated calls to Drupal services this time adding a image upload test form the device Photo Gallery - look at the titanium for more examples you need session authentication, token (user resource , file create , node create & user login & user logout for this to work ) response for matters JSON

Tags: Titanium
Categories:

Drupal Services + Titanium User Login / out & Create a node

Sat, 11/29/2014 - 13:54
var mydrupalrest ="http://192.168.1.8/ilocal/theend/"; Ti.App.Properties.setString("mydrupalrest", mydrupalrest); var win = Titanium.UI.createWindow({ title:'TEST DRUPAL SERVICES', backgroundColor:'#fff' }); //view for login var loginview = Ti.UI.createView({ backgroundColor:'blue', borderRadius:5, layout:'vertical', top:120, height:300, width:300 }); var username = Ti.UI.createTextField({ hintText:'Enter your username', top:10, left:10, right:10 }); loginview.add(username); Tags: Titanium
Categories:

Wordpress custom form with validation example

Mon, 11/24/2014 - 13:17

so some times you just need to work in wordpress here is a custom form with validation example ment to be put in a custom plugin

Tags: wordpress
Categories:

Drupal 7 Form Example With Conditional Field & Date mod.

Wed, 11/19/2014 - 09:30

here is just an example of a drupal 7 form in a custom module that shows you how to use conditional fields & also bonus change the default date field to controol the year select range enjoy .

Categories:

Drupal & Titanium display Node With Services

Sun, 11/16/2014 - 18:31

it took me a few goes to figure out how to show a node so try this !  in you ap.js

Tags: Titanium
Categories:

Drupal 7 & Titanium web services

Wed, 11/12/2014 - 16:03

ok if you are reading this you want to make apps with titanium:
Here is an export of a testing service for drupal services module

Tags: Titanium
Categories:

Drupal & Titanium create a node webservice Example

Mon, 11/10/2014 - 15:43

so you have Drupal web services , and you want to make a mobile app here is an idea to create a simple node in your app.js add some thing like...
make sure your rest server is using jason as responce , this is an example with no authentacation , so you need to give the right permissions in drupl :)

Tags: Titanium
Categories:

More Fun with JASON - PHP Curl

Wed, 11/05/2014 - 13:31

ok so making a remote to local data  thing this is the verry basic idea
local file:

Tags: curl
Categories:

Drupal HTTPS Redirect Via .htaccess

Tue, 11/04/2014 - 08:25

So you got a ssl cert. and need to rediect to https ? cool in your Drupal .htaccess file do this :

RewriteCond %{HTTPS} off [OR] RewriteCond %{HTTP_HOST} ^yoursite.com\.com* RewriteRule ^(.*)$ https://www.yoursite.com/$1 [L,R=301] # Rewrite URLs of the form 'x' to the form 'index.php?q=x'. RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !=/favicon.ico RewriteRule ^(.*)$ index.php?q=$1 [L,QSA] Tags: drupal
Categories:

Curl & Jason in PHP

Mon, 11/03/2014 - 12:07

a basic curl app, using jason data this is just a note to self :) but shows how to post jason data via curl , then read the data sent and save to database , backbone is better but who cares this way works too...

Tags: curl
Categories:

Drupal 7 custom views filter from custom table

Thu, 10/16/2014 - 16:28

Ok so you made a drupal 7 module that uses custom tables and you want to use the values in views ,
cool that is cool here is how to do it the easy wa.

1) install schema  (https://www.drupal.org/project/schema)  - to help make your install file :)

Tags: drupal 7 views
Categories:

Drupal 7 create custom token in module

Mon, 09/15/2014 - 09:04

Some times it is grate to make custom tokens I  have modafied an example so you can see how:

Categories:

Drupal 7 Ajax Custom Module Example

Thu, 08/28/2014 - 12:15

This is an example  module that  shows some ideas of what you can do  drupal  ajax in a custom module  I will make a custom auto suggest box with the form api , and has ajax call back with the menu call back , stick that in a custom block, then do some jquery stuff to make it all work.

PRE COMMENT :
I Know I  am breaking some best practices  - but that  fine this is just an example ...
if you understand what I am doing below then you are smart enough to  understand what to do next.

Categories:

Ajax Simple Auto Suggest - Jquery

Thu, 08/28/2014 - 10:07

So you want to make an auto suggest  and you don’t want to use a jquery plug in that is fine
here is an example of how to do it  with Jquery .load() !

You need 2 files for testing :

1) index.html , or index.php – front end
2) return.php  - returned results

3) Loader Gif ()

Code for  your front end file:

Categories:

Jquery scroll to ellement

Wed, 08/27/2014 - 09:15

So you want to scroll to a position on a page with jquery try this !

Tags: jquery
Categories:

Drupal & infusionsoft php example

Wed, 08/13/2014 - 10:32

Working with drupal and infusionsoft ,  so your client has infusionsoft and want to interact with your drupal site .
so you installed the infusionsoft module and need to do custom things that "cant" be done with rules or (d6 conditional actions)  Like checking if user has a tag or if exists in infusionsoft or what ?! 
so then you go looking for examples of php & infusionsoft and find a lot of crap !  So lets have a look at this,

First create a custom module:
example mymodule.info

Categories:

drupal form render Fix Strict warning: Only variables should be passed by reference in

Wed, 07/23/2014 - 13:16

getting over the Strict warning

Tags: drupal 7drupal7
Categories:

Example Create New User using Services 3 and php CURL

Tue, 07/15/2014 - 11:31

this is an example of using drupals web services module - (rest server ) with create user function turned on - and anonymous - later ill include (application) authentication

Categories: