Jump to content

Change layout clientarea home SIX (when logged in)


Sanora Dev

Recommended Posts

Hello,

I want to make some changes to the home template when a customer is logged in. (six template)

After logging in there are 4 blocks: service, qoutes, ticket, invoices (see screenshot). I want to change the block qoutes, in my case, for my projects. (Project management addon)

Can anyone point me to the right php file or documentation with instruction? I've been looking in the folder template/six/ to find the right file, but i'm thinking now, may'be it better to this with a hook?!

Thanks,
Elias

Link to comment
Share on other sites

Hi Elias,

47 minutes ago, Devias said:

After logging in there are 4 blocks: service, quotes, ticket, invoices (see screenshot).

no screenshot posted, but I know where you mean.

technically as currently coded, the order would be: services | (domains/affiliates/quotes) | tickets | invoices

so a user with existing domains in WHMCS would see a domain count rather than a quotes count - if they're seeing the quotes count, then they have no domains and not affiliates.

49 minutes ago, Devias said:

Can anyone point me to the right php file or documentation with instruction?

if you were going to do modify it in the template, it would be clientareahome.tpl in the six (or active) theme...

        {if $registerdomainenabled || $transferdomainenabled}
            <div class="col-sm-3 col-xs-6 tile" onclick="window.location='clientarea.php?action=domains'">
                <a href="clientarea.php?action=domains">
                    <div class="icon"><i class="fas fa-globe"></i></div>
                    <div class="stat">{$clientsstats.numactivedomains}</div>
                    <div class="title">{$LANG.navdomains}</div>
                    <div class="highlight bg-color-green"></div>
                </a>
            </div>
        {elseif $condlinks.affiliates && $clientsstats.isAffiliate}
            <div class="col-sm-3 col-xs-6 tile" onclick="window.location='affiliates.php'">
                <a href="affiliates.php">
                    <div class="icon"><i class="fas fa-shopping-cart"></i></div>
                    <div class="stat">{$clientsstats.numaffiliatesignups}</div>
                    <div class="title">{$LANG.affiliatessignups}</div>
                    <div class="highlight bg-color-green"></div>
                </a>
            </div>
        {else}
            <div class="col-sm-3 col-xs-6 tile" onclick="window.location='clientarea.php?action=quotes'">
                <a href="clientarea.php?action=quotes">
                    <div class="icon"><i class="far fa-file-alt"></i></div>
                    <div class="stat">{$clientsstats.numquotes}</div>
                    <div class="title">{$LANG.quotes}</div>
                    <div class="highlight bg-color-green"></div>
                </a>
            </div>
        {/if}
54 minutes ago, Devias said:

I've been looking in the folder template/six/ to find the right file, but i'm thinking now, maybe it better to this with a hook?!

these tiles are not controlled by a menu hook like the navbar, sidebar and panels etc - so the simplest solution would be to determine what these panels are going to show and modify the html accordingly - e.g even if you changed the quotes text/link to projects, if the user had domains, they wouldn't see it.

also, remember that you don't necessarily have to have 4 panels there, you could use 2, 3, 4 or 6... 1 might look weird, and 12 would look cramped or need to be spread over two rows.

whilst you could change these links with a JavaScript hook, and change the labels (either in the hook or with Language Overrides) too, you would still need to have a clear layout in mind before you tried to adjust it with a hook.

Link to comment
Share on other sites

38 minutes ago, brian! said:

Hi Elias,

no screenshot posted, but I know where you mean.

technically as currently coded, the order would be: services | (domains/affiliates/quotes) | tickets | invoices

also, remember that you don't necessarily have to have 4 panels there, you could use 2, 3, 4 or 6... 1 might look weird, and 12 would look cramped or need to be spread over two rows.

Quote

 

Quote

 

if you were going to do modify it in the template, it would be clientareahome.tpl in the six (or active) theme...


        {if $registerdomainenabled || $transferdomainenabled}
            <div class="col-sm-3 col-xs-6 tile" onclick="window.location='clientarea.php?action=domains'">
                <a href="clientarea.php?action=domains">
                    <div class="icon"><i class="fas fa-globe"></i></div>
                    <div class="stat">{$clientsstats.numactivedomains}</div>
                    <div class="title">{$LANG.navdomains}</div>
                    <div class="highlight bg-color-green"></div>
                </a>
            </div>
        {elseif $condlinks.affiliates && $clientsstats.isAffiliate}
            <div class="col-sm-3 col-xs-6 tile" onclick="window.location='affiliates.php'">
                <a href="affiliates.php">
                    <div class="icon"><i class="fas fa-shopping-cart"></i></div>
                    <div class="stat">{$clientsstats.numaffiliatesignups}</div>
                    <div class="title">{$LANG.affiliatessignups}</div>
                    <div class="highlight bg-color-green"></div>
                </a>
            </div>
        {else}
            <div class="col-sm-3 col-xs-6 tile" onclick="window.location='clientarea.php?action=quotes'">
                <a href="clientarea.php?action=quotes">
                    <div class="icon"><i class="far fa-file-alt"></i></div>
                    <div class="stat">{$clientsstats.numquotes}</div>
                    <div class="title">{$LANG.quotes}</div>
                    <div class="highlight bg-color-green"></div>
                </a>
            </div>
        {/if}

