Adding a new template for CBSubs

6 years 3 months ago #300344 by pastoweb
Adding a new template for CBSubs was created by pastoweb
Hi, I want to edit the default template for CBsubs, I created a copy of the

/components/com_comprofiler/plugin/user/plug_cbpaidsubscriptions/templates/default

named

/TESTING/components/com_comprofiler/plugin/user/plug_cbpaidsubscriptions/templates/custom

Tryed also to edit the xml file, but in CBsubs settings I still see just the default template

Please Log in to join the conversation.

6 years 3 months ago #300370 by krileon
Replied by krileon on topic Adding a new template for CBSubs
CBSubs template files don't work like the other plugins where you'd just copy and paste the folder. CBSubs templates need to be installed. This means all the references to the old template need to be renamed. Specifically the below are important to change in your copy.

Rename: default.xml
To: custom.xml

Edit: /xml/edit.template.xml
FROM:
	<types>
		<type name="templates_list" base="list" valuetype="string">
			<option value="default">Default template</option>
		</type>
	</types>
	<templateglobalsettings>
		<if name="template" operator="=" value="template" valuetype="param:string" type="showhide">
			<fieldset name="currenttemplatesettings" label="Specific settings for the Default template" description="">
			</fieldset>
		</if>
	</templateglobalsettings>
	<templateplansettings>
		<if name="template" operator="=" value="template" valuetype="param:string" type="showhide">
			<fieldset name="currenttemplatesettings" label="Specific settings for the Default template" description="">
			</fieldset>
		</if>
	</templateplansettings>
TO:
	<types>
		<type name="templates_list" base="list" valuetype="string">
			<option value="custom">Custom template</option>
		</type>
	</types>
	<templateglobalsettings>
		<if name="template" operator="=" value="template" valuetype="param:string" type="showhide">
			<fieldset name="currenttemplatesettings" label="Specific settings for the Custom template" description="">
			</fieldset>
		</if>
	</templateglobalsettings>
	<templateplansettings>
		<if name="template" operator="=" value="template" valuetype="param:string" type="showhide">
			<fieldset name="currenttemplatesettings" label="Specific settings for the Custom template" description="">
			</fieldset>
		</if>
	</templateplansettings>

IN: custom.xml
FROM:
<name>Default</name>
TO:
<name>Custom</name>
FROM:
<description>CBSubs template plugin for the default template.</description>
TO:
<description>CBSubs template plugin for the custom template.</description>
FROM:
<filename plugin="cbpaidsubscriptions.default">index.html</filename>
TO:
<filename plugin="cbpaidsubscriptions.custom">index.html</filename>

That should give you a completely installable custom template. You'd just zip it and install it normally through CB > Plugin Management > Install New Plugin.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

6 years 1 month ago - 6 years 1 month ago #301676 by pastoweb
Replied by pastoweb on topic Adding a new template for CBSubs
Can't get this to work...I followed your instructions and created a template namend "forma", but I get this error:

Upload Failed
Installation filename `forma` (with .xml) does not match main php file plugin attribute `cbpaidsubscriptions.forma` in the plugin xml file
Failed to save Install CB Plugin because: Installation error

see the attached package... did I miss something?

File Attachment:

File Name: forma.zip
File Size:36 KB
Attachments:

Please Log in to join the conversation.

6 years 1 month ago #301694 by krileon
Replied by krileon on topic Adding a new template for CBSubs
Depends on if you're making a copy of the default template or rounded template. My instructions are a copy of the default template. A copy of the rounded template would be done as follows.

Copy: /components/com_comprofiler/plugin/user/plug_cbpaidsubscriptions/templates/rounded
As: /components/com_comprofiler/plugin/user/plug_cbpaidsubscriptions/templates/custom

