By mattrweaver on
I have created a CCK field type, but have written a little form code. When I put the code in a story, it is processed just fine, does everything I want, makes me flippin' happy.
In my CCK field, I created a text field and made the form code the "default value". But, when I try to make php the default input format, the system returns to FULL HTML, and even so, the HTML isn't processed, just displayed as plain text. I have been over my input types in site configuration.
Maybe I'm missing something obvious, maybe I need a different type of CCK field. Any help would greatly aid in the preservation of my sanity.
Thanks.
mrweaver
Comments
Do you have any additional
Do you have any additional modules besides CCK running?
The Devel & contemplate modules can help when you're trying to figure out the value of node variables.
I do wonder why this HTML & PHP code would be a default value for a field. Do you want every node created to have this php code? It would seem you could do something on the theme level to handle whatever functionality you need.
HTML & PHP
I've created a little form for searching a third-party provider's site for images adapting that company's webform formula. The form enables someone to find an image, and then copy the image location into another field and place it in a field so that it displays in the node. I want this for every node.
I was referred to Contemplate and the thing wouldn't install at all. Weirdest thing. Wouldn't create a table in the database. I'll look at Devel.
But do you know why the HTML in a CCK text field isn't parsed?
Thanks
mrweaver
Finished products are for decadent minds. -- Isaac Asimov
Finished products are for decadent minds. -- Isaac Asimov
The functionality you
The functionality you describe seems like it would best to be running inside of a custom module. Taking the time to setup a module is well worth the trouble when you're dealing with code like this.
If you've had trouble installing modules because of not being able to create tables you may want to address that issue before worrying about other things, check your database user permissions.
As far as why the field appears as plain text, no idea. Once place to look is at the field value in the database to ensure its not encoded there.
Try the computed field
Try the computed field module.
------------------------------
http://fraggles.artsci.wustl.edu (Drupal user documentation and development blog)
Will it parse the HTML?
I have played around with "computed field" but haven't been able to get it to work. Would I include HTML form code?
One thing that I had noticed is that for my custom content type, when I set the input format to php, it won't save it, and always reverts to full html no matter what I do. I have looked at my "php code" filter, but can't see anything wrong with it, as php in other nodes works just fine.
Finished products are for decadent minds. -- Isaac Asimov
Finished products are for decadent minds. -- Isaac Asimov
problem solved in my template
I had the same problem last day. After a long search I found the problem was my in the code in my template made by the contemplate module.
When you add the cck field to your template, contemplate adds a check_plain() function around my cck field value.
By removing this function solves the problem!