Page 1 of 1
News module specifying priority within the tab
Posted: Sat May 30, 2020 1:19 pm
by rooon
Hi all,
My client (the editor) likes the priority & tab feature option in the "content" tag. It's great to organize content in the best way.
My client asked me to do the same on the News module. I defined several field definitions and he asked me for a better priority. His question is to put 2 wysiwyg fields between the content + status field. If this is possible, how do I do this?
Re: News module specifying priority within the tab
Posted: Sat May 30, 2020 2:31 pm
by DIGI3
You would need to copy the News module edit article template (I think editarticle.tpl) to /assets/module_custom/News/templates/, then edit it to display how you want.
There's various ways to do it, but I think in this case I would remove everything, {include} the original template so it's upgrade-safe, then just add some jquery to reorder the fields how you want. The default and custom fields all have unique IDs so can be manipulated easily.
News module specifying priority within the tab
Posted: Sat May 30, 2020 3:25 pm
by rooon
Thank you so much!
I copied file: modules/News/templates/editarticle.tpl
to folder: assets/module_custom/News/templates/
Then changed the copied file and it works like a charm.
Thanx for the support, Ronald
Re: News module specifying priority within the tab
Posted: Sat May 30, 2020 3:42 pm
by rooon
in this case I would remove everything, {include} the original template so it's upgrade-safe, then just add some jquery to reorder the fields how you want.
I want to give this a try too. What do you mean with "I would remove everything"? If I upload the template file "editarticle.tpl" in uploads/www/ then how or where to include this file in cmsms?
After that, the jquery is no problem.
Re: News module specifying priority within the tab
Posted: Sat May 30, 2020 3:53 pm
by DIGI3
By remove everything I mean essentially just have a blank file with the same name in the module_custom path specified above, then use Smarty's {include} to include the original template file. That way if the original template file changes when the module is upgraded, you're still using the most recent code.
So your custom template would look something like:
{include file='/full/path/modules/News/templates/editarticle.tpl'}
<__script__>
do stuff
</__script>
Make sure the /full/path bit is the full path in your file system starting with root. If you get a 500 error, you probably have the path incorrect.
Re: News module specifying priority within the tab
Posted: Sat May 30, 2020 4:14 pm
by rooon
Thanx, I see the whole picture now
I have in config 'permissive_smarty' enabled so the path is easy to get.