Edit: /components/com_comprofiler/plugin/user/plug_cbpaidsubscriptions/templates/custom/xml/edit.template.xml
FROM:
<?xml version="1.0" encoding="UTF-8"?>
<cbxml version="1"   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="file:../../../../../cb/validation/ahawow.xsd">
	<license>GNU General Public License version 2 http://www.gnu.org/licenses/old-licenses/gpl-2.0.html</license>
	<types>
		<type name="templates_list" base="list" valuetype="string">
			<option value="rounded">Rounded template</option>
		</type>
	</types>
	<templateglobalsettings>
		<if name="template" operator="=" value="template" valuetype="param:string" type="showhide">
			<fieldset name="currenttemplatesettings" label="Specific settings for the Rounded template" description="">
			</fieldset>
		</if>
	</templateglobalsettings>
	<templateplansettings>
		<css file="templates/rounded/cbpaidsubscriptions.css" />
		<if name="template" operator="=" value="template" valuetype="param:string" type="showhide">
			<fieldset name="currenttemplatesettings" label="Specific settings for the Rounded template" description="&lt;img src=&quot;../components/com_comprofiler/plugin/user/plug_cbpaidsubscriptions/templates/rounded/images/membership_icon.png&quot; alt=&quot;&quot; /&gt;">
				<params name="params" type="params">
					<param name="template_rounded_icon" type="radio" default="" label="Icon" description="Icon for plan/subscription">
						<option value="">None</option>
						<option value="yellow">Yellow</option>
						<option value="red">Red</option>
						<option value="green">Green</option>
						<option value="blue">Blue</option>
					</param>
				</params>
			</fieldset>
		</if>
	</templateplansettings>
</cbxml>
TO:
<?xml version="1.0" encoding="UTF-8"?>
<cbxml version="1"   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="file:../../../../../cb/validation/ahawow.xsd">
	<license>GNU General Public License version 2 http://www.gnu.org/licenses/old-licenses/gpl-2.0.html</license>
	<types>
		<type name="templates_list" base="list" valuetype="string">
			<option value="custom">Custom template</option>
		</type>
	</types>
	<templateglobalsettings>
		<if name="template" operator="=" value="template" valuetype="param:string" type="showhide">
			<fieldset name="currenttemplatesettings" label="Specific settings for the Custom template" description="">
			</fieldset>
		</if>
	</templateglobalsettings>
	<templateplansettings>
		<css file="templates/custom/cbpaidsubscriptions.css" />
		<if name="template" operator="=" value="template" valuetype="param:string" type="showhide">
			<fieldset name="currenttemplatesettings" label="Specific settings for the Custom template" description="&lt;img src=&quot;../components/com_comprofiler/plugin/user/plug_cbpaidsubscriptions/templates/custom/images/membership_icon.png&quot; alt=&quot;&quot; /&gt;">
				<params name="params" type="params">
					<param name="template_rounded_icon" type="radio" default="" label="Icon" description="Icon for plan/subscription">
						<option value="">None</option>
						<option value="yellow">Yellow</option>
						<option value="red">Red</option>
						<option value="green">Green</option>
						<option value="blue">Blue</option>
					</param>
				</params>
			</fieldset>
		</if>
	</templateplansettings>
</cbxml>

Rename: /components/com_comprofiler/plugin/user/plug_cbpaidsubscriptions/templates/custom/rounded.php
To: /components/com_comprofiler/plugin/user/plug_cbpaidsubscriptions/templates/custom/custom.php

Rename: /components/com_comprofiler/plugin/user/plug_cbpaidsubscriptions/templates/custom/custom.xml
To: /components/com_comprofiler/plugin/user/plug_cbpaidsubscriptions/templates/custom/custom.xml

Edit: /components/com_comprofiler/plugin/user/plug_cbpaidsubscriptions/templates/custom/custom.xml
FROM:
<name>Rounded</name>
TO:
<name>Custom</name>
FROM:
<description>CBSubs template plugin for the rounded template.</description>
TO:
<description>CBSubs template plugin for the custom template.</description>
FROM:
<filename plugin="rounded">rounded.php</filename>
TO:
<filename plugin="custom">custom.php</filename>

That should be all you need to do for it to install and can then edit the files however you like. For the most part you shouldn't need to do this though as it can be styled entirely using CSS in most cases.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

6 years 1 month ago #301720 by pastoweb
Replied by pastoweb on topic Adding a new template for CBSubs
I'm copying the default template

Please Log in to join the conversation.

6 years 1 month ago #301725 by krileon
Replied by krileon on topic Adding a new template for CBSubs
You should be able to install your template through CB > Plugin Management > Install New Plugin after following the above instructions.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.263 seconds

Facebook Twitter LinkedIn