Showing EDIT link only to author
Posted: 09 May 2008 06:08 PM   [ Ignore ]  
Grad Student
Avatar
Rank
Total Posts:  39
Joined  2007-09-16

UPDATED BELOW IN REPLY

Hi, kids…

I’m trying to display an “Edit Entry” link only to the author, and it’s turned out to be tricky.

I also want to use a conditional that will display the entry if 1) the author has marked it for Sharing, or 2) the logged in member is the author.

I’ve read about this problem.

author_id=={member_id}

doesn’t work within entries pairs. I’ve also read about the Alternate Syntax, and I’ve tried conditionals involving author_id, member_id, logged_in_member_id, CURRENT_USER, etc., but no joy so far… The link appears for every member. And it looks like the entry will appear to everyone whether Shared or not.

Below,

field_id_92

is the “Share Entry” custom field, and

field_id_93

is the contents being displayed.

Here’s the non-functioning code (although the if field_id_92=="Yes” part does apparently work):

{exp:weblog:entries weblog="weblog_name" show_expired="yes" rdf="off" limit="1"}

{if field_id_92
=="Yes" OR author_id=={member_id}}Site Title :

{exp:member:custom_profile_data}{first_name} {last_name}

{
/exp:member:custom_profile_data}  Page title


{if author_id
=={member_id}}  [ EDIT this Entry ]

{
/if}

(Field description):
{field_id_93} (Entry contents)


{if:else}This member has not chosen to make this entry public.{/if}{/exp:weblog:entries}

Incidentally, if I replace member_id with logged_in_member_id, I get a blank page. Otherwise, everything displays to all members.

Anyone?

TIA as always!

 Signature 

...Bob

Bob West
–––––––––––––––––––––––––––––––––––––––––––––––––––––––
Thought Nozzle(TM)
creative consultation:
graphic design . concepts . identity . web . writing
http://www.thoughtnozzle.com/
–––––––––––––––––––––––––––––––––––––––––––––––––––––––

Profile
 
 
Posted: 09 May 2008 06:33 PM   [ Ignore ]   [ # 1 ]  
Grad Student
Avatar
Rank
Total Posts:  39
Joined  2007-09-16

Sorry… Wasn’t searching properly in the Wiki. Looks like I found it!

{if logged_in_member_id == "{member_id}"}
        
<a href="/admin.php?C=edit&M=edit_entry&weblog;_id={weblog_id}&entry;_id={entry_id}">Edit</a>
    
{/if}

I’ll try this and get back to ya…

 Signature 

...Bob

Bob West
–––––––––––––––––––––––––––––––––––––––––––––––––––––––
Thought Nozzle(TM)
creative consultation:
graphic design . concepts . identity . web . writing
http://www.thoughtnozzle.com/
–––––––––––––––––––––––––––––––––––––––––––––––––––––––

Profile
 
 
Posted: 11 May 2008 08:27 AM   [ Ignore ]   [ # 2 ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  19696
Joined  2002-05-20

Good searching- let us know if that does the trick.  It should.

 Signature 

AKA rob1

Help Request Tips * Pro Network

Profile
 
 
Posted: 11 May 2008 11:35 AM   [ Ignore ]   [ # 3 ]  
Grad Student
Avatar
Rank
Total Posts:  39
Joined  2007-09-16

Did indeed…

I was doing it backwards:

{if member_id == "{logged_in_member_id}"}

I’m sure I’ll eventually grasp why that doesn’t work but the wiki version does.  smile

Thanks, Robin!

 Signature 

...Bob

Bob West
–––––––––––––––––––––––––––––––––––––––––––––––––––––––
Thought Nozzle(TM)
creative consultation:
graphic design . concepts . identity . web . writing
http://www.thoughtnozzle.com/
–––––––––––––––––––––––––––––––––––––––––––––––––––––––

Profile
 
 
Posted: 12 May 2008 10:12 AM   [ Ignore ]   [ # 4 ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  19696
Joined  2002-05-20

Hm- I’m not dead sure why it wouldn’t work in either order myself.  But- glad you did get it squared away!

 Signature 

AKA rob1

Help Request Tips * Pro Network

Profile
 
 
   
 
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 1149, on July 16, 2007 10:33 AM
Total Registered Members: 58134 Total Logged-in Users: 24
Total Topics: 68139 Total Anonymous Users: 18
Total Replies: 366989 Total Guests: 411
Total Posts: 435128    
Members ( View Memberlist )
Newest Members:  Doug LernerATATJacob SmithalixJonathon VSgoodbergerDelia RitherdonbborunXofzainabob