Jump to content

ARKO

Member
  • Content Count

    3
  • Joined

  • Last visited

Community Reputation

0 Neutral

About ARKO

  • Rank
    Junior Member
  1. Hi Brian, Thanks for your reply, and I already did all overrides by language, the only things that are not set by the language files and template files are the sidebar items. I'm afraid they are part of the encrypted module files. One I get fixed with the hook above, and the second one I get fixed now with adding this to: "template\includes\sidebar.tpl" <div menuItemName="{$childItem->getName()}" class="list-group-item{if $childItem->getClass()} {$childItem->getClass()}{/if}" id="{$childItem->getId()}"> {if $childItem->hasBadge()}<span class="badge">{$childItem->getBadge()}</span>{/if} {if $childItem->hasIcon()}<i class="{$childItem->getIcon()}"></i>&nbsp;{/if} {* Addon: Feature Requester *} {if $smarty.server.REQUEST_URI|strstr:'m=featurerequester'} {* Rename text only menu items, without URI *} {if $childItem->getName() eq 'Total Requests'}Total Topics{else} {* Run default command, to get labels for without URI *} {$childItem->getLabel()} {* Close all the {else} statement, with one {/if} per {else} *} {/if} {* Stop: Feature Requester *} {else} {$childItem->getLabel()} {/if} </div> And I get the page header fixed by adding this code to: "template\includes\pageheader.tpl" {* Start: Pageheader customs *} {* This file must be included on top of every template: "$template/includes/pageheader.tpl" *} {include file="_q/templates/pageheader-customs.tpl" scope='global'} {* End: Pageheader customs *} <div class="header-lined"> <h1>{$title}{if $desc} <small>{$desc}</small>{/if}</h1> {if $showbreadcrumb}{include file="$template/includes/breadcrumb.tpl"}{/if} </div> Where the file "_q/templates/pageheader-customs.tpl" is having this code: {* Start: Pageheader customs *} {* This file must be included on top of every template: "$template/includes/pageheader.tpl" *} {* {include file="_q/templates/pageheader-customs.tpl" scope='global'} *} {* End: Pageheader customs *} {capture assign='pageheader-customs'} {* Addon: Feature Requester *} {* Titles *} {* Index *} {if $smarty.server.REQUEST_URI|strstr:'m=featurerequester'} {if $title eq 'Feature Requests'} {$title = 'Features and requests'}{/if} {/if} {* Stop: Addon*} {/capture} What I really like to know, is: Is it possible to replace this TPL modifications with hooks, because I'm building a WHMCS environment with multiple domains and different WHMCS templates, and I want to try to avoid to touch TPL files or what ever files that needs to be modified as much as possible. Let's say I have a lot of modules and a lot of templates, It was already a big learning curve to figure out how I can make it as flexible as possible, to manage all this without getting crazy of al possible * that can be created. So I'm loving Github more than anything in the world, to get this job done so far. Si I was hoping, that this TPL modifications can be done by hooks, because when it's done by hooks it's added to all templates. Do you have any idea if it's possible? Kind regards
  2. Hi, I'm using multiple templates, and I want to change files only if it's really needed. As a example I want to change names of items in the sidebar, to better match my needs. In the TPL files there is a code like this: {if $item->hasChildren()} <div class="list-group{if $item->getChildrenAttribute('class')} {$item->getChildrenAttribute('class')}{/if}"> {foreach $item->getChildren() as $childItem} {if $childItem->getUri()} <a menuItemName="{$childItem->getName()}" href="{$childItem->getUri()}" class="list-group-item{if $childItem->isDisabled()} disabled{/if}{if $childItem->getClass()} {$childItem->getClass()}{/if}{if $childItem->isCurrent()} active{/if}"{if $childItem->getAttribute('dataToggleTab')} data-toggle="tab"{/if}{if $childItem->getAttribute('target')} target="{$childItem->getAttribute('target')}"{/if} id="{$childItem->getId()}"> {if $childItem->hasBadge()}<span class="badge">{$childItem->getBadge()}</span>{/if} {if $childItem->hasIcon()}<i class="{$childItem->getIcon()}"></i>&nbsp;{/if} {$childItem->getLabel()} </a> {else} <div menuItemName="{$childItem->getName()}" class="list-group-item{if $childItem->getClass()} {$childItem->getClass()}{/if}" id="{$childItem->getId()}"> {if $childItem->hasBadge()}<span class="badge">{$childItem->getBadge()}</span>{/if} {if $childItem->hasIcon()}<i class="{$childItem->getIcon()}"></i>&nbsp;{/if} {$childItem->getLabel()} </div> {/if} {/foreach} </div> {/if} With some information on this community, I find out how to rename the sidebar items by a hook and ended using this code: <?php use WHMCS\View\Menu\Item as MenuItem; add_hook('ClientAreaPrimarySidebar', 1, function(MenuItem $primarySidebar) { if (!is_null($primarySidebar->getChild("My Info"))){ if (!is_null($primarySidebar->getChild("My Info")->getChild("My Requests"))){ $primarySidebar->getChild("My Info") ->getChild("My Requests") ->setLabel("My Topics"); } } if (!is_null($primarySidebar->getChild("Group Actions"))){ if (!is_null($primarySidebar->getChild("Group Actions")->getChild("Add New Request"))){ $primarySidebar->getChild("Group Actions") ->getChild("Add New Request") ->setLabel("Add New Topic"); } } }); But this is only working on the sidebar items, that has been checked in the first command as "{if $childItem->getUri()}". I tried a lot of things, but how can I replace the names of the second part? They are not with a uri link, only have a badge and count. When I set the renaming in the .tpl file, it's working but when I use a hook I can't get it working. So I hope someone can tell me, what I didn't check good enough ūüėÉ Kind regars, Arjen Kocken
  3. Hello, At the first place, this i my first topic so I hope I have the right catagory. We just migrated to WHMCS, and so far looks like the right choose. I only have one important question, because we offer our clients a interesting way to make a little money when promoting our products and services. The affiliate systems as I have seen, and also the integrated affiliate system is interesting. But we offer some products, like managed computers what is counted by configurable options, let's say per seat. How can I add a profit on configurable options for my clients? Arjen Kocken QiQQ
  4. Welcome to WHMCS.Community ARKO! We're glad you're here please take some time to familiarise yourself with the Community Rules & Guidelines and take a moment to introduce yourself to other WHMCS.Community members in the Introduce Yourself Board.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated