i wanted to know how can you add a edit link next to answer when a user with access is logged in. i'm using clicking on question opens/hides answer under question option.

CommentFileSizeAuthor
#1 faq_5x_281827.patch895 bytesstella
#1 faq_6x_281827.patch894 bytesstella

Comments

stella’s picture

Status: Active » Fixed
StatusFileSize
new894 bytes
new895 bytes

I've added this feature, so a "Edit answer" link is now added beneath the answer, alongside the "back to top" link, etc. Please try out the attached patch or the latest dev release (available later today).

Cheers,
Stella

abhinavlal’s picture

Thanks its working perfectly.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.

stella’s picture

Released in 5.x-2.12 and 6.x-1.8.

drupalina’s picture

Version: 5.x-2.9 » 6.x-1.12
Status: Closed (fixed) » Active

Hi,
I'm going to reopen this issue.
I'm using the latest 6x-1.12 version of FAQ and I can't see any "edit" or "delete" links. This makes the management of FAQ very hard and complicated!
I'm using "Clicking on question opens/hides answer under question" option with accordion effect.

drupalina’s picture

Title: Edit faq option » Detele faq option

Sorry, for reopening the issue in #5.
It turns out that with i18n settings I have to go and check "Show node links" in FAQ setting for all different languages.

It would still be very useful to also display the "Delete" link for those who have the permission to delete that FAQ node. Is it possible to do through any of the tpl files? If yes, which one? Or is it better to leave to you to do it from within the module, so as not to fork it?

drupalina’s picture

Status: Active » Needs review

based on the code on line 1188 of the faq.module I added these lines.

  // Add "Delete answer" link if they have the correct permissions.
  if (node_access('update', $node)) {
    $node->links['faq_delete_link'] = array(
      'title' => t('Delete'),
      'href' => "node/$node->nid/delete",
      'query' => drupal_get_destination(),
      'attributes' => array('title' => t('Delete answer')),
    );
  }

I don't know if this will work. Please review and test.

stella’s picture

Status: Needs review » Closed (won't fix)

Hmmm I don't think I want to add an additional option for that at this stage. Deleting faqs isn't as common a task as editing them, so those with the appropriate permissions can just click on the edit link and use the delete button there.

  • stella committed 97fdb1c on 8.x-1.x
    #281827 - "edit answer" link now provided on faq page under the answer...