EmarexIT Posted November 6, 2016 Share Posted November 6, 2016 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. 0 Quote Link to comment Share on other sites More sharing options...
EmarexIT Posted November 9, 2016 Author Share Posted November 9, 2016 any idea? anybody ? 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted November 9, 2016 Share Posted November 9, 2016 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. 0 Quote Link to comment Share on other sites More sharing options...
EmarexIT Posted November 9, 2016 Author Share Posted November 9, 2016 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? 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted November 9, 2016 Share Posted November 9, 2016 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? 0 Quote Link to comment Share on other sites More sharing options...
EmarexIT Posted November 9, 2016 Author Share Posted November 9, 2016 "$languagechangeenabled" and "$locales" variable not in the list. Blog support multilingual. 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted November 9, 2016 Share Posted November 9, 2016 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. 0 Quote Link to comment Share on other sites More sharing options...
EmarexIT Posted November 9, 2016 Author Share Posted November 9, 2016 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} 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted November 9, 2016 Share Posted November 9, 2016 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. 0 Quote Link to comment Share on other sites More sharing options...
EmarexIT Posted November 9, 2016 Author Share Posted November 9, 2016 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? 0 Quote Link to comment Share on other sites More sharing options...
EmarexIT Posted November 9, 2016 Author Share Posted November 9, 2016 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. 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted November 9, 2016 Share Posted November 9, 2016 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). 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 0 Quote Link to comment Share on other sites More sharing options...
EmarexIT Posted November 12, 2016 Author Share Posted November 12, 2016 Thanks for this brian. :idea: Regards, Emarex 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.