PDA

View Full Version : [SOLVED] Templates all in one group (product development)


Dr.CustUmz
02-20-2016, 06:46 PM
I am trying to make all of my products templates fall under one group. I do this by using these lines of codes in all of my products:

<plugin active="1" executionorder="5">
<title>Dirt RIF CustUmz Template Group</title>
<hookname>template_groups</hookname>
<phpcode><![CDATA[$only['drc_'] = $vbphrase['dirt_rif_custumz'];]]></phpcode>
</plugin>
<phrasetype name="Control Panel Global" fieldname="cpglobal">
<phrase name="dirt_rif_custumz" date="0" username="DrCustUmz" version="1.2"><![CDATA[Dirt RIF CustUmz]]></phrase>
</phrasetype>

but when i uninstall one product it breaks the template group by what i believe its doing is removing the phrase.

is there another way of accomplishing this other than they method i am trying to use?

Paul M
02-22-2016, 06:52 PM
You could try making the phrase unique to each product, so uninstalling one would not affect any others.

Dr.CustUmz
02-23-2016, 04:10 PM
would that be able to keep them all in the same group in the template systems though?

so each of my products would still get put in (for example

Dirt RIF CustUmz Templates
>drc_prdct1
>drc_prdct1_main
>drc_prdct1_css
>drc_prdct2
>drc_prdct2_js

Paul M
02-23-2016, 04:26 PM
would that be able to keep them all in the same group in the template systems though?

so each of my products would still get put in (for example

Dirt RIF CustUmz Templates
>drc_prdct1
>drc_prdct1_main
>drc_prdct1_css
>drc_prdct2
>drc_prdct2_js
Yes.

You would simply be assigning the phrase to $only['drc_'] in every product, but as they will all be the same Text (but different phrase names) its not going to matter which one is the final assignment.

Dr.CustUmz
02-23-2016, 05:30 PM
worked, thanks =)