This is a very specific request, but could probably be applicable elsewhere. I want to include a CP field in a view's exposed filter block. To further complicate matters, I want this field to be editable. I have a view set up to use exposed filters in a block. I'm using a tpl file to theme that block. I've tried embeding a view into the tpl that contains the one field I need and use the editable fields module to make that field editable. Doing it this way breaks the view in IE (7 & 8). Is there a way that I can pull this field into the block in its editable format without using the editable fields module? I've tried every way I can think of to do so. Using the following:
<?php
global $user;
$contentprofile = content_profile_load('profile', $user-uid);
print $contentprofile->field_gender[0]['value']
?>
in the tpl file shows me the values stored, but offers no way to edit from there. Is there a way to get editable values? Even using the editable fields module I set the display for full to "editable", but cannot get it to be so.
Any help with this would be really appreciated. I've got an issue in with the editable fields module, but if I can figure out a way to do it without using that it would be great since this is the only field I need to be editable outside of its normal form a whole other module seems like overkill. Thanks!
Comments
Comment #1
scalp commentedBy the way, I've also tried using the $content_profile variable. I get the following error when trying to use $content_profile->get variable:
Fatal error: Call to a member function get_variable() on a non-object in.......
Does this mean that it is needing to be added to my template? If so can you explain how to do this? I don't understand how to get the key of my template's entry in the theme_registry (hook_theme()) as suggested in the documentation. In other words, what would I replace 'my_template' with in the following:
$conf['content_profile_extra_templates'] = array('my_template');
Comment #2
scalp commentedI've come up with a solution that seems to work. Figured I'd post it in case anyone else needs it. Instead of trying to pull in the fields directly I decided to stay with the views idea and only pull it into the block on Firefox browsers and give a link to change the CP field for IE browsers by inserting the following into my exposed filter tpl:
Looks like it works great. Got the browser detection code from here http://drupal.org/node/65903.