The Joomla! Forum ™



Forum rules


Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.



Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: Fri Nov 27, 2009 10:52 pm 
User avatar
Joomla! Explorer
Joomla! Explorer

Joined: Thu Sep 15, 2005 6:04 pm
Posts: 327
Location: Little Rock, Arkansas
I have a client who wants to hide the Edit Article icon for Authors after the article is published. I'm working on a template override for com_content to handle this. I tried using some code from default_item under com_content/frontpage but that doesn't work.

I have scoured Google and the forums and I'm trying to figure out how to get an article state (published or not published) in default.php in com_content.

Anyone have any ideas? I have tried scouring the API docs as well and now I'm scratching my head on this one.

Thx.

_________________
Web Design, Hosting, Flash Development, Graphics & Logo Design
"The Web Made Easy"
http://www.web-jive.com


Last edited by WebJIVE on Sat Nov 28, 2009 1:24 pm, edited 1 time in total.

Top
 Profile  
 
PostPosted: Sat Nov 28, 2009 8:16 am 
User avatar
Joomla! Hero
Joomla! Hero

Joined: Wed Jun 07, 2006 9:10 am
Posts: 2457
Location: Brasov - Romania
Code:
$this->article->state
should give you the state of article in that file ( default.php ).
1 is for published.

_________________
My extensions - http://extensions.joomla.org/extensions/owner/algisinfo


Top
 Profile  
 
PostPosted: Sat Nov 28, 2009 11:21 am 
User avatar
Joomla! Explorer
Joomla! Explorer

Joined: Thu Sep 15, 2005 6:04 pm
Posts: 327
Location: Little Rock, Arkansas
Hmm.. I tried that before posting and it didn't return anything. Let me give it another try. :)


Top
 Profile  
 
PostPosted: Sat Nov 28, 2009 1:24 pm 
User avatar
Joomla! Explorer
Joomla! Explorer

Joined: Thu Sep 15, 2005 6:04 pm
Posts: 327
Location: Little Rock, Arkansas
That did the trick! I was able to create an override to give them what they wanted.

Thanks!

_________________
Web Design, Hosting, Flash Development, Graphics & Logo Design
"The Web Made Easy"
http://www.web-jive.com


Top
 Profile  
 
PostPosted: Tue Apr 17, 2012 5:49 pm 
User avatar
Joomla! Apprentice
Joomla! Apprentice

Joined: Sun Apr 10, 2011 3:38 pm
Posts: 33
To me it still doesn't return anything in my template override, though I'm using 1.7. I know it's the 1.5 forum but I'm getting no help over there. I'm trying to put a mark next to archieved articles, and I'm using

Code:
<?php if ($this->article->state ==-1) : ?>   
Lorem ipsum dolor sit amet
<?php endif; ?>


But there is no lorem ipsum shown on the page. Even if I try to echo $this->article->state, I get nothing. What am I messing up?

_________________
Rock n roll.


Top
 Profile  
 
PostPosted: Tue Apr 17, 2012 10:13 pm 
User avatar
Joomla! Apprentice
Joomla! Apprentice

Joined: Sun Apr 10, 2011 3:38 pm
Posts: 33
Ok, it is $this->item->state in 1.7, just had to try around 100 stuff.

_________________
Rock n roll.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 



Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group