Jump to content

How to get WHMCS menu on sub-folder?


EmarexIT

Recommended Posts

Hi everyone,

 

I installed blog add-on on my portal. "public_html/WHMCS/blog".

WHMCS Simple Blog ( https://www.whmcs.com/members/communityaddons.php?action=viewmod&id=381).

 

I want to show whmcs(core template) menus on my blog page template also.

which means menus on my template under the directory "public_html/whmcs/templates/custom_template" to directory "public_html/whmcs/blog/templates/custom_template".

 

How can i do this?

 

I try with this one {include file="{$WEB_ROOT}/template/$template/includes/navbar.tpl" navbar=$primaryNavbar} in blog template header.tpl but page shows error.

 

Kindly update me ASAP.

Link to comment
Share on other sites

have you tried asking the author of "Simple Blog" about this ? that would be my first port of call.

 

there's no online demo of Simple Blog, so I can't imagine what it looks like on your site and therefore hard to advise how to solve the issue.

 

Hi,

 

Unfortunately no response from "simple blog" support team.

 

"eservices.emarexinfotech.com/blog/" this is our website with blog.

 

Now left side menu/header top menu shows using hard-code.

 

   <!-- Language -->
           {if $languagechangeenabled && count($locales) > 1}

               <div class="pull-right nav">
                   <a   class="quick-nav" data-toggle="popover" id="languageChooser"><i class="fa fa-language"></i> {$LANG.chooselanguage} <span class="caret"></span></a>
                   <div id="languageChooserContent" class="hidden">
                       <ul>
                           {foreach from=$locales item=locale}
                               <li><a href="{$currentpagelinkback}language={$locale.language}">{$locale.localisedName}</a></li>
                           {/foreach}
                       </ul>
                   </div>
               </div>
           {/if}

 

if condion not working on blog folder header.tpl page. i think "$languagechangeenabled" variable not accesseble on blog folder.

 

any idea about this?

Link to comment
Share on other sites

two thoughts...

 

1. add a {debug} to the end of the blog template file code and you should get a popup window of available variables - that will show you which arrays you can access... remember to remove it from your code afterwards.

2. i'm assuming your blog posts aren't multilingual, so do you need the language option on the blog page anyway?

Link to comment
Share on other sites

Unfortunately no response from "simple blog" support team.

that's disappointing - I would have hoped after being charge $60+ for a module, they might support it... as they'd be in a better position than me to do it!

 

"$languagechangeenabled" and "$locales" variable not in the list.

Blog support multilingual.

well $locales must exist as the dropdown languages is seemingly using it - I assume being pulled from the header.

 

it the above code is hard-coded by you, you could try changing...

 

<li><a href="{$currentpagelinkback}language={$locale.language}">{$locale.localisedName}</a></li>

to...

 

<li><a href="{$smarty.server.PHP_SELF}?language={$locale.language}">{$locale.localisedName}</a></li>

and see if the fixes the languages links.

Link to comment
Share on other sites

dropdown languages links showing properly due-to hard-coded. like this..

 

<ul>  <li><a href="/index.php?language=arabic"">العربية</a></li>
<li><a href="/index.php?language=azerbaijani">Azerbaijani</a></li>
<li><a href="/index.php?language=catalan">Català</a></li>
<li><a href="/index.php?language=chinese">中文</a></li>
etc.. 

 

 

if I use same code on WHMCS header.tpl, languge dropdown not showing.

 

whmcs code..

{if $languagechangeenabled && count($locales) > 1}

               <div class="pull-right nav">
                   <a   class="quick-nav" data-toggle="popover" id="languageChooser"><i class="fa fa-language"></i> {$LANG.chooselanguage} <span class="caret"></span></a>
                   <div id="languageChooserContent" class="hidden">
                       <ul>
                           {foreach from=$locales item=locale}
                               <li><a href="{$currentpagelinkback}language={$locale.language}">{$locale.localisedName}</a></li>
                           {/foreach}
                       </ul>
                   </div>
               </div>
           {/if}

Link to comment
Share on other sites

ultimately, you have two problems - you're using a third-party addon on a custom template the developers didn't test it with (e.g you might be running into a problem that may not exist with the default "Six" template)... and the developers aren't responding to your support questions.

 

the blog may support multiple languages, but unless you're going to make multilingual blog posts, all this seems a little redundant - unless it's purely for design consistency.

 

it's difficult to help because I don't know the Blog code or file structure, but there are about 3 options...

 

1. do what you're currently doing and hard-code the links individually - though I still think you should be using {$smarty.server.PHP_SELF} because your current paths would be wrong.

2. create a $locales array in the template using Smarty - then the foreach would work.

3. use an action hook to create the $locales array... again, that would make the loop work.

 

personally, if 1) can be made to work, there's little point in doing 2 or 3 as WHMCS are not constantly adding/removing languages.

Link to comment
Share on other sites

2. create a $locales array in the template using Smarty - then the foreach would work.

3. use an action hook to create the $locales array... again, that would make the loop work.

 

 

I just copy paste default "SIX" template and customized. I created one ticket 1 week ago, until this no response from developer side.

 

Anyway Thank you for your valuable reply.

 

Am a beginner in WHMCS, i don't have much code experience in this.

 

Can you explain littile more about above steps(2,3) OR give an example code?

Link to comment
Share on other sites

One more question,

 

In header.tpl below code used for primary menu.

 

  <ul class="nav navbar-nav">

                   {include file="$template/includes/navbar.tpl" navbar=$primaryNavbar}

               </ul>

 

If I use same code on my blog template then didn't working.

 

If you know anything about this kind of issue replay me, otherwise leave it.

Link to comment
Share on other sites

Can you explain littile more about above steps(2,3) OR give an example code?

well i'm too tired to do 3 and write an action hook (which might not even work with the blog addon anyway) - but if you wanted to do 2, you could use the code below in your template...

 

 {assign mylocales array(
   ['language'=>'arabic','localisedName'=>'العربية'],
   ['language'=>'azerbaijani','localisedName'=>'Azerbaijani'],
   ['language'=>'catalan','localisedName'=>'Català'],
   ['language'=>'chinese','localisedName'=>'中文']
)}
   {if count($mylocales) > 1}
       <div class="pull-right nav">
            <a class="quick-nav" data-toggle="popover"  id="languageChooser"><i class="fa fa-language"></i>  {$LANG.chooselanguage} <span class="caret"></span></a>
           <div id="languageChooserContent" class="hidden">
               <ul>
                   {foreach from=$mylocales item=locale}
                        <li><a  href="{$smarty.server.PHP_SELF}?language={$locale.language}">{$locale.localisedName}</a></li>
                   {/foreach}
               </ul>
           </div>
       </div>
   {/if}

that should give you a working language dropdown, linked to the correct page, for the first four languages - it should then just be a case of adding the other languages to the array - ensuring that the last entry (Ukrainian) is the only one without a closing comma (add one to Chinese).

1l1vQLO.png

 

If I use same code on my blog template then didn't working.

you could try adding a base href to navbar.tpl - see the post I wrote below in a thread about nested folders (which is what the blog addon is doing)...

 

https://forum.whmcs.com/showthread.php?110983-Create-new-nested-page-OR-page-in-sub-folder&p=455782#post455782

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