Page 1 of 1

DIRECT NEWS EDIT ACTION LINK for specific user

Posted: Wed Oct 19, 2016 7:41 pm
by pWorker
Hi all,

i have a problem:
There is no real search for news-articles in the backend (the admin search didn`t even find a news article even when i insert the whole url to it...). So if the admin has to correct a specific article he saw in frontend, he has to look up every single article in the article list in the backend to find the right one.

My idea is now, that when the admin/ a specific user is logged in, every article in the frontend shows him an action-link to edit that specific article.

Code in news-summarydetail-tpl:

Code: Select all

{foreach}
...
{feu_smarty::get_current_userid()}
{if $current_userid == 1} 
{cms_action_url module=News action=editarticle}
{/if}
...
{/foreach}
Would that be a secure solution for it?


Thanks is advance!

Re: DIRECT NEWS EDIT ACTION LINK for specific user

Posted: Thu Oct 20, 2016 7:16 am
by calguy1000
you can use {$uid=get_userid(false)} to get the uid of the currently logged in admin user. it will be empty'/0 if the user is not logged in.

Re: DIRECT NEWS EDIT ACTION LINK for specific user

Posted: Thu Oct 20, 2016 9:20 am
by pWorker
Hi calguy,

thx for your hint, I will use that if the link is created propper.

Now, this code:

Code: Select all

{cms_action_url module=News action=editarticle mid=m1_}
gives me this url:

Code: Select all

http://www.xxx.de/index.php?mact=News,cntnt01,editarticle,0&cntnt01returnid=13
...which results in errors like...

Code: Select all

Syntax error in template "module_file_tpl:News;editarticle.tpl"  on line 151 "*{$titletext}: {cms_help key='help_article_title' title=$titletext}" unknown tag "cms_help"
As far as i could understand, the returnid has to be set to the admin editarticle interface. Also the action id has to be set to m1_, not cntnt01.

But are there returnids for the admin pages? And why didn`t the call accept the "mid" parameter?


Thanks in advance!

Re: DIRECT NEWS EDIT ACTION LINK for specific user

Posted: Thu Oct 20, 2016 12:23 pm
by chandra
pWorker wrote: Now, this code:

Code: Select all

{cms_action_url module=News action=editarticle mid=m1_}
gives me this url:

Code: Select all

http://www.xxx.de/index.php?mact=News,cntnt01,editarticle,0&cntnt01returnid=13
It seems plugin is only usable for frontend actions. Url must be something like

Code: Select all

http://www.domain.com/admin/moduleinterface.php?mact=News,m1_,editarticle,0&_sx_=4bd3085239f8ee95&m1_articleid=1
Have seen some times ago a modification of the old CMSMS edit plugin out there which create links for different backend actions.

Re: DIRECT NEWS EDIT ACTION LINK for specific user

Posted: Thu Oct 20, 2016 1:14 pm
by Rolf

Re: DIRECT NEWS EDIT ACTION LINK for specific user

Posted: Thu Oct 20, 2016 4:56 pm
by pWorker
Hey Rolf,

I`ll definitely give that one a try. Sounds good!
Meanwhile I also registered to another cmsms forum with my question and i got the information, that the cms_action_url plugin gets actualized over the next 4 weeks.

Thanks for your help!