Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

Adding A New Banner Template Rate Topic   - - - - -

 
  • UK Promotion
  • Junior Member
  • Members
  • Join Date: 07-May 11
  • 24 posts

Posted 30 December 2020 - 04:12 PM #1

Hi Everyone,
 
I've been looking to put together an addon to add support for a different slider other than owl carousel for CS-Cart.  I "thought" i had don't everything correctly, however have no idea how to add a new option to the current "banners" module.  Basically CS-Cart out of the box has the banner templates of:
  • Original
  • Carousel
I'd like to add a third option.  Currently I have the following making up the addon:
 
 
app/addons/addon_name/schemas/block_manager/blocks.post.tpl
 
<?php
 
$schema['banners']['templates']['addons/addon_name/blocks/addon_name.tpl'] = array();
 
return $schema;
app/addons/addon_name/addon.xml
 
<?xml version="1.0"?>
<addon scheme="3.0">
	<id>addon_name</id>
    <version>1.0</version>
	<name>Addon Name</name>
    <default_language>en</default_language>
	<status>active</status>
	
	<language_variables>
		<item lang="en" id="addon_name">Addon Name</item>
	</language_variables>
    <compatibility>
        <dependencies>banners</dependencies>
    </compatibility>
</addon>
app/addons/addon_name/func.php
 
<?php
if (!defined('BOOTSTRAP')) { die('Access denied'); }

js/addons/addon_name/js_name.js
- containing the js needed
 
design/themes/responsive/css/addons/addon_name/styles.css
- containing the css needed
 
design/themes/responsive/templates/addons/addon_name/blocks/addon_name.tpl
- containing the front end code needed
 
design/themes/responsive/templates/addons/addon_name/hooks/scripts.post.tpl
- containing the link to the aforementioned js
 
design/themes/responsive/templates/addons/addon_name/hooks/styles.post.tpl
- containing the link to the aforementioned css
 
--
 
What am I missing? (the list of templates for the banner block still only shows original and carousel not the new template I am trying to add).  Any help is much appreciated and once complete the addon will be released free of charge here.
 
Have a wonderful New Year!
 
Rob
UK Promotion
Fresh and creative brand, marketing, PR and web specialists.

 
  • harmsmitsdev
  • Senior Member
  • Members
  • Join Date: 22-Feb 20
  • 196 posts

Posted 30 December 2020 - 09:20 PM #2

It is `block_manager` not `block-manager`. Besides that, you should also clear your cache after changing those files or enable development mode and disable block caching.

app/addons/addon_name/schemas/block_manager/blocks.post.tpl

Furthermore, your schema should look as follows:

<?php

$schema['banners']['templates']['addons/addon_name/blocks/addon_name.tpl'] = array();

return $schema;

 


Best Brands Support - We empower your business!

info@bestbrands.eu


 
  • UK Promotion
  • Junior Member
  • Members
  • Join Date: 07-May 11
  • 24 posts

Posted 31 December 2020 - 09:44 AM #3

 

It is `block_manager` not `block-manager`. Besides that, you should also clear your cache after changing those files or enable development mode and disable block caching.

app/addons/addon_name/schemas/block_manager/blocks.post.tpl

Furthermore, your schema should look as follows:

<?php

$schema['banners']['templates']['addons/addon_name/blocks/addon_name.tpl'] = array();

return $schema;

 

Thanks for the comments, I was using block_manager I just wrote it wrong when putting together the post (edited now to reflect the correct path).  Also I have changed the schema (tried this one previously and edited my post to reflect the latest "attempt") and still not working for me - cache cleared and dev mode has been one since I started.

 

If anyone else has any recommendations to why it's not displaying I would be grateful!  Thanks again harmsmitsdev.


UK Promotion
Fresh and creative brand, marketing, PR and web specialists.

 
  • UK Promotion
  • Junior Member
  • Members
  • Join Date: 07-May 11
  • 24 posts

Posted 31 December 2020 - 09:59 AM #4

QUICK UPDATE: Think I have found the problem, by adding:

<priority>5000</priority>
to addon.xml - everything seems to have kicked in!
UK Promotion
Fresh and creative brand, marketing, PR and web specialists.