5

I want to create some of these buttons in the frontend List view. I added checkboxes to the table and used the Using_the_JToolBar_class_in_the_frontend tutorial to put Save and Cancel buttons. Also added the Unpublish button with

$this->bar->appendButton( 'Frontend', 'unpublish', 'Unpublish', 'articles.unpublish', false );

But can't make it work to unpublish articles.
I put it in the same form as the table, so the action url is the same too, in my case:

/index.php?option=com_content&view=category&id=8&Itemid=116

It just redirects to the page without messages (error level is maximum).

Can't find how the admin Unpublish button works.
So maybe someone worked with these buttons.


It looks like this. The New Record button works, it uses this code:

$this->bar->appendButton( 'Standard', 'add', 'New Record', 'article.add', false );
  • Does user have the rights to execute these actions? E.g. manager – Anibal Feb 19 '15 at 23:13
  • Registered user has – mortalis Feb 20 '15 at 12:04
1

There is no controller for articles in the frontend. That's why articles.unpublish won't work. The toolbar itself is very flexible, but the default buttons just trigger a specific method of a controller.

Examples:

article.add will trigger ContentArticleController->add()

articles.publish will trigger ContentArticlesController->publish()

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.