By xpersonas on
Maybe it's because of the search terms, but I'm having trouble finding an article related to this.
I have a custom content type made. I've made several instances of this content type. I've used a view to list out all the content relating to the particular type set by the view. I would like to be able to add an edit button next to each piece of content in my view that authenticated users can use to edit each individual piece of content.
What is the best way to go about this?
Comments
Node: Edit Link
Is this a list or table view? If it is, try adding the "Node: Edit Link" field to your fields and see if that gives you what you want.
Ah...
Ah... thank you so much. That's perfect. So simple, but I didn't know.
This worked, but...
This worked great for my list view. But now I have a new table view. If I try adding a node:edit field, it opens up an empty cell on my table that even non-authenticated users see.
I'd like to have an edit button at the end of every row of my table. What would be the best way to accomplish this?
I have a page-employers.tpl.php for my page. Then I have a views-table-employers.tpl.php for my content. Theming a table seems much more difficult than theming a list view. Maybe I should avoid the table view if at all possible? I don't know.
I've never tried doing views
I've never tried doing views theming using a .tpl though it seems like the appropriate thing to do. If you can find the theming currently being used (where the empty cell shows up) and recreate it in the .tpl with a check for the user having edit employers permissions or something like that. I'm kind of surprised it provides a cell even for non-authenticated users - I thought sure it would respect the user priveleges.