Important: This page is using cookies (cookies). Using this website without turning off cookies in browser, means that you agree for using it.
Buy Now! Features Downloads

Earn with us!

If you would like to start earning money with vBET join to Affiliate Program.
Page 1 of 3 123 LastLast
Results 1 to 10 of 21

Thread: Translations dropdown in cms/blogs

  1. #1
    Junior Member
    Join Date
    Apr 2010
    Posts
    15

    Default 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

  2. #2
    Michał Podbielski (vBET Staff) vBET's Avatar
    Join Date
    Oct 2009
    Posts
    3,037

    Default

    You have to edit appropriate template manually and add there:
    Code:
    {vb:raw vbenterprisetranslatorflagsdropdown}
    You will also have to register it:
    1. Open /includes/vbentrprisetranslator_functions_hook.php
    2. Find:
    PHP Code:
    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.

  3. #3
    Junior Member
    Join Date
    Apr 2010
    Posts
    15

    Default

    tried in blogtemplates/blog_navbar_link

    no success

    Let me know which will be the appropriate template

  4. #4
    Junior Member
    Join Date
    Apr 2010
    Posts
    15

    Default

    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

  5. #5
    Michał Podbielski (vBET Staff) vBET's Avatar
    Join Date
    Oct 2009
    Posts
    3,037

    Default

    Quote Originally Posted by anand View Post
    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?

  6. #6
    Michał Podbielski (vBET Staff) vBET's Avatar
    Join Date
    Oct 2009
    Posts
    3,037

    Default

    Quote Originally Posted by anand View Post
    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

  7. #7
    Junior Member
    Join Date
    Apr 2010
    Posts
    15

    Default

    Quote Originally Posted by vBET View Post
    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

  8. #8
    Junior Member
    Join Date
    Apr 2010
    Posts
    15

    Default

    Quote Originally Posted by vBET View Post
    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 ->


    Code:
    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

    Code:
    *******************************************
    <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&amp;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>
    ***********************************************
    Last edited by vBET; 26-04-10 at 23:40. Reason: code bbcode added

  9. #9
    Michał Podbielski (vBET Staff) vBET's Avatar
    Join Date
    Oct 2009
    Posts
    3,037

    Default

    In described solution you need to have set custom place for flags!

    To have it working in all configurations just do replace this:
    PHP Code:
    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:
    PHP Code:
    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:
    Code:
    *******************************************
    <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&amp;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>
    ***********************************************
    Last edited by vBET; 26-04-10 at 23:49.

  10. #10
    Junior Member
    Join Date
    Apr 2010
    Posts
    15

    Default

    adding this code makes system to go blank white pages & even admincp becomes white page

    Thanks
    anand

Page 1 of 3 123 LastLast

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •