View Full Version : Move "Create New Article" button
Scitz0
06-15-2010, 06:25 PM
Hi,
What code/template do I need to edit to move the "Create New Article" button to the bottom of the page?
I searched and found the template vbcms_toolbar and I think its this template I need to edit or maybe the call to load the template need to be moved?
Anyone know?
Lynne
06-16-2010, 01:46 AM
To find the template to modify, do this - vboptions > General Settings > Add Template Name in HTML Comments > set to Yes . Then go back to your page and view the source code and you will see the name of the template called around your part of the code. (Sometimes the template is the one mentioned at the very top of the page source.)
Scitz0
06-16-2010, 06:43 AM
To find the template to modify, do this - vboptions > General Settings > Add Template Name in HTML Comments > set to Yes . Then go back to your page and view the source code and you will see the name of the template called around your part of the code. (Sometimes the template is the one mentioned at the very top of the page source.)
Ok thank you, will try this method.
--------------- Added 1276678759 at 1276678759 ---------------
Worked like a charm, found that I needed to edit vbcms_page and move the toolbar row at the bottom of the template.
Scitz0
06-19-2010, 05:09 AM
Ok, back to moving the button once more.
This time I want to move the button(dropdown as of 4.0.4) to the section header.
I tried to add the same code used in vbcms_page, ie {vb:raw toolbar} to the vbcms_content_section_page template just before the </h1> tag for the header. But this did nothing. So instead I copied the entire content of vbcms_toolbar and pasted this instead of {vb:raw toolbar}. Now I get the "Create New Article" text & dropdown where I want it but the dropdown box is empty :(.
Anyone able to help me out with this one?
I'm very new to template modifications so I'm not sure how it all connects and why I cant use {vb:raw toolbar} in that template and so on.
Lynne
06-19-2010, 01:56 PM
All variables must be registered for use in the template you want to use them in. Cellarius wrote a really good article that you may be interested in - [vB4] Rendering templates and registering variables - a short guide (https://vborg.vbsupport.ru/showthread.php?t=228078)
Scitz0
06-19-2010, 08:53 PM
All variables must be registered for use in the template you want to use them in. Cellarius wrote a really good article that you may be interested in - [vB4] Rendering templates and registering variables - a short guide (https://vborg.vbsupport.ru/showthread.php?t=228078)
Thanks for the answer but to be honest I didn't get much of that. As I said I'm very new to this, maybe if you could give an example of how to solve my problem above my brain will start to function properly.
Again thanks and I hope you or someone else can push me further in the right direction :)
Lynne
06-20-2010, 12:25 AM
And example would be if you were using variable $whatever in an existing template this_template like so:
{vb:raw whatever}
Then before you could do so, you would have to pre-register it using a plugin:
vB_Template::preRegister('this_template', array('whatever' => $whatever));
Scitz0
06-20-2010, 06:29 AM
Ok thank you, I think I get what your saying but I was thinking of a more specific exampel for my case. Still not sure how to preregister the vbcms_toolbar template in the vbcms_content_section_page template. I'm not even sure how vbcms_page preregister the vbcms_toolbar template in the default vb4 template. Can't find any preregistration of the vbcms_toolbar template anywhere.
I would really love if you could give me a hand in this specific case, maybe all the pieces fall into place after that.
Again, thank you for your effort.
Todo-F1
06-22-2010, 02:03 PM
Ok thank you, I think I get what your saying but I was thinking of a more specific exampel for my case. Still not sure how to preregister the vbcms_toolbar template in the vbcms_content_section_page template. I'm not even sure how vbcms_page preregister the vbcms_toolbar template in the default vb4 template. Can't find any preregistration of the vbcms_toolbar template anywhere.
I would really love if you could give me a hand in this specific case, maybe all the pieces fall into place after that.
Again, thank you for your effort.
I have exactly the same problem. I hope someone can help us.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.