these tiles are not controlled by a menu hook like the navbar, sidebar and panels etc - so the simplest solution would be to determine what these panels are going to show and modify the html accordingly - e.g even if you changed the quotes text/link to projects, if the user had domains, they wouldn't see it.

also, remember that you don't necessarily have to have 4 panels there, you could use 2, 3, 4 or 6... 1 might look weird, and 12 would look cramped or need to be spread over two rows.

whilst you could change these links with a JavaScript hook, and change the labels (either in the hook or with Language Overrides) too, you would still need to have a clear layout in mind before you tried to adjust it with a hook.

Oops, screenshot forgotten. I added the screenshot for future reference.

Thanks Brian, clientareahome.tpl is the file i was looking for. Time to start editing :-).
If i edit this file will i lose my changes if i update to a new version of WHMCS?

Quote

so a user with existing domains in WHMCS would see a domain count rather than a quotes count - if they're seeing the quotes count, then they have no domains and not affiliates.

We won't be using domains in this case, only project management with billing.

Quote

also, remember that you don't necessarily have to have 4 panels there, you could use 2, 3, 4 or 6... 1 might look weird, and 12 would look cramped or need to be spread over two rows.

Good to know that i can make more tiles/panels.

Thanks,
Elias

 

WHMCS client area home.jpg

Link to comment
Share on other sites

3 hours ago, Devias said:

If i edit this file will i lose my changes if i update to a new version of WHMCS?

yes - so keep a copy of the file.

as I said, it's possible to use a hook to replace the content, but it will be better for you to get your head around how you want to arrange these tiles first - once you've got that html code worked out, then I could show you how to use a hook to do it and avoid the update issue.

Link to comment
Share on other sites

On 10/13/2020 at 6:36 PM, brian! said:

yes - so keep a copy of the file.

as I said, it's possible to use a hook to replace the content, but it will be better for you to get your head around how you want to arrange these tiles first - once you've got that html code worked out, then I could show you how to use a hook to do it and avoid the update issue.

I've added two tiles to the clientarea, downloads and projects and made 2 columns of 3 instead of 4. (screenshot added)

If i can make a hook of this so that i don't lose my customization would be nice, but i've other issues first.

How to get the stats of (in my case) dowloads and projects?

And how to add a link to the code of downloads?

This is the code now:

		<div class="col-sm-4 col-xs-6 tile" onclick="window.location='clientarea.php?action=downloads'">
            <a href="clientarea.php?action=downloads">
                <div class="icon"><i class="fas fa-download"></i></div>
                <div class="stat">{$clientsstats.???}</div>
                <div class="title">{$LANG.downloadname}</div>
                <div class="highlight bg-color-purple"></div>
            </a>
        </div>
		<div class="col-sm-4 col-xs-6 tile" onclick="window.location='index.php?m=project_management'">
            <a href="index.php?m=project_management">
                <div class="icon"><i class="fas fa-download"></i></div>
                <div class="stat">{$clientsstats.???}</div>
                <div class="title">{$LANG.projectsTile}</div>
                <div class="highlight bg-color-blue"></div>
            </a>
        </div>

As you can see i don't now how to get the stats (for both downloads and projects) and url of the download tile. (the added url doesn't work)

Regarding the stats i've found this topic:

There is a quote from Brian saying to put {debug} to the template.

Quote

add {debug} to the template code of the template you want to use the variable in and you'll get a popup window with the list of available variables, along with their current values, yourself. :idea:

and then remember to remove {debug} when you're finished.

Do i need to add {debug} to a .tpl file? like downloads.tpl? and call the tpl file to get a variable?

tiles.jpg

Link to comment
Share on other sites

43 minutes ago, Devias said:

How to get the stats of (in my case) downloads and projects?

you will have to query the database to get the values - they almost certainly won't exist by default.

45 minutes ago, Devias said:

And how to add a link to the code of downloads?

what are you defining as downloads? the client files that an admin can upload to make available for a specific user to download in their client area, or generic downloads ??

47 minutes ago, Devias said:

As you can see i don't now how to get the stats (for both downloads and projects) and url of the download tile. (the added url doesn't work)

if it's client files, then I don't think there is an existing page in the client area - you'd have to create your own.... individual links would be shown in a panel on the homepage by default.

48 minutes ago, Devias said:

Do i need to add {debug} to a .tpl file?

it would be clientareahome.tpl - though once a client is logged in, $clientsstats would exist on every client area page... but it's clientareahome where you need to know the value (if you're talking about counts and the template).

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • 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