Conditional based on {author} not working
Posted: 21 August 2004 12:22 AM   [ Ignore ]  
Lab Assistant
RankRank
Total Posts:  110
Joined  01-13-2004

Hello, can someone tell me why I can’t get the following to output anything?

{if author != “nobyline”}
By {author}
{/if}

Profile
 
 
Posted: 21 August 2004 05:29 AM   [ Ignore ]   [ # 1 ]  
Research Assistant
RankRankRank
Total Posts:  326
Joined  12-21-2003

{if author == ""}


is not part of the Conditional Global Variables
You can however use :

{if screen_name == ""}


or

{if username == ""}

Finally :

{if username != "nobyline"}
By {author}
{
/if}

Profile
 
 
Posted: 21 August 2004 07:26 AM   [ Ignore ]   [ # 2 ]  
Moderator
Avatar
RankRankRankRankRankRankRankRank
Total Posts:  32852
Joined  05-14-2004

Actually, as lon gas you are inside the exp:weblog tag you can use author_id to check.  For instance, I like to show an image if the author of a post is NOT me.  I use this code for that:

{if author_id != "1"}
<img src="{exp:gravatar email="{email}"}"  class="floatpicleft" alt="gravatar!"/>
{/if}

Username and Screenname work against the currently logged in user - not the author of the post, so would have an entirely different effect. =)

 Signature 
Profile
MSG
 
 
Posted: 21 August 2004 07:54 AM   [ Ignore ]   [ # 3 ]  
Research Assistant
RankRankRank
Total Posts:  326
Joined  12-21-2003

Hmmm I though the module would make it display the author of the entry.

So any Weblog Entries Single Variables can be used in a conditional ?
Then how will EE guess the difference between this with Global Conditional :

{if username == "elvira"}
Hi
, mom! I know it's you!
{/if}


and this with Weblog Entries Single Variable :

{if username == "elvira"}
Hi
, mom! I know it's you!
{/if}


To answer first post I’ll say that the value of screen_name is empty in the profile.
{author} would display the username but the screen_name can’t be verified.
:-\

Profile
 
 
Posted: 21 August 2004 08:00 AM   [ Ignore ]   [ # 4 ]  
Moderator
Avatar
RankRankRankRankRankRankRankRank
Total Posts:  32852
Joined  05-14-2004

username is the value of the person currently logged in, in both cases, to my knowledge.

 Signature 
Profile
MSG
 
 
Posted: 21 August 2004 08:05 AM   [ Ignore ]   [ # 5 ]  
Research Assistant
RankRankRank
Total Posts:  326
Joined  12-21-2003

Seems not

Profile
 
 
Posted: 21 August 2004 11:04 AM   [ Ignore ]   [ # 6 ]  
Lab Assistant
RankRank
Total Posts:  110
Joined  01-13-2004

Thank you LisaJill, I was not aware of the ‘author_id’ being something i can check against.

strange you can’t check against ‘author’ though.

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 09:33 AM
Total Registered Members: 64885 Total Logged-in Users: 67
Total Topics: 81811 Total Anonymous Users: 38
Total Replies: 439814 Total Guests: 293
Total Posts: 521625    
Members ( View Memberlist )
Newest Members:  kikibalkhulaidi19Hotcards.comShrike67Dynamic1justingpticketjendicottdxrsmdanbilly