View Full Version : Translations dropdown in cms/blogs
Hi All,
We want to add Translations dropdown menu to cms/blogs/etc how can we do it & i did not find any option.
Thanks
Anand
You have to edit appropriate template manually and add there:
{vb:raw vbenterprisetranslatorflagsdropdown}
You will also have to register it:
1. Open /includes/vbentrprisetranslator_functions_hook.php
2. Find:
vB_Template::preRegister('navbar', array('vbenterprisetranslatorflagsdropdown' => $vbenterprisetranslatorflagsdropdown));
3. Double this line and in one copy change navbar to your template name.
I add right now, on our TODO list to implement it in next vBET version.
tried in blogtemplates/blog_navbar_link
no success
Let me know which will be the appropriate template
Also found bug when we use Translations drop down menu position -> navbar end its shown twice in nav bar see the screen for more details
http://www.architectpavilion.com/twiceshown.jpg
Also found bug when we use Translations drop down menu position -> navbar end its shown twice in nav bar see the screen for more details
http://www.architectpavilion.com/twiceshown.jpg
Are you sure you didn't add it also manually into template?
tried in blogtemplates/blog_navbar_link
no success
Let me know which will be the appropriate template
For CMS: vbcms_navbar_link
For blog: blog_navbar_link
Also I see that those templates have plugins hook, so in next release we will make it fully configurable :)
Are you sure you didn't add it also manually into template?
Yes we did not edit any templates sure its just default vb 4.0.3
Thanks
Anand
For CMS: vbcms_navbar_link
For blog: blog_navbar_link
Also I see that those templates have plugins hook, so in next release we will make it fully configurable :)
Added the code but its not working not sure what we are doing wrong
blog_navbar_link -> {vb:raw vbenterprisetranslatorflagsdropdown}
/includes/vbentrprisetranslator_functions_hook.php ->
vB_Template::preRegister('navbar', array('vbenterprisetranslatorflagsdropdown' => $vbenterprisetranslatorflagsdropdown));
vB_Template::preRegister('vbcms_navbar_link', array('vbenterprisetranslatorflagsdropdown' => $vbenterprisetranslatorflagsdropdown));
vB_Template::preRegister('blog_navbar_link', array('vbenterprisetranslatorflagsdropdown' => $vbenterprisetranslatorflagsdropdown));
blog_navbar_link -> code below
*******************************************
<vb:if condition="$vboptions['selectednavtab'] == 'vbblog'">
<li class="selected">
<a class="navtab" href="blog.php{vb:raw session.sessionurl_q}">{vb:rawphrase blogs}</a>
<ul class="floatcontainer">
{vb:raw template_hook.blog_navbar_start}
<vb:if condition="$show['canpostitems']">
<li><a href="{vb:link blog, {vb:raw bbuserinfo}, null, 'userid', 'blog_title'}">{vb:rawphrase your_blog}</a></li>
</vb:if>
{vb:raw template_hook.blog_navbar_after_your_blog}
<li><a href="blog.php?{vb:raw session.sessionurl}do=list">{vb:rawphrase recent_entries}</a></li>
{vb:raw template_hook.blog_navbar_after_recent_entries}
<li><a href="blog.php?{vb:raw session.sessionurl}do=list&blogtype=best">{vb:rawphrase best_blog_entries}</a></li>
{vb:raw template_hook.blog_navbar_after_best_entries}
<li><a href="blog.php?{vb:raw session.sessionurl}do=bloglist">{vb:rawphrase blog_list}</a></li>
{vb:raw template_hook.blog_navbar_after_blog_list}
<vb:if condition="$show['canpostitems']">
<li><a href="blog_usercp.php?{vb:raw session.sessionurl}do=editprofile">{vb:rawphrase blog_options}</a></li>
{vb:raw vbenterprisetranslatorflagsdropdown}
</vb:if>
{vb:raw template_hook.blog_navbar_end}
</ul>
</li>
<vb:else />
<li><a class="navtab" href="blog.php{vb:raw session.sessionurl_q}">{vb:rawphrase blogs}</a></li>
</vb:if>
***********************************************
In described solution you need to have set custom place for flags!
To have it working in all configurations just do replace this:
if ('cu' != $vbulletin->options['vbenterprisetranslator_translationsDropdownMenu_position']) {
$template_hook[$vbulletin->options['vbenterprisetranslator_translationsDropdownMenu_position']] .= $vbenterprisetranslatorflagsdropdown;
} else {
vB_Template::preRegister('navbar', array('vbenterprisetranslatorflagsdropdown' => $vbenterprisetranslatorflagsdropdown));
}
To this:
if ('cu' != $vbulletin->options['vbenterprisetranslator_translationsDropdownMenu_position']) {
$template_hook[$vbulletin->options['vbenterprisetranslator_translationsDropdownMenu_position']] .= $vbenterprisetranslatorflagsdropdown;
} else {
vB_Template::preRegister('navbar', array('vbenterprisetranslatorflagsdropdown' => $vbenterprisetranslatorflagsdropdown));
}
vB_Template::preRegister('vbcms_navbar_link', array('vbenterprisetranslatorflagsdropdown' => $vbenterprisetranslatorflagsdropdown));
vB_Template::preRegister('blog_navbar_link', array('vbenterprisetranslatorflagsdropdown' => $vbenterprisetranslatorflagsdropdown));
So in other words - put your 2 additional lines just 1 line lower (after "}").
Also I see that in template you put {vb:raw vbenterprisetranslatorflagsdropdown} inside of if clause - put it 1 line lower. It will give you:
*******************************************
<vb:if condition="$vboptions['selectednavtab'] == 'vbblog'">
<li class="selected">
<a class="navtab" href="blog.php{vb:raw session.sessionurl_q}">{vb:rawphrase blogs}</a>
<ul class="floatcontainer">
{vb:raw template_hook.blog_navbar_start}
<vb:if condition="$show['canpostitems']">
<li><a href="{vb:link blog, {vb:raw bbuserinfo}, null, 'userid', 'blog_title'}">{vb:rawphrase your_blog}</a></li>
</vb:if>
{vb:raw template_hook.blog_navbar_after_your_blog}
<li><a href="blog.php?{vb:raw session.sessionurl}do=list">{vb:rawphrase recent_entries}</a></li>
{vb:raw template_hook.blog_navbar_after_recent_entries}
<li><a href="blog.php?{vb:raw session.sessionurl}do=list&blogtype=best">{vb:rawphrase best_blog_entries}</a></li>
{vb:raw template_hook.blog_navbar_after_best_entries}
<li><a href="blog.php?{vb:raw session.sessionurl}do=bloglist">{vb:rawphrase blog_list}</a></li>
{vb:raw template_hook.blog_navbar_after_blog_list}
<vb:if condition="$show['canpostitems']">
<li><a href="blog_usercp.php?{vb:raw session.sessionurl}do=editprofile">{vb:rawphrase blog_options}</a></li>
</vb:if>
{vb:raw vbenterprisetranslatorflagsdropdown}
{vb:raw template_hook.blog_navbar_end}
</ul>
</li>
<vb:else />
<li><a class="navtab" href="blog.php{vb:raw session.sessionurl_q}">{vb:rawphrase blogs}</a></li>
</vb:if>
***********************************************
adding this code makes system to go blank white pages & even admincp becomes white page
Thanks
anand
In described solution you need to have set custom place for flags!
To have it working in all configurations just do replace this:
if ('cu' != $vbulletin->options['vbenterprisetranslator_translationsDropdownMenu_position']) {
$template_hook[$vbulletin->options['vbenterprisetranslator_translationsDropdownMenu_position']] .= $vbenterprisetranslatorflagsdropdown;
} else {
vB_Template::preRegister('navbar', array('vbenterprisetranslatorflagsdropdown' => $vbenterprisetranslatorflagsdropdown));
}
To this:
if ('cu' != $vbulletin->options['vbenterprisetranslator_translationsDropdownMenu_position']) {
$template_hook[$vbulletin->options['vbenterprisetranslator_translationsDropdownMenu_position']] .= $vbenterprisetranslatorflagsdropdown;
} else {
vB_Template::preRegister('navbar', array('vbenterprisetranslatorflagsdropdown' => $vbenterprisetranslatorflagsdropdown));
}
vB_Template::preRegister('vbcms_navbar_link', array('vbenterprisetranslatorflagsdropdown' => $vbenterprisetranslatorflagsdropdown));
vB_Template::preRegister('blog_navbar_link', array('vbenterprisetranslatorflagsdropdown' => $vbenterprisetranslatorflagsdropdown));
So in other words - put your 2 additional lines just 1 line lower (after "}").
Also I see that in template you put {vb:raw vbenterprisetranslatorflagsdropdown} inside of if clause - put it 1 line lower. It will give you:
*******************************************
<vb:if condition="$vboptions['selectednavtab'] == 'vbblog'">
<li class="selected">
<a class="navtab" href="blog.php{vb:raw session.sessionurl_q}">{vb:rawphrase blogs}</a>
<ul class="floatcontainer">
{vb:raw template_hook.blog_navbar_start}
<vb:if condition="$show['canpostitems']">
<li><a href="{vb:link blog, {vb:raw bbuserinfo}, null, 'userid', 'blog_title'}">{vb:rawphrase your_blog}</a></li>
</vb:if>
{vb:raw template_hook.blog_navbar_after_your_blog}
<li><a href="blog.php?{vb:raw session.sessionurl}do=list">{vb:rawphrase recent_entries}</a></li>
{vb:raw template_hook.blog_navbar_after_recent_entries}
<li><a href="blog.php?{vb:raw session.sessionurl}do=list&blogtype=best">{vb:rawphrase best_blog_entries}</a></li>
{vb:raw template_hook.blog_navbar_after_best_entries}
<li><a href="blog.php?{vb:raw session.sessionurl}do=bloglist">{vb:rawphrase blog_list}</a></li>
{vb:raw template_hook.blog_navbar_after_blog_list}
<vb:if condition="$show['canpostitems']">
<li><a href="blog_usercp.php?{vb:raw session.sessionurl}do=editprofile">{vb:rawphrase blog_options}</a></li>
</vb:if>
{vb:raw vbenterprisetranslatorflagsdropdown}
{vb:raw template_hook.blog_navbar_end}
</ul>
</li>
<vb:else />
<li><a class="navtab" href="blog.php{vb:raw session.sessionurl_q}">{vb:rawphrase blogs}</a></li>
</vb:if>
***********************************************
its sure below if code may be while copying here i missed it
its sure below if code may be while copying here i missed it
So there is an issue with blank page or given code is working? :)
given code is not working :( hope you have tested on vb 4.0.3 if not i will give you access to our webserver/vb
So there is an issue with blank page or given code is working? :)
still waiting for your replies??
still waiting for your replies??
Sorry - had to accidentally miss his message. Please PM access and I will check and correct it on place.
Done. Please note that give instructions are correct - you didn't made changes for hook file ;)
Done. Please note that give instructions are correct - you didn't made changes for hook file ;)
Thanks for the fix :D
Yes i added the code in the hooks but removed later since it gave me white blank pages & also note translation icon comes end of the navbar in blog/cms we want at start of navbar???
Also you can test yourself the navbar end problem yourself now since you have login & passwords with you
Thanks
Anand
Thanks for the fix :D
Yes i added the code in the hooks but removed later since it gave me white blank pages & also note translation icon comes end of the navbar in blog/cms we want at start of navbar???
Also you can test yourself the navbar end problem yourself now since you have login & passwords with you
Thanks
Anand
To have it at the beginning just edit appropriate template and change place of vBET variable for drop-down menu.
I wrote you in PM that navbar end issue is caused by some other mod which duplicates whole content of $template_hook['navbar_end']. Please note that we are responsible only for our code and here it is not vBET bug. Please ask about solution author of mod which causes the issue. You can find guilty one by temporally disabling other mods one by one. Also you can just set custom place and add flags manually at the end of navbar.
Added configuration options for drop down menu in CMS and BLOG navbar - will be included in 4.2.2
You can also include in " of MediaWiki " navbar? :)
You can also include in " of MediaWiki " navbar? :)
Cannot tell right now - do not know this mod. Please see answers for other posts you made about MediaWiki. I will be able to give you more specific answer when I will see how it is working on real forum. Also - to add flags for MediaViki please try first hints given here: http://www.vbenterprisetranslator.com/forum/vbet4-general-discussions/618-translations-dropdown-cms-blogs.html#post2579
But adopt it to MediaViki - so add just one preRegister line, change template name to the one used by MediaViki and add in this template our variable.
Powered by vBulletin® Version 4.2.5 Copyright © 2024 vBulletin Solutions Inc. All rights reserved.