News module specifying priority within the tab

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
rooon
Forum Members
Forum Members
Posts: 113
Joined: Mon Dec 05, 2011 4:40 pm
Location: Nederland

News module specifying priority within the tab

Post 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?
User avatar
DIGI3
Dev Team Member
Dev Team Member
Posts: 1625
Joined: Wed Feb 25, 2009 4:25 am
Location: Victoria, BC

Re: News module specifying priority within the tab

Post 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.
Not getting the answer you need? CMSMS support options
rooon
Forum Members
Forum Members
Posts: 113
Joined: Mon Dec 05, 2011 4:40 pm
Location: Nederland

News module specifying priority within the tab

Post 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
rooon
Forum Members
Forum Members
Posts: 113
Joined: Mon Dec 05, 2011 4:40 pm
Location: Nederland

Re: News module specifying priority within the tab

Post 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.
User avatar
DIGI3
Dev Team Member
Dev Team Member
Posts: 1625
Joined: Wed Feb 25, 2009 4:25 am
Location: Victoria, BC

Re: News module specifying priority within the tab

Post 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.
Not getting the answer you need? CMSMS support options
rooon
Forum Members
Forum Members
Posts: 113
Joined: Mon Dec 05, 2011 4:40 pm
Location: Nederland

Re: News module specifying priority within the tab

Post by rooon »

Thanx, I see the whole picture now :)

I have in config 'permissive_smarty' enabled so the path is easy to get.
Post Reply

Return to “CMSMS Core”